:root {
    --primary-color: #4a6fa5;
    --secondary-color: #73b9ff;
    --text-color: #e8e8e8;
    --muted-color: #bdbdbd;
    --background-color: #121212;
    --card-bg: #1e1e1e;
    --ad-space-bg: #1a1a1a;
    --border-color: #343434;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.layout {
    display: grid;
    grid-template-areas:
        "left-ad main right-ad"
        "bottom-ad bottom-ad bottom-ad";
    grid-template-columns: minmax(160px, 1fr) minmax(300px, 800px) minmax(160px, 1fr);
    min-height: 100vh;
    gap: 20px;
}

.ad-space {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px;
    padding: 20px;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--ad-space-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.desktop-ad {
    min-width: 200px;
    min-height: 640px;
}

.desktop-ad iframe {
    border: 0;
}

.left-ad {
    grid-area: left-ad;
}

.right-ad {
    grid-area: right-ad;
}

.bottom-ad {
    grid-area: bottom-ad;
    min-height: 120px;
    margin-bottom: 20px;
}

.main-content {
    grid-area: main;
    padding: 20px;
}

.container {
    max-width: 100%;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 15px;
    background-color: rgba(30, 30, 30, 0.82);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.profile {
    padding: 30px 0 40px;
    text-align: center;
}

.profile-img {
    width: 150px;
    height: 150px;
    border: 5px solid var(--primary-color);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.profile-img:hover {
    transform: scale(1.05);
}

.profile-name {
    margin: 20px 0 10px;
    color: var(--secondary-color);
    font-size: clamp(2rem, 6vw, 2.7rem);
    line-height: 1.15;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.profile-bio {
    max-width: 600px;
    margin: 0 auto 24px;
    color: var(--muted-color);
    font-size: 1.1rem;
}

.primary-cta {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 999px;
    background-color: var(--secondary-color);
    color: #071421;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
}

.primary-cta:hover {
    transform: translateY(-2px);
    background-color: #9acfff;
}

.content-section {
    padding: 32px 0;
    border-top: 1px solid var(--border-color);
}

.content-section h2 {
    margin: 0 0 12px;
    color: #f5f5f5;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    line-height: 1.25;
}

.content-section > p {
    margin-top: 0;
    color: var(--muted-color);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.feature-card {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
}

.feature-card h3 {
    margin: 0 0 8px;
    color: var(--secondary-color);
    font-size: 1.05rem;
}

.feature-card p {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    max-width: 560px;
    margin: 24px auto 0;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-left: 4px solid transparent;
    border-radius: 10px;
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.social-link:hover {
    transform: translateY(-3px);
    background-color: #2a2a2a;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.social-link:focus-visible,
.primary-cta:focus-visible,
.faq summary:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
}

.telegram:hover {
    border-left-color: #24a1de;
}

.terabox:hover {
    border-left-color: #1877f2;
}

.social-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-right: 15px;
    fill: currentColor;
}

.telegram .social-icon {
    color: #24a1de;
}

.app-download {
    border-left-color: #2ecc71;
}

.app-download:hover {
    border-left-color: #27ae60;
    background-color: #243326;
}

.app-download .social-icon {
    color: #2ecc71;
}

.app-download-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.app-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background-color: #2ecc71;
    color: #0f1d14;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-transform: uppercase;
}

.download-note {
    max-width: 560px;
    margin: 18px auto 0 !important;
    font-size: 0.9rem;
}

.faq details {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.faq summary {
    color: #f2f2f2;
    font-weight: 700;
    cursor: pointer;
}

.faq details p {
    margin: 10px 0 0;
    color: var(--muted-color);
}

footer {
    margin-top: 10px;
    padding: 24px 20px 10px;
    border-top: 1px solid var(--border-color);
    color: #9b9b9b;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 200px minmax(300px, 1fr) 200px;
        gap: 8px;
    }

    .ad-space {
        margin-inline: 4px;
    }
}

@media (max-width: 768px) {
    .layout {
        grid-template-areas:
            "main"
            "bottom-ad";
        grid-template-columns: minmax(0, 1fr);
    }

    .left-ad,
    .right-ad {
        display: none;
    }

    .main-content {
        padding: 12px;
    }

    .container {
        padding: 20px;
    }

    .profile {
        padding-top: 20px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .bottom-ad {
        margin: 12px;
        padding: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
