/* ═══════════════════════════════════════════════════════════════════════════
   MUSEO DELLE VOCI ARTIFICIALI
   Base CSS — Design System Foundation
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   CSS VARIABLES — Design Tokens
   ═══════════════════════════════════════════ */
:root {
    /* ─── Core Colors ─── */
    --nero-profondo: #0a0a0a;
    --nero-soft: #121212;
    --nero-card: #1a1a1a;
    --bianco: #f5f5f5;
    --grigio: #888888;
    --grigio-scuro: #444444;

    /* ─── Gold Palette (Default Theme) ─── */
    --oro-antico: #c9a227;
    --oro-chiaro: #e8d48a;
    --oro-scuro: #8b7019;
    --oro-glow: rgba(201, 162, 39, 0.15);
    --oro-dim: rgba(201, 162, 39, 0.4);

    /* ─── Blue Palette ─── */
    --blu-abissale: #0d1b2a;
    --blu-luminoso: #1b4965;
    --blu-glow: #00b4d8;

    /* ─── Cyan Palette ─── */
    --ciano-vivo: #00d4d4;
    --ciano-glow: rgba(0, 212, 212, 0.15);

    /* ─── Red Palette ─── */
    --rosso-sangue: #8b0000;
    --rosso-luminoso: #dc2626;
    --rosso-glow: #ff4444;

    /* ─── Semantic Colors (Theme-Aware) ─── */
    --accent: var(--oro-antico);
    --accent-light: var(--oro-chiaro);
    --accent-dark: var(--oro-scuro);
    --accent-glow: var(--oro-glow);
    --accent-dim: var(--oro-dim);

    /* ─── UI Colors ─── */
    --border-color: rgba(201, 162, 39, 0.2);
    --border-hover: rgba(201, 162, 39, 0.5);
    --text-primary: var(--bianco);
    --text-muted: rgba(245, 245, 245, 0.7);
    --text-dim: rgba(245, 245, 245, 0.4);
    --bg-primary: var(--nero-profondo);
    --bg-elevated: #0d0d0d;
    --bg-card: #111111;

    /* ─── Feedback Colors ─── */
    --color-error: #c94a4a;
    --color-success: #4ac970;
    --color-warning: #d4a017;

    /* ─── Typography ─── */
    --font-display: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* ─── Spacing Scale ─── */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* ─── Border Radius ─── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* ─── Transitions ─── */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* ─── Z-Index Layers ─── */
    --z-base: 1;
    --z-content: 10;
    --z-sticky: 50;
    --z-header: 100;
    --z-dropdown: 200;
    --z-modal: 500;
    --z-tooltip: 600;
    --z-entrance: 1000;

    /* ─── Header/Footer Dimensions ─── */
    --header-height: 64px;
    --footer-bar-height: 48px;
}

/* ═══════════════════════════════════════════
   CSS RESET — Modern Normalization
   ═══════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

body.no-scroll {
    overflow: hidden;
}

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

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

/* ─── Buttons ─── */
button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ─── Media ─── */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* ─── Forms ─── */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ─── Lists ─── */
ul, ol {
    list-style: none;
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY — Base Styles
   ═══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1em;
}

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

/* ═══════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════ */

/* Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible */
.focus-visible:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Text truncation */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════
   ANIMATIONS — Keyframes
   ═══════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════ */
::selection {
    background: var(--accent);
    color: var(--nero-profondo);
}

::-moz-selection {
    background: var(--accent);
    color: var(--nero-profondo);
}

/* ═══════════════════════════════════════════
   SCROLLBAR (WebKit)
   ═══════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--nero-soft);
}

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

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