html.dark-theme {
    color-scheme: dark;
}

html,
body {
    min-height: 100%;
}

body.redirect-page {
    --page-text: #f4f7fb;
    --page-muted: #aeb7c4;
    --page-line: rgba(255, 255, 255, 0.12);
    --page-accent: #7c91ff;
    --page-accent-2: #b7f36b;
    --panel-bg: #141720;
    --panel-text: #f5f7ff;
    --panel-muted: #9fa8b8;
    --panel-line: #323746;
    --button-bg: #697bf1;
    --button-text: #ffffff;

    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background: #0a0b10;
    color: var(--page-text);
}

body.redirect-page--discord {
    background: linear-gradient(115deg, rgba(124, 145, 255, 0.14) 0 31%, transparent 31%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, 0.025) 79px 80px),
    #0a0b10;
}

body.redirect-page--telegram {
    --page-muted: #b5c6d1;
    --page-line: rgba(139, 205, 237, 0.25);
    --page-accent: #67cef5;
    --page-accent-2: #ff9b82;
    --panel-bg: #f4f9fc;
    --panel-text: #0a2432;
    --panel-muted: #5f7581;
    --panel-line: #c8dce6;
    --button-bg: #168fc4;
    --button-text: #ffffff;

    background: linear-gradient(132deg, transparent 0 57%, rgba(65, 182, 228, 0.12) 57% 72%, transparent 72%),
    repeating-linear-gradient(0deg, transparent 0 63px, rgba(139, 205, 237, 0.035) 63px 64px),
    #08131b;
}

.redirect-skip {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    padding: 10px 14px;
    border: 1px solid var(--page-accent);
    border-radius: 6px;
    background: #ffffff;
    color: #07131b;
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform 0.15s ease;
}

.redirect-skip:focus {
    color: #07131b;
    transform: translateY(0);
}

.redirect-header-wrap {
    position: relative;
    z-index: 10;
    width: min(var(--container-max), calc(100% - 40px));
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0;
}

.redirect-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    align-items: center;
    width: min(1180px, 100%);
    min-height: calc(100vh - 79px);
    min-height: calc(100svh - 79px);
    margin: 0 auto;
    padding: 48px 40px;
    gap: 72px;
}

.redirect-hero {
    display: flex;
    min-width: 0;
    min-height: 620px;
    flex-direction: column;
    justify-content: center;
    gap: 38px;
}

.redirect-copy {
    max-width: 690px;
    padding: 0;
}

.redirect-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
    color: var(--page-muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.redirect-eyebrow > span[aria-hidden="true"] {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--page-accent-2);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--page-accent-2) 14%, transparent);
}

.redirect-title {
    max-width: 760px;
    margin: 0;
    color: var(--page-text);
    font-size: 72px;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 0.98;
    overflow-wrap: anywhere;
}

.redirect-title strong {
    color: var(--page-accent);
    font: inherit;
}

.redirect-page--telegram .redirect-title strong {
    color: #8adeff;
}

.redirect-lead {
    max-width: 620px;
    margin: 30px 0 0;
    color: var(--page-muted);
    font-size: 19px;
    line-height: 1.6;
}

.redirect-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}

.redirect-tags li {
    padding: 8px 11px;
    border: 1px solid var(--page-line);
    border-radius: 6px;
    color: var(--page-text);
    font-size: 13px;
    font-weight: 650;
}

.discord-room {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    align-items: center;
    min-height: 106px;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid rgba(124, 145, 255, 0.26);
    border-radius: 8px;
    background: rgba(17, 19, 28, 0.76);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px);
}

.discord-room__mark {
    display: grid;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #7183f4;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    place-items: center;
}

.discord-room__name {
    min-width: 0;
    color: #f5f7ff;
    font-size: 15px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.discord-room__name small {
    display: block;
    margin-top: 3px;
    color: #8d96a8;
    font-size: 12px;
    font-weight: 500;
}

.discord-room__avatars {
    display: flex;
    padding-left: 10px;
}

.discord-room__avatars i {
    display: grid;
    width: 31px;
    height: 31px;
    margin-left: -10px;
    border: 2px solid #141720;
    border-radius: 50%;
    background: #273047;
    color: #cbd3ff;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    place-items: center;
}

.discord-room__avatars i:nth-child(2) {
    background: #3f5944;
    color: #d4ffd6;
}

.discord-room__avatars i:nth-child(3) {
    background: #653e53;
    color: #ffd5e4;
}

.discord-room__signal {
    display: flex;
    height: 34px;
    align-items: center;
    gap: 4px;
}

.discord-room__signal i {
    width: 3px;
    border-radius: 2px;
    background: var(--page-accent-2);
}

.discord-room__signal i:nth-child(1) {
    height: 10px;
}

.discord-room__signal i:nth-child(2) {
    height: 22px;
}

.discord-room__signal i:nth-child(3) {
    height: 30px;
}

.discord-room__signal i:nth-child(4) {
    height: 16px;
}

.telegram-feed {
    width: min(540px, 100%);
    overflow: hidden;
    border: 1px solid rgba(103, 206, 245, 0.34);
    border-radius: 8px;
    background: #eef7fb;
    color: #102b39;
    box-shadow: 20px 24px 0 rgba(34, 124, 163, 0.11), 0 28px 70px rgba(0, 0, 0, 0.24);
}

.telegram-feed__head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 9px;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    border-bottom: 1px solid #cddfe7;
}

.telegram-feed__mark {
    display: grid;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #168fc4;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    place-items: center;
}

.telegram-feed__head > span:nth-child(2) {
    font-size: 14px;
    font-weight: 800;
}

.telegram-feed__head small {
    display: block;
    margin-top: 2px;
    color: #6b818c;
    font-size: 11px;
    font-weight: 500;
}

.telegram-feed__head i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #29b169;
}

.telegram-feed__post {
    padding: 18px 20px;
    border-bottom: 1px solid #d6e5eb;
}

.telegram-feed__post:last-child {
    border-bottom: 0;
}

.telegram-feed__post span {
    color: #168fc4;
    font-size: 10px;
    font-weight: 850;
}

.telegram-feed__post p {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}

.telegram-feed__post--compact {
    padding-top: 14px;
    padding-bottom: 14px;
    background: #f8fcfd;
}

.redirect-action {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 650px;
    flex-direction: column;
    align-self: center;
    padding: 28px;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
    color: var(--panel-text);
}

.redirect-page--telegram .redirect-action {
    color-scheme: light;
    box-shadow: 0 32px 80px rgba(0, 7, 12, 0.36);
}

.redirect-action__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--panel-line);
}

.redirect-page--discord .redirect-action__head {
    justify-content: flex-end;
}

.redirect-action__head span {
    color: var(--page-accent);
    font-size: 13px;
    font-weight: 850;
}

.redirect-page--telegram .redirect-action__head span {
    color: #168fc4;
}

.redirect-action__head p {
    margin: 0;
    color: var(--panel-muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: uppercase;
}

.redirect-qr-figure {
    display: grid;
    justify-items: center;
    margin: 26px 0 0;
}

.redirect-qr-frame {
    width: min(246px, 100%);
    padding: 11px;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: #ffffff;
}

.redirect-qr {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
}

.redirect-qr-figure figcaption {
    margin-top: 10px;
    color: var(--panel-muted);
    font-size: 12px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.redirect-action__copy {
    margin-top: 22px;
    text-align: center;
}

.redirect-action__copy h2 {
    margin: 0;
    color: var(--panel-text);
    font-size: 24px;
    letter-spacing: 0;
    line-height: 1.2;
}

.redirect-action__copy p {
    margin: 8px auto 0;
    color: var(--panel-muted);
    font-size: 13px;
    line-height: 1.5;
}

.redirect-link {
    display: inline-flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
    padding: 11px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.redirect-link:hover {
    color: var(--button-text);
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.redirect-link__arrow {
    position: relative;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.redirect-link__arrow::after {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 16px;
    height: 2px;
    background: currentColor;
    content: "";
    transform: rotate(-45deg);
    transform-origin: right center;
}

.redirect-shortlink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    color: var(--panel-muted);
    font-size: 12px;
}

.redirect-copy-button {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--panel-line);
    border-radius: 6px;
    background: transparent;
    color: var(--panel-text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.redirect-copy-button:hover,
.redirect-copy-button.is-copied {
    border-color: var(--page-accent);
    background: color-mix(in srgb, var(--page-accent) 10%, transparent);
}

.redirect-page--telegram .redirect-copy-button:hover,
.redirect-page--telegram .redirect-copy-button.is-copied {
    border-color: #168fc4;
    background: rgba(22, 143, 196, 0.08);
}

.redirect-status {
    min-height: 18px;
    margin: 5px 0 0;
    color: var(--panel-muted);
    font-size: 11px;
    text-align: right;
}

.redirect-enhanced .redirect-hero > *,
.redirect-enhanced .redirect-action {
    opacity: 0;
    transform: translateY(12px);
}

.redirect-enhanced .redirect-page.is-ready .redirect-hero > *,
.redirect-enhanced .redirect-page.is-ready .redirect-action {
    animation: redirect-reveal 0.55s ease forwards;
}

.redirect-enhanced .redirect-page.is-ready .redirect-hero > :nth-child(2) {
    animation-delay: 0.06s;
}

.redirect-enhanced .redirect-page.is-ready .redirect-action {
    animation-delay: 0.12s;
}

@keyframes redirect-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .redirect-shell {
        grid-template-columns: minmax(0, 1fr);
        width: min(720px, 100%);
        padding: 36px 32px 48px;
        gap: 44px;
    }

    .redirect-hero {
        min-height: 580px;
    }

    .redirect-title {
        font-size: 60px;
    }

    .redirect-action {
        width: min(440px, 100%);
        min-height: 0;
        justify-self: center;
    }
}

@media (max-width: 620px) {
    .redirect-shell {
        padding: 24px 18px 32px;
        gap: 32px;
    }

    .redirect-hero {
        min-height: 560px;
    }

    .redirect-title {
        font-size: 44px;
        line-height: 1.02;
    }

    .redirect-lead {
        margin-top: 24px;
        font-size: 16px;
        line-height: 1.55;
    }

    .redirect-tags {
        margin-top: 24px;
    }

    .discord-room {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 14px;
    }

    .discord-room__mark {
        width: 44px;
        height: 44px;
    }

    .discord-room__avatars {
        display: none;
    }

    .redirect-action {
        padding: 22px 18px;
    }

    .telegram-feed {
        box-shadow: 10px 12px 0 rgba(34, 124, 163, 0.11), 0 22px 50px rgba(0, 0, 0, 0.22);
    }
}

@media (max-width: 380px) {
    .redirect-title {
        font-size: 38px;
    }

    .redirect-tags li {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .redirect-skip,
    .redirect-link,
    .redirect-copy-button {
        transition: none;
    }

    .redirect-enhanced .redirect-hero > *,
    .redirect-enhanced .redirect-action,
    .redirect-enhanced .redirect-page.is-ready .redirect-hero > *,
    .redirect-enhanced .redirect-page.is-ready .redirect-action {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* Shared Primer surface for social redirect pages. */
body.redirect-page,
body.redirect-page--discord,
body.redirect-page--telegram {
    --page-text: var(--color-text);
    --page-muted: var(--color-text-muted);
    --page-line: var(--color-border);
    --page-accent: var(--color-accent);
    --page-accent-2: var(--color-success);
    --panel-bg: var(--color-surface);
    --panel-text: var(--color-text);
    --panel-muted: var(--color-text-muted);
    --panel-line: var(--color-border);
    --button-bg: var(--color-accent);
    --button-text: #ffffff;
    background: var(--color-bg);
    color: var(--color-text);
}

.redirect-header-wrap {
    padding-top: 0;
}

.redirect-shell {
    width: min(var(--container-max), calc(100% - 40px));
    min-height: 0;
    padding: 28px 0 48px;
    gap: 24px;
}

.redirect-hero {
    min-height: 0;
    gap: 20px;
}

.redirect-copy.page-header {
    display: block;
    max-width: none;
    margin: 0;
    padding: 24px;
    background: var(--color-surface);
    color: var(--color-text);
}

.redirect-eyebrow {
    margin-bottom: 16px;
    color: var(--color-text-muted);
}

.redirect-eyebrow > span[aria-hidden="true"] {
    background: var(--color-accent);
    box-shadow: none;
}

.redirect-title {
    max-width: none;
    color: var(--color-text);
    font-size: 42px;
    line-height: 1.08;
}

.redirect-title strong,
.redirect-page--telegram .redirect-title strong {
    color: var(--color-accent);
}

.redirect-lead {
    max-width: 720px;
    margin-top: 18px;
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1.55;
}

.redirect-tags {
    margin-top: 20px;
}

.redirect-tags li {
    border-color: var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-text);
}

.discord-room,
.telegram-feed,
.redirect-action {
    border-color: var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    color: var(--color-text);
}

.discord-room {
    width: 100%;
}

.telegram-feed {
    color: var(--color-text);
}

.redirect-action {
    min-height: 0;
    padding: 24px;
}

.redirect-action__head,
.redirect-shortlink {
    border-color: var(--color-border);
}

.redirect-action__head p,
.redirect-action__copy p,
.redirect-shortlink {
    color: var(--color-text-muted);
}

.redirect-action__copy h2 {
    color: var(--color-text);
}

.redirect-link {
    background: var(--color-accent);
    color: #ffffff;
}

.redirect-link:hover,
.redirect-link:focus-visible {
    background: var(--color-accent-strong);
    color: #ffffff;
}

.redirect-copy-button {
    border-color: var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-text);
}

.redirect-copy-button:hover,
.redirect-copy-button:focus-visible {
    border-color: var(--color-accent);
    background: var(--color-surface-3);
    color: var(--color-text);
}

html.light-theme body.redirect-page,
html.light-theme body.redirect-page--discord,
html.light-theme body.redirect-page--telegram {
    background: var(--color-bg);
}

@media (max-width: 760px) {
    .redirect-shell {
        width: calc(100% - 24px);
        grid-template-columns: 1fr;
        padding-top: 22px;
    }

    .redirect-copy.page-header {
        padding: 20px;
    }

    .redirect-title {
        font-size: 32px;
    }

    .redirect-action {
        order: -1;
        width: 100%;
    }

    .redirect-action .redirect-link {
        order: -1;
        margin-top: 0;
        margin-bottom: 18px;
    }

    .redirect-action__head {
        margin-top: 0;
    }
}

/* Telegram and Discord share one social-action surface and one action-header alignment. */
.redirect-page--telegram .redirect-action,
.redirect-page--discord .redirect-action {
    color-scheme: normal;
    min-height: 0;
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    color: var(--color-text);
}

.redirect-page--telegram .redirect-action__head,
.redirect-page--discord .redirect-action__head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 28px;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--color-border);
}

.redirect-page--telegram .redirect-action__head p,
.redirect-page--discord .redirect-action__head p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
