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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    overflow-x: hidden;
    color: #000;
    transition: background-color 1s ease, filter 0.5s ease;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(203, 9, 9, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #ddd;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    font-weight: 600;
    font-size: 1rem;
}

/* Weather Controls - Testing only */
.weather-controls {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    z-index: 10000;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

.weather-controls h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.weather-controls label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.weather-controls input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.weather-controls button {
    background: #fff;
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: 1rem;
    width: 100%;
}

.weather-controls button:hover {
    background: #ddd;
}

.presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.presets button {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin: 0;
}

/* Weather Info Display */
.weather-info {
    position: fixed;
    bottom: 6rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 1.5rem;
    border: 2px solid #000;
    z-index: 150;
    backdrop-filter: blur(10px);
}

.weather-icon {
    font-size: 2rem;
}

.weather-text {
    display: flex;
    flex-direction: column;
}

.weather-text span {
    font-weight: 700;
    font-size: 0.95rem;
}

.weather-text small {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Floating Name */
.floating-name {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 3rem;
    border: 4px solid #000;
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.8s ease;
    pointer-events: none;
}

.floating-name h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
}

.floating-name .tagline {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.7;
}

/* Corner Navigation */
.corner-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 200;
    display: flex;
    gap: 2rem;
}

.corner-nav a {
    color: #000;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s;
}

.corner-nav a:hover {
    border-bottom: 3px solid #000;
}

/* Chaos Container - Weather-driven */
.chaos-container {
    width: 100%;
    min-height: 150vh;
    position: relative;
    padding: 10% 5%;
}

/* Project Items - Positioned by weather */
.project-item,
.photo-item {
    position: absolute;
    cursor: pointer;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), 
                left 0.8s ease, 
                top 0.8s ease,
                filter 0.5s ease;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.15));
    will-change: transform, left, top;
}

.project-item:hover {
    transform: scale(1.08) rotate(0deg) !important;
    z-index: 500 !important;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.25));
}

.project-item img,
.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    border: 3px solid #000;
}

/* Photo item - more stable (eye of storm) */
.photo-item {
    cursor: pointer;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.2));
}

.photo-item img {
    border: 4px solid #000;
}

.photo-item:hover {
    transform: scale(1.03) !important;
    z-index: 501 !important;
}


/* Project Labels - Hover reveal */
.project-label {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 3px solid #000;
    padding: 1rem 1.5rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    pointer-events: none;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.project-item:hover .project-label {
    opacity: 1;
    bottom: -25px;
}

.project-label h3 {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 0.3rem;
}

.project-label span {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Year Label - Object Recognition Box */
.year-label {
    position: absolute;
    top: -2px;
    left: -2px;
    background: #000;
    color: #0f0;
    border: 3px solid #000;
    padding: 0.25rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    letter-spacing: 1px;
    z-index: 10;
}

.project-item:hover .year-label {
    opacity: 1;
}

/* Minimal Footer */
.minimal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-top: 3px solid #000;
    padding: 1.5rem 2rem;
    z-index: 150;
    backdrop-filter: blur(10px);
}

.contact-info {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-info a {
    color: #000;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.contact-info a:hover {
    border-bottom: 2px solid #000;
}

/* Temperature-based color shifts */
body.temp-cold {
    background: #f0f4f8;
    filter: hue-rotate(200deg) saturate(1.2);
}

body.temp-warm {
    background: #faf8f0;
    filter: hue-rotate(20deg) saturate(1.1);
}

body.temp-hot {
    background: #faf5f0;
    filter: hue-rotate(30deg) saturate(1.2);
}

/* Responsive */
@media (max-width: 768px) {
    .weather-controls {
        font-size: 0.85rem;
        padding: 1rem;
        max-width: 90%;
    }
    
    .floating-name {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin: 2rem 1rem;
        padding: 1.5rem 2rem;
    }
    
    .corner-nav {
        position: relative;
        top: 0;
        right: 0;
        justify-content: center;
        margin: 1rem;
    }
    
    .chaos-container {
        position: relative;
        min-height: auto;
        padding: 2rem 1rem;
    }
    
    .project-item,
    .photo-item {
        position: relative !important;
        width: 100% !important;
        max-width: 400px;
        margin: 2rem auto !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
    }
    
    .project-label {
        position: relative;
        opacity: 1;
        bottom: 0;
        transform: none;
        margin-top: 1rem;
        white-space: normal;
    }
    
    .weather-info {
        position: relative;
        bottom: 0;
        left: 0;
        margin: 1rem;
    }
}

/* Uncertainty-based color shifts */
body {
    transition: background-color 1s ease, filter 1s ease;
}

body.uncertainty-low {
    background: #fafafa;
}

body.uncertainty-medium {
    background: #9698ff;
}

body.uncertainty-high {
    background: #ffff48;
}

body.uncertainty-extreme {
    background: #ff075a;
}

/* Uncertainty display styling */
.uncertainty-display {
    position: fixed;
    top: 5%;
    left: 2rem;
    transform: translateY(-50%);
    z-index: 250;
    text-align: center;
}

.uncertainty-number {
    font-size: 4rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: #8b8b8b;
    line-height: 0.8;
    opacity: 0.5;
    transition: opacity 0.3s, color 0.5s;
}

.uncertainty-display:hover .uncertainty-number {
    opacity: 0.8;
}

.uncertainty-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.3;
    margin-top: 0.5rem;
}

/* Color shifts get more intense with uncertainty */
body.uncertainty-extreme .uncertainty-number {
    color: #ff00ff;
    text-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

/* Smooth transitions for uncertainty changes */
.project-item,
.photo-item {
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), 
                left 0.8s ease, 
                top 0.8s ease,
                filter 0.5s ease;
}

/* Paper texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 9999;
}
