:root {
    --space-bg: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-soft: #cbd5e1;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--space-bg);
    color: #f8fafc;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.topbar {
    width: 100%;
    max-width: 700px;
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-kicker {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: #93c5fd;
    font-size: 0.72rem;
}

button:focus-visible {
    outline: 3px solid #a5b4fc;
    outline-offset: 3px;
}

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

h1 {
    font-weight: 600;
    letter-spacing: -0.05em;
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.apod-container {
    max-width: 700px;
    width: 100%;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

.media-frame {
    aspect-ratio: 16 / 9;
    width: 100%;
    margin: 20px 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.media-frame img,
.media-frame iframe {
    max-width: 100%;
    height: auto;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 0;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

button:hover {
    transform: translateY(-2px);
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#explanation {
    line-height: 1.6;
    color: var(--text-soft);
    font-size: 0.95rem;
    text-align: left;
}

#title {
    margin-top: 0;
}

@media (max-width: 600px) {
    body {
        padding: 24px 16px;
    }

    .brand {
        gap: 12px;
    }

    .brand-logo {
        width: 54px;
        height: 54px;
        border-radius: 16px;
    }

    .apod-container {
        padding: 20px;
    }

    h1 {
        font-size: 1.6rem;
    }
}
