/* ============================================
   COSMIC OBSERVATORY THEME - Shared Styles
   doctorhump.com Design System
   ============================================ */

/* ============================================
   CSS VARIABLES (Design Tokens)
   ============================================ */
:root {
    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Brand Colors - Warm Amber Palette */
    --amber-100: #fef3e2;
    --amber-200: #fde5c3;
    --amber-300: #f9c784;
    --amber-400: #e8a560;
    --amber-500: #c86d3a;
    --amber-600: #9c4a24;
    --amber-700: #6d3218;

    /* Cosmic Colors */
    --space-950: #03001e;
    --space-900: #0a0520;
    --space-800: #140a30;
    --space-700: #1e1045;

    /* Neutrals */
    --slate-900: #1a1a2e;
    --slate-800: #2d2d44;
    --slate-700: #3d3d5c;
    --slate-600: #4a4a6a;
    --slate-500: #6b6b8a;
    --slate-400: #9090a8;
    --slate-300: #b8b8c8;
    --slate-200: #d8d8e4;
    --slate-100: #f0f0f5;

    /* Glass Effects */
    --glass-white: rgba(255, 255, 255, 0.88);
    --glass-white-hover: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 30px rgba(200, 109, 58, 0.25);

    /* Animation Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================
   BASE RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background-color: var(--space-950);
    background-image: url('james-webb-background_smallest.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
    color: var(--slate-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   STARFIELD CANVAS
   ============================================ */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   CURSOR TRAIL
   ============================================ */
.cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--amber-400), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body:hover .cursor-trail {
    opacity: 1;
}

.trail-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 165, 96, 0.6), transparent 70%);
}

/* ============================================
   NEBULA OVERLAY
   ============================================ */
.nebula-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(200, 109, 58, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 70%, rgba(109, 50, 24, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 60% at 50% 90%, rgba(3, 0, 30, 0.1) 0%, transparent 50%);
    animation: nebulaShift 30s ease-in-out infinite alternate;
}

@keyframes nebulaShift {
    0% {
        background:
            radial-gradient(ellipse 80% 50% at 20% 30%, rgba(200, 109, 58, 0.08) 0%, transparent 50%),
            radial-gradient(ellipse 60% 40% at 80% 70%, rgba(109, 50, 24, 0.06) 0%, transparent 50%),
            radial-gradient(ellipse 50% 60% at 50% 90%, rgba(3, 0, 30, 0.1) 0%, transparent 50%);
    }
    100% {
        background:
            radial-gradient(ellipse 70% 60% at 30% 40%, rgba(200, 109, 58, 0.1) 0%, transparent 50%),
            radial-gradient(ellipse 50% 50% at 70% 60%, rgba(109, 50, 24, 0.08) 0%, transparent 50%),
            radial-gradient(ellipse 60% 50% at 40% 80%, rgba(3, 0, 30, 0.12) 0%, transparent 50%);
    }
}

/* ============================================
   COSMIC VIGNETTE
   ============================================ */
.cosmic-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(3, 0, 30, 0.4) 100%);
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

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

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 32px;
    max-width: 920px;
    margin: 0 auto 28px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--slate-900);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.nav-brand:hover {
    color: var(--amber-500);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--slate-600);
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--amber-400), var(--amber-500));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out-expo);
}

.nav-links a:hover { color: var(--amber-600); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--amber-600); font-weight: 600; }

/* ============================================
   SOCIAL BAR
   ============================================ */
.social-bar-wrapper {
    display: flex;
    justify-content: center;
    margin: -12px auto 24px;
    position: relative;
    z-index: 99;
}

.social-bar {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500), var(--amber-600));
    border-radius: 100px;
    padding: 10px 24px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.social-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

.social-bar-label {
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.social-bar-icons { display: flex; gap: 10px; align-items: center; }

.social-bar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s var(--ease-spring);
    position: relative;
    z-index: 1;
}

.social-bar-icon:hover { transform: scale(1.15) translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); }
.social-bar-icon.email:hover { background: var(--amber-100); }
.social-bar-icon.linkedin:hover { background: #e8f4fc; }
.social-bar-icon.youtube:hover { background: #ffe8e8; }
.social-bar-icon.tiktok:hover { background: #f0f0f0; }
.social-bar-icon svg { width: 15px; height: 15px; transition: transform 0.3s ease; }
.social-bar-icon:hover svg { transform: scale(1.1); }
.social-bar-icon.email svg { fill: var(--amber-500); }
.social-bar-icon.linkedin svg { fill: #0077b5; }
.social-bar-icon.youtube svg { fill: #ff0000; }
.social-bar-icon.tiktok svg { fill: #000000; }
.social-bar-divider { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.3); }

/* ============================================
   MAIN CONTAINER (Glass Card)
   ============================================ */
.container {
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 64px 56px;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Corner accents */
.container::before, .container::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid var(--amber-300);
    opacity: 0.4;
    pointer-events: none;
}

.container::before { top: 16px; left: 16px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.container::after { bottom: 16px; right: 16px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    line-height: 1.1;
    margin-bottom: 10px;
}

h2 {
    font-size: clamp(1.3rem, 3vw, 1.5rem);
    margin-bottom: 30px;
}

h3 {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--slate-700);
}

p, .content {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--slate-700);
    line-height: 1.8;
}

a {
    color: var(--amber-500);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--amber-600);
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
    height: 1px;
    margin: 48px 0;
    position: relative;
    background: linear-gradient(90deg, transparent, var(--amber-300), var(--amber-400), var(--amber-300), transparent);
    opacity: 0.5;
}

.divider::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--amber-400);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--amber-400);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn, .cosmic-btn {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
    text-decoration: none;
    display: inline-block;
}

.btn-primary, .cosmic-btn {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover, .cosmic-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(200, 109, 58, 0.4);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.4s var(--ease-spring);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.8);
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 16px;
        padding: 20px 24px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 24px;
    }

    .container {
        padding: 40px 28px;
        border-radius: 20px;
    }

    .container::before, .container::after { width: 35px; height: 35px; }
}

@media (max-width: 480px) {
    .social-bar { padding: 8px 16px; gap: 10px; }
    .social-bar-label { font-size: 0.6rem; }
    .social-bar-icon { width: 28px; height: 28px; }
    .social-bar-icon svg { width: 13px; height: 13px; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    #starfield, .cursor-trail { display: none; }
    .reveal, .reveal-scale { opacity: 1; transform: none; }
}
