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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-rgb: 99, 102, 241;
    --secondary-color: rgba(255, 255, 255, 0.15);
    --secondary-hover: rgba(255, 255, 255, 0.25);
    --text-color: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --error-color: #ef4444;
    --success-color: #10b981;
    --backdrop-blur: 20px;
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

/* Day Theme - Warm Amber/Gold */
body.theme-day {
    --primary-color: #f59e0b;
    --primary-hover: #d97706;
    --primary-rgb: 245, 158, 11;
}

/* Night Theme - Cool Purple (default) */
body.theme-night {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-rgb: 99, 102, 241;
}

/* ==========================================
   Accessibility - Skip Link
   ========================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    font-weight: 500;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ==========================================
   Focus Styles for Accessibility
   ========================================== */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove default outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ==========================================
   Video Background
   ========================================== */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Protect assets */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.bg-image,
.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    transition: opacity 1s ease-in-out;
    /* Protect assets */
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.bg-image {
    opacity: 1;
    z-index: 1;
}

.bg-image.hidden {
    opacity: 0;
}

.bg-video {
    opacity: 0;
    z-index: 2;
}

.bg-video.active {
    opacity: 1;
}

.bg-video.fade-out {
    opacity: 0;
}


/* ==========================================
   Container & Content (Mobile-First)
   ========================================== */
.container {
    position: relative;
    z-index: 2;
    width: fit-content;
    max-width: 95vw;
    padding: 1rem;
    margin: 0 auto;
}

.content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

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

/* ==========================================
   Hero Text (Mobile-First)
   ========================================== */
.hero-text {
    /* Responsive scaling: min 1rem for readability, scales with viewport, max 3.75rem */
    font-size: 3.75rem; /* Fallback for browsers without clamp() */
    font-size: clamp(1rem, 4.5vw, 3.75rem);
    font-weight: 700;
    margin-bottom: 1rem;
    /* Use filter for shadow since text-shadow doesn't work with background-clip: text */
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 1rem;
    line-height: 1.2;
    white-space: nowrap;
}

.description {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 37.5rem;
    margin: 0 auto 2rem;
    line-height: 1.7;
    padding: 0 0.5rem;
}

/* ==========================================
   Countdown (Mobile-First)
   ========================================== */
.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
}

/* Liquid Glass style for countdown items */
.countdown-item {
    /* Flexible width - equal sizing using flex */
    flex: 1 1 0;
    max-width: 5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 1.25rem;

    /* Center content inside */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Liquid Glass effect - matching buttons */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 24px -1px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 -20px 40px -20px rgba(255, 255, 255, 0.15) inset;

    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

.countdown-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 12px 40px -4px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 -20px 40px -20px rgba(255, 255, 255, 0.2) inset;
    border-color: rgba(255, 255, 255, 0.35);
}

.countdown-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.countdown-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-separator {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-muted);
    padding: 0 0.1rem;
}

/* ==========================================
   Buttons - iOS 26 Liquid Glass Style (Mobile-First)
   ========================================== */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    padding: 0 1rem;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

/* Liquid Glass Base */
.btn-primary,
.btn-secondary {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow:
        0 4px 24px -1px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 -20px 40px -20px rgba(255, 255, 255, 0.15) inset;
}

/* Top light reflection */
.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    border-radius: 50px 50px 100px 100px;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Animated shimmer effect */
.btn-primary::after,
.btn-secondary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 60%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

/* Primary button accent */
.btn-primary {
    background: linear-gradient(
        135deg,
        rgba(var(--primary-rgb), 0.4) 0%,
        rgba(var(--primary-rgb), 0.2) 50%,
        rgba(var(--primary-rgb), 0.3) 100%
    );
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    box-shadow:
        0 4px 24px -1px rgba(var(--primary-rgb), 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 -20px 40px -20px rgba(255, 255, 255, 0.2) inset,
        0 20px 40px -20px rgba(var(--primary-rgb), 0.2) inset;
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease,
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover states */
.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-4px) scale(1.02);
}

.btn-primary:hover {
    box-shadow:
        0 12px 40px -4px rgba(var(--primary-rgb), 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 -20px 40px -20px rgba(255, 255, 255, 0.25) inset,
        0 20px 40px -20px rgba(var(--primary-rgb), 0.3) inset;
    border-color: rgba(var(--primary-rgb), 0.5);
}

.btn-secondary:hover {
    box-shadow:
        0 12px 40px -4px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 -20px 40px -20px rgba(255, 255, 255, 0.2) inset;
    border-color: rgba(255, 255, 255, 0.35);
}

/* Shimmer on hover */
.btn-primary:hover::after,
.btn-secondary:hover::after {
    transform: translateX(100%);
}

/* Active/pressed state */
.btn-primary:active,
.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
    transition: transform 0.1s ease;
}

.btn-primary:active {
    box-shadow:
        0 4px 16px -2px rgba(var(--primary-rgb), 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 10px 20px -10px rgba(0, 0, 0, 0.2) inset;
}

.btn-secondary:active {
    box-shadow:
        0 4px 16px -2px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 10px 20px -10px rgba(0, 0, 0, 0.2) inset;
}

/* Icon styling */
.btn svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.btn:hover svg {
    transform: scale(1.1);
}

/* ==========================================
   Modal (Mobile-First)
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 30rem;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ==========================================
   Form (Mobile-First)
   ========================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-text {
    display: inline;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* ==========================================
   Form Validation
   ========================================== */
.required {
    color: var(--error-color);
    margin-left: 0.25rem;
}

.error-message {
    display: none;
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.form-group input.error:focus,
.form-group textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ==========================================
   Form States (Success, Error)
   ========================================== */
.form-success,
.form-error {
    display: none;
    text-align: center;
    padding: 1.5rem 0;
}

.form-success svg {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.form-error svg {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.form-success h3,
.form-error h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.form-success p,
.form-error p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Retry Button */
.btn-retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-retry:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   Countdown Complete State
   ========================================== */
.countdown-complete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.countdown-complete-emoji {
    font-size: 2rem;
}

/* ==========================================
   Tablet+ (min-width: 640px)
   ========================================== */
@media (min-width: 640px) {
    .container {
        padding: 2rem;
    }

    .description {
        font-size: 1rem;
        margin-bottom: 3rem;
    }

    .countdown {
        gap: 0.5rem;
        margin-bottom: 3rem;
    }

    .countdown-item {
        max-width: 6.5rem;
        padding: 1rem 1.25rem;
        border-radius: 1.5rem;
    }

    .countdown-value {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .countdown-label {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .countdown-separator {
        font-size: 2rem;
        padding: 0 0.25rem;
    }

    .buttons {
        flex-direction: row;
        padding: 0;
        gap: 1.25rem;
    }

    .btn {
        width: auto;
        padding: 1rem 2.25rem;
        font-size: 1rem;
    }

    .modal-content {
        padding: 2rem;
    }

    .modal-title {
        font-size: 1.75rem;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }
}

/* ==========================================
   Desktop (min-width: 1024px)
   ========================================== */
@media (min-width: 1024px) {
    .description {
        font-size: 1.25rem;
    }

    .countdown-item {
        max-width: 8rem;
        padding: 1.5rem 2rem;
        border-radius: 1.75rem;
    }

    .countdown-value {
        font-size: 3.5rem;
    }

    .countdown-label {
        font-size: 0.875rem;
    }

    .countdown-separator {
        font-size: 2.5rem;
    }

    .modal-content {
        padding: 2.5rem;
    }
}

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

.countdown-value.pulse {
    animation: pulse 0.3s ease;
}

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

    .bg-image,
    .bg-video {
        transition: none;
    }

    .content {
        animation: none;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .background-container,
    .modal,
    .btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero-text {
        background: none;
        -webkit-text-fill-color: black;
        color: black;
        filter: none;
    }

    .description {
        color: #333;
    }
}
