/* ==================== GOOGLE FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@700&family=Roboto+Mono:wght@400;500&display=swap');

/* ==================== CSS VARIABLES ==================== */
:root {
    --color-bg-primary: #111827;
    --color-bg-secondary: #1F2937;
    --color-text-primary: #F9FAFB;
    --color-text-secondary: #9CA3AF;
    --color-accent: #34D399;
    --color-accent-hover: #10B981;

    --font-family-headings: 'Inter', sans-serif;
    --font-family-body: 'Roboto Mono', monospace;

    --container-width: 1140px;
    --container-padding: 1rem;
    
    --header-height: 5rem;
}

/* ==================== BASE STYLES ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-body);
    font-size: 16px;
    line-height: 1.7;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    color: var(--color-text-primary);
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

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

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--color-bg-secondary);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.header__logo {
    font-family: var(--font-family-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    transition: color 0.3s ease;
}

.header__logo:hover {
    color: var(--color-accent);
}

.header__nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header__nav-link {
    font-family: var(--font-family-body);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

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

.header__nav-link--cta {
    color: var(--color-bg-primary);
    background-color: var(--color-accent);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.header__nav-link--cta:hover {
    color: var(--color-bg-primary);
    background-color: var(--color-accent-hover);
}

.header__burger {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
}

/* ==================== FOOTER ==================== */
.footer {
    background-color: var(--color-bg-secondary);
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(249, 250, 251, 0.1);
}

.footer__container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer__logo {
    font-family: var(--font-family-headings);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
}

.footer__copyright {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.footer__title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__link {
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer__link:hover {
    color: var(--color-accent);
}

.footer__icon {
    width: 18px;
    height: 18px;
}

.footer__address {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--color-text-secondary);
}

/* ==================== RESPONSIVENESS (MOBILE-FIRST) ==================== */
@media screen and (max-width: 768px) {
    .header__nav {
        display: none; /* Будет реализовано как мобильное меню в JS */
    }
    .header__burger {
        display: block;
    }
    .footer__container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer__column {
        margin-bottom: 2rem;
    }
    .footer__list--contacts li {
        justify-content: center;
    }
    .footer__address {
       justify-content: center;
       text-align: left;
    }
}

/* ==================== HERO ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height); /* Компенсация высоты хедера */
}

.hero__container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 3rem;
}

.hero__title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    min-height: 135px; /* Чтобы секция не "прыгала" при смене текста */
}

/* Эффект курсора для печатающей машинки */
.hero__title #typing-effect::after {
    content: '_';
    color: var(--color-accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.hero__description {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 550px;
    margin-bottom: 2.5rem;
}

.hero__cta {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-family: var(--font-family-headings);
    font-weight: 700;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    animation: pulse 2s infinite;
}

.hero__cta:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-3px);
    animation-play-state: paused;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(52, 211, 153, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

.hero__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero__image {
    border-radius: 12px;
    opacity: 0.6;
    border: 1px solid var(--color-bg-secondary);
}

/* ==================== RESPONSIVENESS (HERO) ==================== */
@media screen and (max-width: 992px) {
    .hero__title {
        font-size: 2.8rem;
        min-height: 108px;
    }
}

@media screen and (max-width: 768px) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + 2rem);
        padding-bottom: 4rem;
        text-align: center;
    }
    .hero__container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero__content {
        order: 2; /* Текст будет под картинкой */
    }
    .hero__visual {
        order: 1;
    }
    .hero__title {
        font-size: 2.2rem;
        min-height: auto;
        margin-bottom: 1rem;
    }
    .hero__description {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 2rem;
    }
}

/* ==================== REUSABLE COMPONENTS ==================== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header__title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.section-header__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== STAGES ==================== */
.stages {
    padding: 6rem 0;
}

.stages__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stages__card {
    background-color: var(--color-bg-secondary);
    padding: 2.5rem 2rem;
    border-radius: 8px;
    border-top: 3px solid var(--color-accent);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stages__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stages__card-number {
    font-family: var(--font-family-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 1rem;
    display: block;
}

.stages__card-title {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

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

/* ==================== RESPONSIVENESS (STAGES) ==================== */
@media screen and (max-width: 992px) {
    .stages__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .stages {
        padding: 4rem 0;
    }
    .section-header__title {
        font-size: 2rem;
    }
    .section-header {
        margin-bottom: 3rem;
    }
}

@media screen and (max-width: 576px) {
    .stages__grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== TECH ==================== */
.tech {
    padding: 6rem 0;
    background-color: var(--color-bg-primary); /* Можно чередовать фон секций */
}

.tech__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 1.5rem;
}

.tech__card {
    background-color: var(--color-bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid transparent;
    transition: border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.tech__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(52, 211, 153, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.tech__card:hover::before {
    opacity: 1;
}

.tech__card:hover {
    border-color: rgba(52, 211, 153, 0.3);
}

.tech__card--large {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: flex-end;
}

.tech__card-icon,
.tech__card-icon-group {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.tech__card-icon {
    width: 36px;
    height: 36px;
}

.tech__card-icon-group {
    display: flex;
    gap: 1rem;
}

.tech__card-icon-group i {
    width: 44px;
    height: 44px;
}

.tech__card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.tech__card--large .tech__card-title {
    font-size: 1.8rem;
}

.tech__card-description {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==================== RESPONSIVENESS (TECH) ==================== */
@media screen and (max-width: 992px) {
    .tech__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tech__card--large {
        grid-column: span 2;
        grid-row: span 1; /* На планшете большой блок будет занимать всю ширину */
        min-height: 250px;
    }
}

@media screen and (max-width: 768px) {
    .tech {
        padding: 4rem 0;
    }
}

@media screen and (max-width: 576px) {
    .tech__grid {
        grid-template-columns: 1fr;
    }
    .tech__card--large {
        grid-column: span 1;
    }
}

/* ==================== CASES ==================== */
.cases {
    padding: 6rem 0;
    background-color: var(--color-bg-secondary);
}

.cases__tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.cases__tab {
    background-color: transparent;
    border: 1px solid var(--color-bg-primary);
    color: var(--color-text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family-body);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cases__tab:hover {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
}

.cases__tab--active {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg-primary);
}

.cases__tab--active:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-bg-primary);
}

.cases__content-wrapper {
    position: relative;
    min-height: 450px;
}

.cases__content {
    display: none;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.cases__content--active {
    display: grid;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cases__content-image img {
    border-radius: 12px;
}

.cases__content-text h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.cases__content-text h3:first-child {
    margin-top: 0;
}

.cases__content-text p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.cases__content-highlight {
    color: var(--color-accent);
    font-family: var(--font-family-body);
}

.cases__tags {
    margin-top: 2rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cases__tags span {
    background-color: var(--color-bg-primary);
    color: var(--color-text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==================== RESPONSIVENESS (CASES) ==================== */
@media screen and (max-width: 992px) {
    .cases__content {
        grid-template-columns: 1fr;
    }
    .cases__content-wrapper {
        min-height: auto;
    }
    .cases__content-image {
        max-width: 400px;
        margin: 0 auto 2rem auto;
    }
}
@media screen and (max-width: 768px) {
    .cases {
        padding: 4rem 0;
    }
}

/* ==================== BLOG ==================== */
.blog {
    padding: 6rem 0;
}

.blog__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.blog__card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.blog__card-image {
    overflow: hidden;
}

.blog__card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.blog__card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog__card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.blog__card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.blog__card-meta i {
    width: 14px;
    height: 14px;
}

.blog__card-title {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    transition: color 0.3s ease;
}

.blog__card:hover .blog__card-title {
    color: var(--color-accent);
}

.blog__card-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Featured card styles */
.blog__card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
}

.blog__card--featured .blog__card-image {
    width: 55%;
    flex-shrink: 0;
}

.blog__card--featured .blog__card-content {
    padding: 2rem;
    justify-content: center;
}

.blog__card--featured .blog__card-title {
    font-size: 1.8rem;
}

.blog__cta-container {
    text-align: center;
    margin-top: 4rem;
}

.blog__cta {
    border: 1px solid var(--color-bg-secondary);
    color: var(--color-text-secondary);
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.blog__cta:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

/* ==================== RESPONSIVENESS (BLOG) ==================== */
@media screen and (max-width: 992px) {
    .blog__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .blog {
        padding: 4rem 0;
    }
    .blog__grid {
        grid-template-columns: 1fr;
    }
    .blog__card--featured {
        flex-direction: column;
    }
    .blog__card--featured .blog__card-image {
        width: 100%;
        height: 250px;
    }
    .blog__card--featured .blog__card-title {
        font-size: 1.4rem;
    }
}

/* ==================== CONTACT ==================== */
.contact {
    padding: 6rem 0;
    background-color: var(--color-bg-secondary);
}

.contact__container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.contact__info-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact__info-description {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.contact__info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact__info-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
}

.contact__info-list a:hover {
    color: var(--color-accent);
}

.contact__info-list i {
    width: 20px;
    height: 20px;
    color: var(--color-accent);
}

.contact__form-wrapper {
    background-color: var(--color-bg-primary);
    padding: 3rem;
    border-radius: 12px;
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact__form-group {
    display: flex;
    flex-direction: column;
}

.contact__form-label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.contact__form-input {
    background-color: var(--color-bg-secondary);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--color-text-primary);
    font-family: var(--font-family-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact__form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.contact__form-group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.contact__form-checkbox {
    appearance: none;
    width: 1.25em;
    height: 1.25em;
    border: 2px solid var(--color-text-secondary);
    border-radius: 4px;
    margin-top: 0.2em;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.contact__form-checkbox:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.contact__form-checkbox:checked::before {
    content: '✔';
    position: absolute;
    top: -0.1em;
    left: 0.15em;
    color: var(--color-bg-primary);
    font-size: 0.9em;
}

.contact__form-checkbox-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.contact__form-checkbox-label a {
    color: var(--color-accent);
    text-decoration: underline;
}

.contact__form-button {
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family-headings);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.contact__form-button:hover {
    background-color: var(--color-accent-hover);
}

.contact__form-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.contact__success-message {
    display: none; /* Hidden by default */
    text-align: center;
    padding: 2rem;
    animation: fadeIn 0.5s ease;
}
.contact__success-message i {
    width: 60px;
    height: 60px;
    color: var(--color-accent);
    margin-bottom: 1rem;
}
.contact__success-message h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ==================== RESPONSIVENESS (CONTACT) ==================== */
@media screen and (max-width: 992px) {
    .contact__container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .contact__info {
        text-align: center;
    }
    .contact__info-list {
        justify-content: center;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ==================== COOKIE POPUP ==================== */
.cookie-popup {
    position: fixed;
    bottom: -100%; /* Initially hidden */
    left: 0;
    width: 100%;
    background-color: var(--color-bg-secondary);
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
    padding: 1.5rem 2rem;
    z-index: 200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: bottom 0.5s ease-in-out;
}

.cookie-popup.cookie-popup--show {
    bottom: 0; /* Slide in */
}

.cookie-popup__text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.cookie-popup__text a {
    color: var(--color-accent);
    text-decoration: underline;
}

.cookie-popup__button {
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-family-body);
    font-weight: 500;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.cookie-popup__button:hover {
    background-color: var(--color-accent-hover);
}

@media screen and (max-width: 768px) {
    .cookie-popup {
        flex-direction: column;
        text-align: center;
    }
}

/* ==================== POLICY PAGES STYLES ==================== */
.pages {
    padding: calc(var(--header-height) + 4rem) 0 6rem 0;
}

.pages .container {
    max-width: 800px; /* Optimal width for reading text */
}

.pages h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.pages h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--color-accent);
    padding-left: 1rem;
}

.pages p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.pages ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.pages li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.pages a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: color 0.3s ease;
}

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

.pages strong {
    color: var(--color-text-primary);
    font-weight: 500;
}

@media screen and (max-width: 768px) {
    .pages h1 {
        font-size: 2.5rem;
    }
    .pages h2 {
        font-size: 1.8rem;
    }
    .pages p, .pages li {
        font-size: 1rem;
    }
}