/* ========== VARIABLES ========== */
:root {
    --red-primary: #881c1c;
    --red-dark: #6e1616;
    --red-light: #a82a2a;
    --red-subtle: #f9e8e8;
    --white: #ffffff;
    --off-white: #fafafa;
    --gray-light: #e8e8e8;
    --gray-text: #5a5a5a;
    --text-dark: #1a1a1a;
    --radius: 24px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--red-primary);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* ========== BACKGROUND PATTERN ========== */
.bg-pattern {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.08) 0%, transparent 70%);
    animation: bgShift 12s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ========== LAYOUT ========== */
.main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========== CARD ========== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 48px 40px 40px;
    box-shadow: var(--shadow);
    text-align: center;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red-primary), var(--red-light), var(--red-primary));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

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

/* ========== BADGE ========== */
.badge {
    display: inline-block;
    background: var(--red-subtle);
    color: var(--red-primary);
    font-size: 1.1rem;
    padding: 8px 20px;
    border-radius: 50px;
    margin-bottom: 24px;
    letter-spacing: 2px;
}

/* ========== TYPOGRAPHY ========== */
h1 {
    font-family: 'Fraunces', serif;
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.15;
    margin-bottom: 16px;
}

h1 .accent {
    color: var(--red-primary);
}

.tagline {
    font-size: 1.05rem;
    color: var(--gray-text);
    line-height: 1.65;
    max-width: 380px;
    margin: 0 auto 12px;
}

.tagline strong {
    color: var(--text-dark);
}

.explanation {
    font-size: 0.9rem;
    color: var(--gray-text);
    margin-bottom: 28px;
    min-height: 1.2em;
}

/* ========== UPLOAD AREA ========== */
.upload-area {
    background: var(--off-white);
    border: 2px dashed var(--gray-light);
    border-radius: 16px;
    padding: 32px 24px 24px;
    transition: border-color 0.3s ease, background 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: var(--red-light);
    background: var(--red-subtle);
}

.upload-area:hover .upload-icon {
    color: var(--red-primary);
    transform: translateY(-3px);
}

.upload-icon {
    color: var(--gray-text);
    margin-bottom: 16px;
    transition: color 0.3s ease, transform 0.3s ease;
}

#import {
    display: none;
}

.import-label {
    display: inline-block;
    background: var(--red-primary);
    color: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 12px rgba(136, 28, 28, 0.25);
}

.import-label:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(136, 28, 28, 0.35);
}

.import-label:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(136, 28, 28, 0.2);
}

.upload-hint {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 12px;
}

/* ========== DIVIDER ========== */
.divider {
    height: 1px;
    background: var(--gray-light);
    margin: 28px 0;
}

/* ========== ABOUT BUTTON ========== */
.about-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 2px solid var(--gray-light);
    color: var(--gray-text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.about-btn:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
}

.about-btn .arrow {
    transition: transform 0.3s ease;
    font-size: 0.85rem;
}

/* ========== ABOUT SECTION ========== */
.about-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.about-section.open {
    max-height: 200px;
    opacity: 1;
    margin-top: 20px;
}

.about-section p {
    font-size: 0.9rem;
    color: var(--gray-text);
    line-height: 1.7;
    text-align: left;
    background: var(--off-white);
    padding: 16px 20px;
    border-radius: 12px;
}

.about-section code {
    background: var(--red-subtle);
    color: var(--red-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ========== FOOTER ========== */
.footer {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in-down {
    animation: fadeInDown 0.7s ease forwards;
    opacity: 0;
}

.fade-in-up {
    animation: fadeInUp 0.7s ease forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 600px) {
    .main {
        padding: 16px;
    }

    .card {
        padding: 36px 24px 32px;
        border-radius: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .upload-area {
        padding: 24px 16px 20px;
    }

    .import-label {
        padding: 12px 28px;
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    h1 {
        font-size: 1.7rem;
    }

    .card {
        padding: 28px 18px 24px;
    }

    .import-label {
        padding: 12px 24px;
    }
}
