/**
 * home.css - Home Page Styles
 *
 * Styles specific to the home page (index.html).
 * Uses design tokens from variables.css.
 *
 * Animated version - CSS keyframe animations for page elements.
 */

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

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-15px) rotate(1deg); }
}

@keyframes textGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes sparkle {
    0%, 100% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
}

@keyframes sneakyPulse {
    0%, 90%, 100% { opacity: 0.5; transform: scale(1); }
    95% { opacity: 1; transform: scale(1.1); }
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

/* ========================================
   PAGE BACKGROUND
   ======================================== */

body {
    background: var(--gradient-primary);
    animation: gradientShift 8s ease infinite;
}

/* ========================================
   FIXED DECORATIVE ELEMENTS
   ======================================== */

.clickable-emoji {
    position: fixed;
    font-size: var(--font-size-3xl);
    cursor: pointer;
    z-index: var(--z-floating);
    animation: gentleFloat 4s ease-in-out infinite;
    transition: transform 0.2s;
}

.clickable-emoji:hover {
    transform: scale(1.3);
}

.clickable-emoji:active {
    transform: scale(0.8);
}

.bouncing-emoji {
    position: fixed;
    font-size: var(--font-size-2xl);
    z-index: var(--z-overlay);
    pointer-events: none;
    animation: bounce 2s ease-in-out infinite;
}

/* Position bouncing emojis near bottom-right to distract from button */
.bouncing-emoji:nth-child(1) { bottom: 10px; right: 80px; animation-delay: 0s; }
.bouncing-emoji:nth-child(2) { bottom: 50px; right: 10px; animation-delay: 0.3s; }
.bouncing-emoji:nth-child(3) { bottom: 10px; right: 140px; animation-delay: 0.6s; }
.bouncing-emoji:nth-child(4) { bottom: 60px; right: 70px; animation-delay: 0.2s; }
.bouncing-emoji:nth-child(5) { bottom: 30px; right: 120px; animation-delay: 0.5s; }

/* ========================================
   SECRET BUTTON
   ======================================== */

.dont-touch-container {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    z-index: var(--z-overlay);
}

.dont-touch-btn {
    background: var(--color-surface-overlay);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    opacity: 0.5;
    animation: sneakyPulse 4s ease infinite;
    transition: all 0.3s;
}

.dont-touch-btn:hover {
    transform: scale(1.2);
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    border: none;
    padding: 10px 15px;
    opacity: 1;
}

/* ========================================
   MAIN CONTENT WRAPPER
   ======================================== */

.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--space-5);
    position: relative;
    z-index: var(--z-content);
}

/* ========================================
   GREETING CARD
   ======================================== */

.greeting-card {
    background: var(--color-surface-card);
    padding: var(--space-8) var(--space-9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    max-width: 90%;
    animation: floatCard 3s ease-in-out infinite;
}

/* ========================================
   TITLE AND SUBTITLE
   ======================================== */

h1 {
    font-size: var(--font-size-3xl);
    background: var(--gradient-title);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-4);
    animation: textGradient 3s ease infinite;
}

.scramble-name {
    /* Span for future animation - inherits h1 styles */
}

.subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-primary-2);
    margin-bottom: var(--space-5);
}

/* ========================================
   SPARKLE DECORATIONS
   ======================================== */

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: gold;
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
}

.sparkle:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 10%; right: 10%; animation-delay: 0.3s; }
.sparkle:nth-child(3) { bottom: 30%; left: 10%; animation-delay: 0.6s; }
.sparkle:nth-child(4) { bottom: 30%; right: 10%; animation-delay: 0.9s; }

/* ========================================
   JOKE BOX
   ======================================== */

.joke-box {
    background: var(--gradient-joke);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
    cursor: pointer;
    transition: transform 0.2s;
}

.joke-box:hover {
    transform: scale(1.02);
}

.joke-box:active {
    transform: scale(0.98);
}

.joke-label {
    font-size: var(--font-size-md);
    color: var(--color-accent-orange);
    font-weight: bold;
    margin-bottom: var(--space-2);
}

.joke-text {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    line-height: var(--line-height-base);
}

.joke-answer {
    font-weight: bold;
    color: var(--color-accent-purple);
    margin-top: var(--space-2);
    opacity: 0;
    transition: opacity 0.3s;
}

.tap-hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

/* Revealed state */
.joke-box.revealed .joke-answer {
    opacity: 1;
}

.joke-box.revealed .tap-hint {
    display: none;
}

/* ========================================
   NAME GENERATORS
   ======================================== */

.name-generators {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-4);
    flex-wrap: wrap;
    justify-content: center;
}

.name-gen-box {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.name-gen-box:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.name-gen-box:active {
    transform: scale(0.95);
}

.name-gen-box.fairy {
    background: var(--gradient-fairy);
}

.name-gen-box.numpty {
    background: var(--gradient-numpty);
}

.name-gen-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    font-weight: bold;
    margin-bottom: var(--space-1);
}

.name-gen-result {
    font-size: var(--font-size-base);
    color: var(--color-text-dark);
    font-weight: bold;
    min-height: 1.5em;
}

.name-gen-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* Activated state - hint hidden after first click */
.name-gen-box.activated .name-gen-hint {
    display: none;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 480px) {
    .greeting-card {
        padding: var(--space-5) var(--space-4);
    }

    h1 {
        font-size: var(--font-size-2xl);
    }

    .name-gen-box {
        min-width: 100%;
    }
}

/* ========================================
   REDUCED MOTION PREFERENCE
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    body,
    .greeting-card,
    h1,
    .sparkle,
    .dont-touch-btn,
    .clickable-emoji,
    .bouncing-emoji {
        animation: none;
    }

    .sparkle {
        opacity: 1;
        transform: scale(1);
    }
}
