/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --fg-primary: #f5f5f7;
    --fg-muted: #8a8a9a;
    --accent: #e63946;
    --accent-glow: rgba(230, 57, 70, 0.4);
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --card-bg: rgba(18, 18, 26, 0.8);
    --border: rgba(212, 175, 55, 0.2);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--fg-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Film Grain Overlay */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: grain 0.3s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    30% { transform: translate(3%, -15%); }
    50% { transform: translate(-8%, 5%); }
    70% { transform: translate(8%, 10%); }
    90% { transform: translate(-3%, 7%); }
}

/* Particle Canvas */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(230, 57, 70, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(18, 18, 26, 1) 0%, var(--bg-primary) 100%);
    z-index: 0;
}

/* Main Container */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Film Reel Animation */
.film-reel {
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border: 2px solid var(--gold);
    border-radius: 50%;
    position: relative;
    animation: rotate 8s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--gold-glow);
}

.film-reel.right {
    animation-direction: reverse;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.reel-hole {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 50%;
}

.reel-hole:nth-child(1) { top: 8px; left: 50%; transform: translateX(-50%); }
.reel-hole:nth-child(2) { top: 50%; right: 8px; transform: translateY(-50%); }
.reel-hole:nth-child(3) { bottom: 8px; left: 50%; transform: translateX(-50%); }
.reel-hole:nth-child(4) { top: 50%; left: 8px; transform: translateY(-50%); }
.reel-hole:nth-child(5) { top: 14px; right: 14px; }
.reel-hole:nth-child(6) { bottom: 14px; left: 14px; }

/* Site Title */
.site-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.title-main {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    letter-spacing: 0.3em;
    color: var(--fg-primary);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.title-accent {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 10vw, 5.5rem);
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, var(--gold) 0%, #f4d03f 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    background-size: 200% 100%;
}

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

.title-sub {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    letter-spacing: 0.5em;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Redirect Section */
.redirect-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: slideUp 0.8s ease-out 0.3s both;
    max-width: 450px;
    width: 100%;
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.redirect-text {
    font-size: 0.95rem;
    color: var(--fg-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.redirect-url {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    display: inline-block;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: 2px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Timer Section */
.timer-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.timer-text {
    font-size: 0.9rem;
    color: var(--fg-muted);
}

.timer-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    color: var(--accent);
    min-width: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--fg-muted);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--fg-primary);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Decorative Lines */
.decorative-line {
    position: fixed;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--gold), transparent);
    opacity: 0.3;
}

.decorative-line.left {
    left: 10%;
    top: 20%;
    animation: float 4s ease-in-out infinite;
}

.decorative-line.right {
    right: 10%;
    bottom: 20%;
    animation: float 4s ease-in-out infinite reverse;
}

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

/* Film Strip */
.film-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
}

.strip-frame {
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 8px;
    border-radius: 2px;
    flex-shrink: 0;
    animation: scrollStrip 10s linear infinite;
}

@keyframes scrollStrip {
    from { transform: translateX(0); }
    to { transform: translateX(-96px); }
}

/* Cancel State */
.cancelled .timer-number {
    animation: none;
    color: var(--fg-muted);
}

.cancelled .progress-bar {
    background: var(--fg-muted);
    box-shadow: none;
}

/* Success State */
.redirecting .btn-primary {
    pointer-events: none;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 640px) {
    .logo-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .film-reel {
        width: 40px;
        height: 40px;
    }
    
    .reel-hole {
        width: 6px;
        height: 6px;
    }
    
    .redirect-section {
        padding: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .decorative-line {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .film-grain {
        display: none;
    }
}