/* --- Глобальные настройки --- */
html {
    scroll-behavior: smooth;
}

:root {
    --bg-main: #2b2e32;
    --bg-deep: #212427;
    --bg-card: #353a3f;
    --text-primary: #ffffff;
    --text-secondary: #ced4da;

    --accent-orange: #f38b2a;
    --accent-hover: #d9751e;

    --border-dim: #454d55;
    --header-height: clamp(80px, 10vw, 100px);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h2, h3 {
    hyphens: auto;
    word-wrap: break-word;
}

.container {
    max-width: 1600px; 
    margin: 0 auto;
    padding: 0 clamp(15px, 5vw, 40px);
}

/* --- Шапка (Header) --- */
.header {
    background-color: #1a1c1f;
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-dim);
}

.header-flex {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.logo-link {
    display: block;
    flex-shrink: 0;
}

.main-logo {
    height: clamp(60px, 8vw, 92px);
    width: auto;
    transition: all 0.3s ease-in-out;
}

.main-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(243, 139, 42, 0.5));
}

.nav {
    display: flex;
    gap: clamp(10px, 2vw, 30px);
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 600;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav a:hover {
    color: var(--accent-orange);
}

/* --- Кнопки --- */
.btn-github {
    background-color: #f06606ff;
    color: white;
    padding: clamp(8px, 1vw, 12px) clamp(16px, 2vw, 26px);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(13px, 1.2vw, 16px);
}

.btn-github:hover {
    background: rgba(243, 139, 42, 0.4);
}

.btn-primary {
    background: #f06606ff;
    color: white;
    margin-top: 20px;
    padding: clamp(12px, 2vw, 20px) clamp(20px, 3vw, 30px);
    text-decoration: none;
    font-weight: 800;
    font-size: clamp(14px, 1.2vw, 18px);
    border-radius: 8px;
    text-align: center;
    transition: all 0.25s ease;
    min-width: 200px;
    display: inline-block;
    pointer-events: auto; 
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-signup {
    display: inline-block;
    background: #f06606ff;
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    margin-top: 20px;
    transition: 0.3s;
}

/* --- Секции --- */
.section {
    padding: clamp(60px, 10vw, 100px) 0;
}

.alt-bg {
    background-color: var(--bg-deep);
}

.section-title {
    position: relative;
    z-index: 2;
    font-size: clamp(42px, 6vw, 60px);
    text-align: center;
    margin-bottom: clamp(30px, 6vw, 60px);
    font-weight: 800;
}

/* --- Интерактивная зона (Hero + Продукты) --- */
.interactive-bg-area {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: var(--header-height);
    box-sizing: border-box;
    overflow: hidden;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* --- Hero Section --- */
.hero-section {
    padding: calc(var(--header-height) + clamp(40px, 8vw, 100px)) 0 clamp(40px, 5vw, 60px) 0;
    z-index: 1;
    position: relative;
    pointer-events: none;
}

.hero-text {
    max-width: 1000px;
    margin-left: clamp(0px, 10vw, 200px);
}

/* Возвращаем активность элементам Hero */
.hero-btns, .badge, .hero-text h2, .hero-text p {
    pointer-events: auto; 
}

.badge {
    color: var(--accent-orange);
    background: rgba(243, 139, 42, 0.15);
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

h2 {
    font-size: clamp(35px, 6vw, 66px);
    line-height: 1.1;
    margin: 25px 0;
    font-weight: 900;
}

.hero-text h2, 
.hero-text p, 
.badge {
    pointer-events: none; 
}


.hero-btns {
    pointer-events: auto; 
}

.btn-primary {
    pointer-events: auto;
}

.hero-text p {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 2;
}

.product-item {
    background: var(--bg-card);
    padding: clamp(20px, 3vw, 40px);
    border-radius: 15px;
    border: 1px solid var(--border-dim);
    transition: 0.3s;
    position: relative;
    z-index: 3;
    pointer-events: auto;
    margin-bottom: clamp(24px, 6vw, 36px);
}

.product-item:hover {
    border-color: var(--accent-orange);
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.product-item h2.p-num {
    color: var(--accent-orange);
    font-weight: 600;
    font-size: clamp(20px, 2vw, 29px);
    margin-bottom: 15px;
}

.product-text {
    font-size: clamp(15px, 2vw, 21px);
}

.feature-large {
    display: flex;
    align-items: center;
    gap: clamp(30px, 6vw, 80px);
    margin-bottom: clamp(60px, 10vw, 120px);
}

.feature-large.reverse {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 1;
}

.feature-text h3 {
    font-size: clamp(24px, 3vw, 36px);
    margin-bottom: 20px;
}

.feature-visual {
    flex: 1;
    height: clamp(200px, 40vw, 450px);
    background: var(--bg-card);
    border-radius: 20px;
}

.description {
    font-size: clamp(15px, 3vw, 20px);
}

.github-icon {
    width: 25px;
    height: 25px;
    filter: brightness(0) invert(1);
}

.git-text {
    font-size: 20px;
}

.footer {
    background-color: #1a1c1f;
    border-top: 1px solid var(--border-dim);
    padding: 25px 0;
}

.footer-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    height: 120px;
    position: relative;
}

.footer-logo {
    height: 100%;
    width: auto;
    opacity: 0.9;
}

.footer-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin-right: 170px;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.footer-row.top {
    padding-bottom: 10px;
}


.footer-row.top::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 100%; 
    height: 1px;
    background-color: var(--border-dim);
}

.footer-row.bottom {
    padding-top: 10px;
}

.footer-contact {
    text-decoration: none;
    color: var(--accent-orange);
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-copyright {
    margin: 0;
    font-size: 17px;
    color: var(--text-secondary);
    opacity: 0.6;
    white-space: nowrap;
}

/* --- Навигация и логика исчезновения --- */
.nav-wrapper {
    display: flex;
    flex: 1;
    justify-content: center;
    height: 30px; 
    min-width: 0;
    overflow: hidden; 
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(5px, 2vw, 30px);
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 600;
    transition: color 0.2s;
    white-space: nowrap;
    line-height: 30px; /* Должно совпадать с высотой nav-wrapper */
}

.nav a:hover {
    color: var(--accent-orange);
}

.btn-github {
    padding: 8px 25px 8px 25px;
    flex-shrink: 0;
    gap: 10px;
}

.section#resources {
    padding: clamp(75px, 12vw, 150px) 0;
}

.resource-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 clamp(15px, 5vw, 40px);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    padding: clamp(30px, 4vw, 50px);
    min-height: 220px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.resource-card:hover {
    border-color: var(--accent-orange);
    transform: translateY(-5px);
    background: rgba(243, 139, 42, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.resource-icon {
    font-size: 40px;
    background: rgba(255, 255, 255, 0.05);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.resource-card:hover .resource-icon {
    transform: scale(1.1);
    background: rgba(243, 139, 42, 0.1);
}

.resource-info h3 {
    color: var(--text-primary);
    font-size: clamp(22px, 2.5vw, 28px);
    margin-bottom: 12px;
    margin-top: 0;
}

.resource-info p {
    color: var(--text-secondary);
    margin: 0;
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.5;   
}

.resource-arrow {
    margin-left: auto;
    color: var(--accent-orange);
    font-size: clamp(24px, 3vw, 36px);
    opacity: 0.3;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.resource-card:hover .resource-arrow {
    opacity: 1;
    transform: translateX(5px);
}

.resource-icons {
    height: clamp(100px, 8vw, 140px); 
    width: auto;
    flex-shrink: 0;
}

/* --- Адаптив --- */
@media (max-width: 1024px) {
    .hero-text { margin-left: 0 !important; text-align: center; margin: 0 auto; }
    .hero-btns { justify-content: center; }
}

@media (max-width: 900px) {
    .nav-wrapper { display: none; }
    
    .feature-large, .feature-large.reverse { 
        flex-direction: column; 
        text-align: center; 
    }
    
    .feature-visual {
        width: 100%;
    }

    .header-flex {
        justify-content: space-between;
    }

    .nav-wrapper { 
        display: none; 
    }

    .interactive-bg-area {
        min-height: auto; 
        display: block;
        overflow: visible;
    }

    .hero-section {
        min-height: calc(70dvh - var(--header-height));
        padding: 40px 0;
        margin-top: 200px;
    }

    .section#products {
        padding: 60px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .footer-brand {
        grid-column: span 2;
        text-align: center;
    }
    
    .footer-brand p {
        margin: 0 auto;
    }

    .footer-bottom {
        justify-content: center;
        gap: 20px;
        text-align: center;
    }
}

/* --- Специфический адаптив для смартфонов --- */
@media (max-width: 480px) {
    :root {
        --header-height: 70px;
    }
    
    h2 {
        font-size: 28px !important;
        line-height: 1.2;
    }

    .hero-text h2 {
        font-size: 32px !important;
    }

    .hero-text p {
        font-size: 16px;
        margin-bottom: 25px;
    }

    .hero-section {
        min-height: calc(70dvh - var(--header-height));
        padding: 90px 0;
        margin-top: 130px;
    }

    .footer {
        padding: 30px 0;
    }

    .footer-inline {
        flex-direction: column; 
        height: auto;           
        gap: 20px;
        justify-content: center;
    }

    .footer-logo {
        height: 80px;           
        width: auto;
        position: static;       
        margin: 0;
    }

    .footer-text-group {
        margin-right: 0;        
        width: 100%;
        height: auto;
    }

    .footer-row.top {
        padding-bottom: 8px;
    }

    .footer-row.bottom {
        padding-top: 8px;
    }

    .footer-contact {
        font-size: 16px;        
    }

    .footer-copyright {
        font-size: 11px;       
        white-space: normal;   
        text-align: center;
        line-height: 1.4;
    }

    .footer-row.top::after {
        background-color: rgba(255, 255, 255, 0.1); 
    }

    .container {
        padding: 0 20px;
    }

    .product-item {
        padding: 20px;
    }

    .product-item h2.p-num {
        font-size: 22px;
    }

    .btn-github {
        padding: 7px 18px 7px 18px;
        flex-shrink: 0;
        gap: 7px;
        margin-bottom: 6px;
    }

    .github-icon {
        width: 23px;
        height: 23px;
        filter: brightness(0) invert(1);
    }

    .git-text {
        font-size: 15px;
    }

    .resource-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .resource-icon {
        margin-bottom: 10px;
    }
    
    .resource-arrow {
        display: none;
    }
}