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

/* Whole page */
body {
    color: #ffffff;
    font-family: Inter, system-ui, sans-serif;

    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(255, 59, 77, .08) 0%,
            rgba(255, 59, 77, .03) 30%,
            transparent 75%
        ),
        #09090b;
}

/* Content */
main {
    text-align: center;

    position: relative;

    opacity: 0;

    transform: translateY(10px);

    animation: fadeIn 900ms cubic-bezier(.22,.61,.36,1) forwards;

    animation-delay: 150ms;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 {
    font-size: 8rem;
    font-weight: 500;

    color: #ffffff;

    letter-spacing: 0.05em;

    text-shadow:
        0 0 2px #ffffff,
        0 0 8px rgba(255, 255, 255, .8),
        0 0 28px rgba(255, 255, 255, .4),
        0 0 30px rgba(255, 255, 255, .2);

    transition:
        color .35s ease,
        text-shadow .35s ease;
}

h2 {
    font-size: 3.3rem;
    font-weight: 500;

    color: #ffffff;

    letter-spacing: 0.05em;
    text-align: center;

    text-shadow:
        0 0 2px #ffffff,
        0 0 8px rgba(255, 255, 255, .8),
        0 0 28px rgba(255, 255, 255, .4),
        0 0 30px rgba(255, 255, 255, .2);

    transition:
        color .35s ease,
        text-shadow .35s ease;
}

h3 {
    font-size: 1rem;
    font-weight: 500;

    color: #ffffff;

    text-align: center;
    letter-spacing: 2.7em;
    margin-right: -2.7em;

    text-shadow:
        0 0 2px #ffffff,
        0 0 8px rgba(255, 255, 255, .8),
        0 0 28px rgba(255, 255, 255, .4),
        0 0 30px rgba(255, 255, 255, .2);

    transition:
        color .35s ease,
        text-shadow .35s ease;
}

p {
    margin-top: 1rem;

    color: rgba(255, 255, 255, .75);

    opacity: .55;
    font-size: 1.5rem;

    transition: color .35s ease;
}

p a {
    color: rgba(255, 255, 255, .75);

    text-decoration: none;

    transition:
        color .2s ease,
        text-shadow .2s ease;
}

p a:hover {
    color: #ffffff;

    text-shadow:
        0 0 3px #ffffff,
        0 0 6px rgba(255, 255, 255, .4);
}

.music {
    margin-top: 0.35rem;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.now-playing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;

    color: rgba(255, 255, 255, 0.7);

    font-size: 1rem;
    text-transform: uppercase;
}

#now-playing-label {
    font-weight: 700;
    letter-spacing: 0.35em;
    white-space: nowrap;

    color: rgba(255, 255, 255, 0.85);

    margin-right: -0.35em;

    transition:
        color .35s ease,
        text-shadow .35s ease;

    animation: signalGlow 1.1s ease-in-out infinite;
}

.music:not(.signal-acquired) #now-playing-label {
    animation: none;
}

.music.signal-acquired #now-playing-label {
    animation: signalGlow 1.1s ease-in-out infinite;
}

.visualizer {
    flex: 0 0 20px;
    width: 32px;
    height: 14px;

    display: flex;
    align-items: center;
    gap: 3px;
}

.visualizer-left {
    justify-content: flex-end;
}

.visualizer-right {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

.visualizer span {
    width: 2px;
    height: 5px;

    background: rgba(255, 255, 255, 0.85);
    border-radius: 2px;

    box-shadow:
        0 0 4px rgba(255, 255, 255, 0.4);

    animation: visualizerPulse 1.1s ease-in-out infinite;

    transition:
        background .35s ease,
        box-shadow .35s ease,
        opacity .35s ease;
}

/* Give each bar a slightly different rhythm */
.visualizer span:nth-child(1) {
    animation-delay: -0.7s;
}

.visualizer span:nth-child(2) {
    animation-delay: -0.45s;
}

.visualizer span:nth-child(3) {
    animation-delay: -0.2s;
}

.visualizer span:nth-child(4) {
    animation-delay: -0.55s;
}

.visualizer span:nth-child(5) {
    animation-delay: -0.3s;
}

/* Dead frequency visualizers */
.music.signal-lost .visualizer span {
    animation-play-state: paused;

    height: 4px;
    opacity: 0.5;

    background: #ff3b4d;

    box-shadow:
        0 0 4px rgba(255, 59, 77, 0.65);
}

#now-playing-artist {
    margin-top: 0.4rem;

    max-width: 90vw;

    color: rgba(255, 255, 255, 0.9);

    font-size: 1.05rem;
    font-weight: 500;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    transition: color .35s ease;
}

#now-playing-track {
    max-width: 90vw;

    margin-top: 0.1rem;

    color: rgba(255, 255, 255, 0.62);

    font-size: 0.9rem;
    font-style: italic;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    transition: color .35s ease;
}

/* DEAD FREQUENCY state */

/* Main logo / titles */
main:has(.music.signal-lost) h1,
main:has(.music.signal-lost) h2,
main:has(.music.signal-lost) h3 {
    color: #ff3b4d;

    text-shadow:
        0 0 2px #ff3b4d,
        0 0 8px rgba(255, 59, 77, .8),
        0 0 28px rgba(255, 59, 77, .45),
        0 0 30px rgba(255, 59, 77, .2);
}

/* Receiver text */
.music.signal-lost #now-playing-label,
.music.signal-lost #now-playing-artist,
.music.signal-lost #now-playing-track {
    color: #ff3b4d;
}

/* DEAD FREQUENCY itself gets a stronger glow */
.music.signal-lost #now-playing-label {
    text-shadow:
        0 0 3px rgba(255, 59, 77, .7),
        0 0 10px rgba(255, 59, 77, .4),
        0 0 20px rgba(255, 59, 77, .18);
}

@keyframes visualizerPulse {
    0%,
    100% {
        height: 4px;
        opacity: 0.45;
    }

    50% {
        height: 13px;
        opacity: 1;
    }
}

.info-text {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: .75;
    text-align: left;
    max-width: 420px;
}

.dns-section {
    margin-top: 1.4rem;
    max-width: 420px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.dns-haiku {
    text-align: left;
}

.dns-haiku p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: .75;
}

.dns-haiku p.dns-punchline-stanza {
    margin-top: 1.1rem;
}

.dns-cat {
    margin: 0;
    flex: 0 0 auto;

    font-family: inherit;
    font-size: 1.9rem;
    line-height: 1.15;

    color: rgba(255, 255, 255, 0.85);

    text-shadow:
        0 0 2px #ffffff,
        0 0 6px rgba(255, 255, 255, .4);

    white-space: pre;
}

.more {
    margin-top: 0.75rem;
    display: inline-block;
    text-align: center;
    opacity: .55;
    font-size: 1.2rem;
}

.more summary {
    list-style: none;
    cursor: pointer;
    user-select: none;

    color: rgba(255, 255, 255, .75);

    transition: .2s ease;
    text-shadow: none;
}

.more summary::-webkit-details-marker {
    display: none;
}

.more summary:hover,
.more summary:focus-visible {
    color: #ffffff;

    text-shadow:
        0 0 3px #ffffff,
        0 0 6px rgba(255, 255, 255, .4);
}

.more[open] summary {
    color: #ffffff;

    text-shadow:
        0 0 3px #ffffff,
        0 0 6px rgba(255, 255, 255, .35);
}

.more-links {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;

    margin-top: 0;

    max-height: 0;
    overflow: hidden;

    opacity: 0;

    transform: translateY(-8px);

    transition:
        max-height .35s ease,
        opacity .25s ease,
        transform .35s cubic-bezier(.22,.61,.36,1),
        margin-top .35s ease;

    font-size: .92rem;
}

.more[open] .more-links {
    max-height: 250px;

    margin-top: .4rem;

    opacity: 1;

    transform: translateY(0);
}

.more-links a {
    color: rgba(255, 255, 255, .75);

    text-decoration: none;

    transition: .2s ease;
}

.more-links a:hover {
    color: #ffffff;

    text-shadow:
        0 0 3px #ffffff,
        0 0 6px rgba(255, 255, 255, .4);
}

.about-link {
    position: fixed;

    right: 24px;
    bottom: 20px;

    font-size: 1rem;

    color: rgba(255, 255, 255, .35);

    text-decoration: none;

    transition: .2s ease;
}

.about-link:hover {
    color: #ffffff;

    text-shadow:
        0 0 3px #ffffff,
        0 0 6px rgba(255, 255, 255, .4);
}

.bg {
    position: fixed;
    inset: 0;

    pointer-events: none;

    z-index: 0;
}

.bg video {
    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: 1;

    mix-blend-mode: screen;

    filter:
        blur(8px)
        brightness(.5)
        contrast(1)
        saturate(.8);
}

.bg::after {
    content: "";

    position: absolute;
    inset: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(calc(-5vh + 10px));
    }

    to {
        opacity: 1;
        transform: translateY(-5vh);
    }
}

@keyframes signalGlow {
    0%,
    100% {
        text-shadow:
            0 0 3px rgba(255, 255, 255, 0.35),
            0 0 8px rgba(255, 255, 255, 0.15);
    }

    50% {
        text-shadow:
            0 0 6px rgba(255, 255, 255, 0.8),
            0 0 18px rgba(255, 255, 255, 0.45),
            0 0 32px rgba(255, 255, 255, 0.2);
    }
}

@media (max-width: 700px) {
    body {
        min-height: 100svh;

        overflow-x: hidden;
        overflow-y: auto;

        padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    }

    main {
        transform: none;

        width: 100%;
        max-width: 360px;

        padding-top: 12vh;
    }

    h1 {
        font-size: clamp(2.4rem, 16vw, 3.2rem);
    }

    h2 {
        font-size: clamp(1rem, 5vw, 1.15rem);
    }

    .broadcast {
        font-size: 0.72rem;
        line-height: 1.35;
    }

    .more {
        font-size: 1rem;
    }

    .more-links {
        font-size: 0.85rem;
        padding-left: 0;
        align-items: center;
    }

    .about-link {
        position: fixed;

        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));

        font-size: 1rem;
        opacity: 0.45;

        z-index: 10;
    }

    .bg video {
        opacity: 0.07;

        filter:
            blur(12px)
            brightness(0.45)
            saturate(0);

        transform: scale(1.8);
    }

    .stars {
        opacity: 0.45;
    }
}