/* ============================================
   ROSANA - Custom Styles
   Variables, animations, glassmorphism, star canvas
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-bg: #0D0D0D;
    --color-bg-alt: #0A0A0A;
    --color-surface: #1C1C1C;
    --color-surface-light: #2A2A2A;
    --color-primary: #C0392B;
    --color-primary-vivid: #E74C3C;
    --color-primary-dark: #8B1A1A;
    --color-coral: #D4654A;
    --color-cyan: #5CC8D4;
    --color-cyan-light: #A8E6F0;
    --color-blue: #1B6CA8;
    --color-text: #F5F0E8;
    --color-text-muted: #94A3B8;
    --color-gold: #F2C94C;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Spline Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }

/* --- Skip to Content (Accessibility) --- */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    font-weight: 600;
    transition: top 0.2s;
}

.skip-to-content:focus {
    top: 0;
}

/* --- Stars Background --- */
.stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Glassmorphism Navigation --- */
.glass-nav {
    background: rgba(13, 13, 13, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-nav.scrolled {
    background: rgba(13, 13, 13, 0.92);
    border-color: rgba(192, 57, 43, 0.15);
}

/* --- Moon Phase Animation --- */
.moon-container {
    position: relative;
    width: clamp(180px, 25vw, 300px);
    height: clamp(180px, 25vw, 300px);
}

.moon-phase {
    position: absolute;
    inset: 0;
    transition: opacity 1.5s ease-in-out;
}

.moon-phase img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- Starry Background CSS Fallback --- */
.starry-bg {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(245, 240, 232, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(245, 240, 232, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(245, 240, 232, 0.04) 1px, transparent 1px);
    background-size: 200px 200px;
}

/* --- Fade-in Animation --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Focus States (Accessibility) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* --- Mobile Menu Overlay --- */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-text);
    transition: color 0.3s;
}

.mobile-menu a:hover {
    color: var(--color-primary);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .fade-in {
        opacity: 1;
        transform: none;
    }
    .moon-phase {
        transition-duration: 0.01ms !important;
    }
}
