/* ==========================================================================
   OBSERVATORY TEMPLATE - PREMIUM CSS
   Cosmic design system for planetariums and space centers
   ========================================================================== */

/* ==========================================================================
   CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */

:root {
    /* Colors - Cosmic Palette */
    --color-space-black: #050510;
    --color-space-dark: #0a0a1a;
    --color-space-deep: #101020;
    --color-cosmic-purple: #8b5cf6;
    --color-cosmic-purple-light: #a78bfa;
    --color-cosmic-purple-dark: #7c3aed;
    --color-nebula-blue: #3b82f6;
    --color-nebula-cyan: #06b6d4;
    --color-star-white: #f8fafc;
    --color-star-silver: #e2e8f0;
    --color-gold: #fbbf24;
    --color-gold-light: #fcd34d;

    /* Neutrals */
    --color-neutral-50: #f8fafc;
    --color-neutral-100: #f1f5f9;
    --color-neutral-200: #e2e8f0;
    --color-neutral-300: #cbd5e1;
    --color-neutral-400: #94a3b8;
    --color-neutral-500: #64748b;
    --color-neutral-600: #475569;
    --color-neutral-700: #334155;
    --color-neutral-800: #1e293b;
    --color-neutral-900: #0f172a;

    /* Typography Scale */
    --text-hero: clamp(3rem, 8vw, 6rem);
    --text-display: clamp(2.5rem, 5vw, 4rem);
    --text-h1: clamp(2rem, 4vw, 3rem);
    --text-h2: clamp(1.5rem, 3vw, 2.25rem);
    --text-h3: clamp(1.25rem, 2vw, 1.5rem);
    --text-body: 1rem;
    --text-small: 0.875rem;
    --text-xs: 0.75rem;

    /* Spacing Scale (8px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-glow-purple: 0 0 60px rgba(139, 92, 246, 0.3);
    --shadow-glow-blue: 0 0 60px rgba(59, 130, 246, 0.3);
    --shadow-glow-gold: 0 0 40px rgba(251, 191, 36, 0.4);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 500ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-body);
    line-height: 1.6;
    color: var(--color-star-white);
    background-color: var(--color-space-black);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-star-white);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

a {
    color: var(--color-cosmic-purple-light);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-cosmic-purple);
}

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

/* Selection */
::selection {
    background-color: var(--color-cosmic-purple);
    color: var(--color-star-white);
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--color-cosmic-purple);
    outline-offset: 2px;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

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

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: var(--space-4);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: var(--color-space-dark);
    color: var(--color-star-white);
}

/* Text Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--color-cosmic-purple-light) 0%, var(--color-nebula-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gold-gradient {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   COSMIC BACKGROUNDS
   ========================================================================== */

.bg-space {
    background-color: var(--color-space-black);
    position: relative;
}

.bg-space-dark {
    background-color: var(--color-space-dark);
    position: relative;
}

.bg-space-deep {
    background-color: var(--color-space-deep);
    position: relative;
}

.bg-cosmic-gradient {
    background: linear-gradient(135deg,
        var(--color-space-black) 0%,
        var(--color-space-deep) 50%,
        var(--color-space-dark) 100%
    );
}

.bg-nebula-gradient {
    background: radial-gradient(
        ellipse at top,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(59, 130, 246, 0.1) 30%,
        transparent 70%
    );
}

.bg-mesh {
    background:
        radial-gradient(at 20% 30%, rgba(139, 92, 246, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 20%, rgba(59, 130, 246, 0.2) 0px, transparent 50%),
        radial-gradient(at 50% 80%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
}

/* Star Field Background */
.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.star.small {
    width: 1px;
    height: 1px;
    opacity: 0.5;
}

.star.medium {
    width: 2px;
    height: 2px;
    opacity: 0.7;
}

.star.large {
    width: 3px;
    height: 3px;
    opacity: 0.9;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Twinkle Animation */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow),
                transform var(--transition-slow);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all var(--transition-slow);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all var(--transition-slow);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all var(--transition-slow);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Hover Animations */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.hover-glow-purple:hover {
    box-shadow: var(--shadow-glow-purple);
}

.hover-glow-blue:hover {
    box-shadow: var(--shadow-glow-blue);
}

.hover-glow-gold:hover {
    box-shadow: var(--shadow-glow-gold);
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse Animation */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Gradient Shift */
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* Rotate Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-rotate-slow {
    animation: rotate 20s linear infinite;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 16, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-star-white);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo svg {
    width: 32px;
    height: 32px;
    color: var(--color-cosmic-purple);
}

.nav-links {
    display: none;
    gap: var(--space-8);
    list-style: none;
}

.nav-links li a {
    color: var(--color-star-silver);
    font-size: var(--text-small);
    font-weight: 500;
    transition: color var(--transition-base);
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-cosmic-purple);
    transition: width var(--transition-base);
}

.nav-links li a:hover {
    color: var(--color-star-white);
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-star-silver);
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-star-white);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.cta-button {
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--color-cosmic-purple) 0%, var(--color-cosmic-purple-dark) 100%);
    color: var(--color-star-white);
    border-radius: var(--radius-full);
    font-size: var(--text-small);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.mobile-menu-toggle {
    display: block;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-star-white);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Desktop Navigation */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 16, 0.98);
    backdrop-filter: blur(20px);
    padding: var(--space-8);
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.mobile-menu ul li a {
    font-size: 1.25rem;
    color: var(--color-star-silver);
    display: block;
    padding: var(--space-4);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    z-index: 10;
    position: relative;
}

.hero h1 {
    font-size: var(--text-hero);
    margin-bottom: var(--space-6);
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-neutral-300);
    margin-bottom: var(--space-8);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    font-size: var(--text-body);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-cosmic-purple) 0%, var(--color-cosmic-purple-dark) 100%);
    color: var(--color-star-white);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-cosmic-purple-light);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--color-cosmic-purple);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: rgba(16, 16, 32, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--color-cosmic-purple);
    box-shadow: var(--shadow-glow-purple);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--color-cosmic-purple) 0%, var(--color-nebula-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-star-white);
}

.card h3 {
    font-size: var(--text-h3);
    margin-bottom: var(--space-4);
}

.card p {
    color: var(--color-neutral-300);
    line-height: 1.7;
}

/* Event Card */
.event-card {
    display: flex;
    gap: var(--space-6);
    background: rgba(16, 16, 32, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.event-card:hover {
    border-color: var(--color-cosmic-purple);
    transform: translateX(8px);
}

.event-date {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-cosmic-purple) 0%, var(--color-nebula-blue) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.event-date .day {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.event-date .month {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.9;
}

.event-info h3 {
    margin-bottom: var(--space-2);
}

.event-meta {
    display: flex;
    gap: var(--space-4);
    font-size: var(--text-small);
    color: var(--color-neutral-400);
    margin-bottom: var(--space-3);
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

section {
    padding: var(--space-24) 0;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-16);
}

.section-label {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-cosmic-purple-light);
    border-radius: var(--radius-full);
    font-size: var(--text-small);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.section-header h2 {
    margin-bottom: var(--space-4);
}

.section-header p {
    color: var(--color-neutral-300);
    font-size: 1.125rem;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--space-8);
}

.grid-2 {
    grid-template-columns: 1fr;
}

.grid-3 {
    grid-template-columns: 1fr;
}

.grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
    background: var(--color-space-dark);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    padding: var(--space-20) 0 var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
}

.footer-brand p {
    color: var(--color-neutral-400);
    margin-bottom: var(--space-6);
    max-width: 300px;
}

.social-links {
    display: flex;
    gap: var(--space-4);
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-cosmic-purple-light);
    transition: all var(--transition-base);
}

.social-links a:hover {
    background: var(--color-cosmic-purple);
    color: var(--color-star-white);
    transform: translateY(-2px);
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: var(--space-4);
    color: var(--color-star-white);
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-links ul li a {
    color: var(--color-neutral-400);
    font-size: var(--text-small);
    transition: color var(--transition-base);
}

.footer-links ul li a:hover {
    color: var(--color-cosmic-purple-light);
}

.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    justify-content: center;
    text-align: center;
}

.footer-bottom p {
    color: var(--color-neutral-500);
    font-size: var(--text-small);
}

.footer-bottom-links {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.footer-bottom-links a {
    color: var(--color-neutral-500);
    font-size: var(--text-small);
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--color-star-white);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-4);
    background: rgba(16, 16, 32, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    color: var(--color-star-white);
    font-size: var(--text-body);
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-cosmic-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   CUSTOM SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
    width: 12px;
}

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

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

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

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    nav,
    footer,
    .star-field,
    .theme-toggle {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}
