@layer layout {
    .gate,
    .load-state {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: grid;
        place-items: center;
        padding: var(--space-5);
        overflow-y: auto;
        background: var(--surface-sunken);
    }

    .gate__video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Darken toward the bottom so the text reads over the city footage. */
    .gate::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, rgb(14 16 19 / 0.35), rgb(14 16 19 / 0.7) 55%, rgb(14 16 19 / 0.95));
    }

    .gate__content {
        position: relative;
        z-index: 1;
        display: grid;
        justify-items: center;
        gap: var(--space-3);
        width: min(420px, 100%);
        text-align: center;
    }

    .gate__logo {
        width: 72px;
        height: 72px;
        border-radius: var(--radius-lg);
        object-fit: cover;
    }

    .gate__title {
        font-family: var(--font-display);
        font-size: clamp(2.6rem, 8vw, 4rem);
        font-weight: 700;
        line-height: 1;
    }

    .gate__subtitle {
        color: var(--text-muted);
        font-size: var(--text-lg);
        margin-bottom: var(--space-4);
    }

    .gate__login {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        width: 100%;
        min-height: 3rem;
        border: 0;
        border-radius: var(--radius-md);
        background: #5865f2; /* Discord's own brand colour for its sign-in button */
        color: #fff;
        font-size: var(--text-md);
        font-weight: 600;
    }

    .gate__login:hover {
        background: #4752c4;
    }

    .gate__note {
        color: var(--text-dim);
        font-size: var(--text-sm);
    }

    .load-state__panel {
        display: grid;
        justify-items: center;
        gap: var(--space-3);
        width: min(420px, 100%);
        padding: var(--space-6) var(--space-5);
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: var(--surface-1);
        text-align: center;
    }

    .load-state__icon svg.lucide {
        width: 2rem;
        height: 2rem;
        color: var(--warn);
    }

    .load-state__title {
        font-size: var(--text-lg);
        font-weight: 600;
    }

    .load-state__text {
        color: var(--text-muted);
    }

    .spinner {
        display: block;
        width: 2rem;
        height: 2rem;
        border: 2px solid var(--line-strong);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 0.9s linear infinite;
    }

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