:root {
    --bg: #fafafa;
    --text: #222;
    --accent: #ff6b00;
    --card-bg: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg: #121212;
    --text: #f0f0f0;
    --accent: #ff8c42;
    --card-bg: #1e1e1e;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

body {
    margin: 0;
    padding: 2rem;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: grid;
    place-items: center;
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 500px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

header {
    margin-bottom: 2rem;
    transform-origin: top;
    animation: headerIntro 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

h1 {
    font-size: 2.5rem;
    margin: 0 0 0.25rem;
    color: var(--accent);
    display: inline-block;
}

h1:hover {
    animation: textWiggle 0.4s ease;
}

p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.rigby-image {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transform: perspective(800px) rotateY(0deg);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    animation: float 6s ease-in-out infinite;
}

.rigby-image:hover {
    transform: perspective(800px) rotateY(10deg) scale(1.03);
    animation-play-state: paused;
}

#darkModeToggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--card-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

#darkModeToggle:hover {
    transform: scale(1.1) rotate(180deg);
    animation: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes headerIntro {
    from { 
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from { 
        transform: translateY(10px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 0.8;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes textWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(3deg); }
    75% { transform: rotate(-3deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    h1 {
        font-size: 2rem;
    }
}