/* Custom Properties & Modern Reset */
:root {
    /* Fonts */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', 'Inter', var(--font-primary);

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;

    /* Theme colors defaults (will be overridden by dark/light class) */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-main: #0a0b0d;
    --bg-surface: rgba(20, 22, 26, 0.75);
    --bg-surface-solid: #14161a;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-focus: rgba(243, 156, 18, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-copper: #f39c12;
    --accent-copper-rgb: 243, 156, 18;
    --accent-green: #2ecc71;
    --accent-green-rgb: 46, 204, 113;
    
    --header-bg: rgba(10, 11, 13, 0.7);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    
    --hero-glow-1: rgba(46, 204, 113, 0.08);
    --hero-glow-2: rgba(243, 156, 18, 0.08);
}

/* Light Theme Variables */
body.light-theme {
    --bg-main: #f8f9fa;
    --bg-surface: rgba(255, 255, 255, 0.75);
    --bg-surface-solid: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-focus: rgba(230, 126, 34, 0.4);
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --accent-copper: #e67e22;
    --accent-copper-rgb: 230, 126, 34;
    --accent-green: #27ae60;
    --accent-green-rgb: 39, 174, 96;
    
    --header-bg: rgba(248, 249, 250, 0.7);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --hero-glow-1: rgba(39, 174, 96, 0.04);
    --hero-glow-2: rgba(230, 126, 34, 0.04);
}

/* Basic Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.no-scroll {
    overflow: hidden;
}

/* Typography & Layout Elements */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 120px 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 80px 0;
    }
}

/* Helper Text Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-copper) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-green {
    background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-copper {
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.font-bold {
    font-weight: 700;
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-copper) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(var(--accent-copper-rgb), 0.2);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--accent-copper-rgb), 0.35);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--bg-surface-solid);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

/* Fixed Header with Glassmorphism & Scroll timeline */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    height: 88px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

.header__container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo-link {
    display: flex;
    align-items: center;
}

.header__logo {
    height: 40px;
    width: auto;
    transition: var(--transition-smooth);
}

.header__nav-list {
    display: flex;
    gap: 32px;
}

.header__nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 8px 0;
}

.header__nav-link:hover {
    color: var(--text-primary);
}

.header__nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-copper) 100%);
    transition: var(--transition-smooth);
}

.header__nav-link:hover::after {
    width: 100%;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    background: var(--bg-surface-solid);
    transform: rotate(15deg);
    border-color: var(--accent-copper);
}

.theme-toggle-btn__icon {
    width: 20px;
    height: 20px;
}

body.dark-theme .theme-toggle-btn__icon--sun {
    display: block;
}

body.dark-theme .theme-toggle-btn__icon--moon {
    display: none;
}

body.light-theme .theme-toggle-btn__icon--sun {
    display: none;
}

body.light-theme .theme-toggle-btn__icon--moon {
    display: block;
}

/* Native CSS Scroll-driven shrinking header */
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    @keyframes shrink-header {
        to {
            height: 64px;
            background-color: var(--header-bg);
            border-bottom-color: var(--border-color);
        }
    }
    
    .header {
        animation: shrink-header auto linear both;
        animation-timeline: scroll(block root);
        animation-range: 0px 100px;
    }
}

/* JS Fallback for Shrinking Header */
.header.header--shrunk {
    height: 64px;
    box-shadow: var(--shadow-sm);
}

.header.header--shrunk .header__logo {
    height: 32px;
}

/* Mobile burger menu styling */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.burger-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    padding-top: 140px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero__bg-gradient {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: 
        radial-gradient(circle at 30% 30%, var(--hero-glow-1) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, var(--hero-glow-2) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.hero__particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.hero__particles canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hero__container {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero__content {
    max-width: 620px;
}

.hero__badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    background: rgba(46, 204, 113, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(46, 204, 113, 0.2);
    margin-bottom: 24px;
}

.hero__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero__description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 540px;
}

.hero__cta {
    display: flex;
    gap: 16px;
}

/* Interactive Tech Card in Hero */
.hero__visual {
    display: flex;
    justify-content: center;
    position: relative;
}

.tech-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
}

.tech-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--accent-copper-rgb), 0.25);
    box-shadow: 0 30px 40px -15px rgba(0,0,0,0.4);
}

.tech-card__process {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.tech-card__node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tech-card__icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.tech-card__node--raw .tech-card__icon-wrapper {
    color: var(--text-muted);
}

.tech-card__node--tech .tech-card__icon-wrapper {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(46, 204, 113, 0.05);
}

.tech-card__node--product .tech-card__icon-wrapper {
    border-color: var(--accent-copper);
    color: var(--accent-copper);
    background: rgba(243, 156, 18, 0.05);
}

.tech-card__icon-wrapper--pulse {
    position: relative;
}

.tech-card__icon-wrapper--pulse::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 1px solid var(--accent-green);
    opacity: 0.4;
    animation: ripple 2s infinite linear;
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 0; }
}

.tech-card__connector {
    flex-grow: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 12px;
    position: relative;
    overflow: hidden;
    margin-top: -24px;
}

.tech-card__connector-pulse {
    position: absolute;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    animation: flow-pulse 2s infinite linear;
}

@keyframes flow-pulse {
    0% { left: -20px; }
    100% { left: 100%; }
}

.tech-card__info {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.tech-card__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 48%;
}

.tech-card__number {
    font-size: 1.75rem;
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1;
}

.tech-card__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Scroll indicator */
.hero__scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    animation: bounce 2s infinite;
    z-index: 3;
}

.hero__scroll-indicator:hover {
    color: var(--text-primary);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-8px) translateX(-50%); }
    60% { transform: translateY(-4px) translateX(-50%); }
}

@media (max-width: 992px) {
    .hero__container {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
        padding-top: 40px;
    }
    
    .hero__content {
        margin: 0 auto;
    }
    
    .hero__cta {
        justify-content: center;
    }
    
    .hero__visual {
        margin-top: 20px;
    }
}

/* Section Header styling */
.section-header {
    text-align: center;
    margin-bottom: 70px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-subtitle {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-copper);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    letter-spacing: -0.01em;
    margin-bottom: 20px;
}

.section-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-copper) 100%);
    margin: 0 auto;
    border-radius: 10px;
}

/* About Section */
.about {
    position: relative;
}

.about__grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about__text-block p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.about__text-block p:last-child {
    margin-bottom: 0;
}

.lead-text {
    font-size: 1.25rem !important;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary) !important;
}

.about__cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.value-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 30px;
    display: flex;
    gap: 24px;
    transition: var(--transition-smooth);
}

.value-card:hover {
    transform: translateX(8px);
    border-color: rgba(var(--accent-green-rgb), 0.25);
    background: var(--bg-surface-solid);
}

.value-card__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    background: rgba(var(--accent-green-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
}

.value-card__title {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.value-card__description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@media (max-width: 992px) {
    .about__grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}



/* Ecology Section */
.ecology {
    position: relative;
    overflow: hidden;
}

.ecology__bg-gradient {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(var(--accent-green-rgb), 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.ecology__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.ecology__card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 40px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ecology__card:hover {
    border-color: rgba(var(--accent-green-rgb), 0.25);
    background: var(--bg-surface-solid);
    transform: translateY(-6px);
}

.ecology__card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-sm);
    background: rgba(var(--accent-green-rgb), 0.06);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ecology__card h3 {
    font-size: 1.3rem;
}

.ecology__card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (max-width: 992px) {
    .ecology__grid {
        grid-template-columns: 1fr;
    }
}

/* Footer Section */
.footer {
    background-color: #050608;
    color: #9ca3af;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 80px 0 30px 0;
}

body.light-theme .footer {
    background-color: #f1f3f5;
    color: #4b5563;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer__container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.footer__brand {
    max-width: 380px;
}

.footer__logo {
    height: 36px;
    width: auto;
    margin-bottom: 24px;
}

.footer__text {
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer__nav-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer__nav-link {
    font-size: 0.95rem;
}

.footer__nav-link:hover {
    color: var(--text-primary);
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px 0 24px;
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
}

body.light-theme .footer__bottom {
    border-top-color: rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .footer__container {
        flex-direction: column;
        gap: 40px;
    }
}

/* Scroll Animation classes (reveal-on-scroll) */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Настройки для тех, кто предпочитает уменьшенное движение */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .tech-card:hover {
        transform: none !important;
    }
    
    .tech-card__connector-pulse,
    .tech-card__icon-wrapper--pulse::after,
    .hero__scroll-indicator {
        animation: none !important;
    }
    
    body {
        transition: none !important;
    }
}

/* Mobile responsive menu */
@media (max-width: 768px) {
    .burger-btn {
        display: flex;
    }
    
    .header__nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-main);
        z-index: 99;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition-smooth);
    }
    
    .header__nav--active {
        right: 0;
    }
    
    .header__nav-list {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    
    .header__nav-link {
        font-size: 1.5rem;
    }
    
    /* Анимация бургера */
    .burger-btn--active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .burger-btn--active span:nth-child(2) {
        opacity: 0;
    }
    
    .burger-btn--active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}
