/* ==========================================================================
   FORMA. DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
    /* Цветовая палитра */
    --bg-color: #f4f4f3;
    --bg-dark: #111111;
    --text-color: #111111;
    --text-light: #f4f4f3;
    --text-muted: #555555;
    
    /* Акцентные приглушенные цвета для свечения */
    --accent-blue-glow: rgba(142, 166, 180, 0.35);
    --accent-peach-glow: rgba(228, 203, 180, 0.45);
    --accent-orange: #d38c6b;
    --border-color: rgba(17, 17, 17, 0.08);
    --border-light: rgba(244, 244, 243, 0.15);

    /* Типографика */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;

    /* Переходы */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.6s var(--ease-out-expo);
    --transition-fast: all 0.3s ease;
}

/* ==========================================================================
   СБРОС СТИЛЕЙ И ГЛОБАЛЬНЫЕ НАСТРОЙКИ
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    position: relative;
}

/* Для скрытия прокрутки при загрузке */
body.loading {
    overflow: hidden;
    height: 100vh;
}

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

li {
    list-style: none;
}

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

/* ==========================================================================
   СЕТКА И КОНТЕЙНЕРЫ
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 4rem;
}

@media (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1.25rem;
    }
}

/* ==========================================================================
   КАСТОМНЫЙ КУРСОР
   ========================================================================== */

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
}

.cursor-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--text-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.cursor-ring {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid var(--text-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
}

.cursor-text {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--bg-color);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
    text-align: center;
}

/* Эффекты при наведении */
.custom-cursor.hovered .cursor-dot {
    width: 0;
    height: 0;
}

.custom-cursor.hovered .cursor-ring {
    width: 80px;
    height: 80px;
    background-color: var(--text-color);
    border-color: var(--text-color);
}

.custom-cursor.hovered .cursor-text {
    opacity: 1;
    transform: scale(1);
}

.custom-cursor.link-hovered .cursor-ring {
    width: 60px;
    height: 60px;
    border-color: rgba(17,17,17,0.3);
    background-color: rgba(17,17,17,0.03);
}

.custom-cursor.link-hovered .cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-color);
}

@media (pointer: coarse) {
    .custom-cursor {
        display: none;
    }
}

/* ==========================================================================
   ЗАГРУЗОЧНЫЙ ЭКРАН (PRELOADER)
   ========================================================================== */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preloader-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
}

.preloader-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--text-light);
}

.preloader-logo {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    font-family: var(--font-sans);
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
}

.preloader-logo .dot {
    color: var(--accent-orange);
}

.preloader-progress-container {
    width: 200px;
    height: 2px;
    background-color: var(--border-light);
    margin: 0 auto 1rem auto;
    overflow: hidden;
    position: relative;
}

.preloader-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--text-light);
}

.preloader-percent {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    opacity: 0.6;
}

/* ==========================================================================
   НАВИГАЦИЯ (HEADER)
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 100;
    transition: padding 0.4s ease, background-color 0.4s ease;
}

.header.scrolled {
    padding: 1.25rem 0;
    background-color: rgba(244, 244, 243, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 102;
    transition: var(--transition-fast);
}

.logo .dot {
    color: var(--accent-orange);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    position: relative;
    padding: 0.5rem 0;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--text-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out-expo);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Кнопка бургера */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 14px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 102;
    padding: 0;
}

.burger-line {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.4s var(--ease-out-expo), background-color 0.4s var(--ease-out-expo);
}

.burger-btn.active .burger-line:first-child {
    transform: translateY(6px) rotate(45deg);
}

.burger-btn.active .burger-line:last-child {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 991px) {
    .nav-desktop {
        display: none;
    }
    
    .burger-btn {
        display: flex;
    }
}

/* ==========================================================================
   ПОЛНОЭКРАННОЕ МОБИЛЬНОЕ МЕНЮ
   ========================================================================== */

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
}

.mobile-menu.active {
    visibility: visible;
    pointer-events: all;
}

.mobile-menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.6s var(--ease-out-expo);
}

.mobile-menu.active .mobile-menu-bg {
    transform: scaleY(1);
}

.mobile-menu-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1440px;
    height: 100%;
    padding: 8rem 4rem 4rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--text-light);
}

.mobile-nav {
    margin-top: auto;
    margin-bottom: auto;
}

.mobile-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-link {
    font-size: clamp(2rem, 8vw, 4rem);
    font-family: var(--font-serif);
    font-weight: 300;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo), color 0.3s ease;
}

.mobile-menu.active .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-link span {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.4;
}

.mobile-link:hover {
    color: var(--accent-orange);
    padding-left: 1rem;
}

.mobile-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.mobile-menu.active .mobile-footer {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.mobile-socials {
    display: flex;
    gap: 2rem;
}

.mobile-socials a {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

@media (max-width: 576px) {
    .mobile-menu-container {
        padding: 6rem 1.5rem 2rem 1.5rem;
    }
    
    .mobile-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ==========================================================================
   ГЕРОЙ-СЕКЦИЯ (HERO)
   ========================================================================== */

.hero-section {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 8rem;
    padding-bottom: 4rem;
    overflow: hidden;
}

/* Геометрия на фоне */
.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.glow-blob {
    position: absolute;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
}

.glow-blue {
    top: 10%;
    right: 5%;
    background-color: var(--accent-blue-glow);
}

.glow-peach {
    bottom: 10%;
    left: -10%;
    background-color: var(--accent-peach-glow);
}

.bg-svg-lines {
    position: absolute;
    top: 50%;
    left: 55%;
    width: 70vw;
    height: 70vw;
    max-width: 900px;
    max-height: 900px;
    transform: translate(-50%, -50%);
    opacity: 0.7;
}

.floating-pyramid {
    position: absolute;
    top: 20%;
    right: 42%;
    width: 140px;
    height: 140px;
    z-index: 2;
}

.left-polygon {
    position: absolute;
    bottom: 25%;
    left: 10%;
    width: 80px;
    height: 80px;
    z-index: 2;
}

/* Ротаторы */
.rotator {
    transform-origin: center;
    animation: rotateClockwise 60s linear infinite;
}

.rotator-reverse {
    transform-origin: center;
    animation: rotateCounterClockwise 80s linear infinite;
}

@keyframes rotateClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateCounterClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-badge {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
    display: inline-block;
    color: var(--text-color);
}

.hero-title {
    font-size: clamp(3rem, 6.5vw, 6.25rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
}

.title-line {
    display: block;
    overflow: hidden;
}

.title-inner {
    display: block;
    transform: translateY(100%);
}

.hero-title .font-serif {
    font-weight: 400;
}

.hero-desc {
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 3.5rem;
}

/* Кнопка */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 2.5rem;
    border: 1px solid var(--text-color);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    background: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.4s var(--ease-out-expo);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-icon {
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
    transition: transform 0.4s var(--ease-out-expo);
}

.btn::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-color);
    transition: transform 0.5s var(--ease-out-expo);
    z-index: 1;
}

.btn:hover {
    color: var(--bg-color);
}

.btn:hover::before {
    transform: translateY(-100%);
}

.btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Правая колонка: портрет в арке */
.hero-visual-col {
    display: flex;
    justify-content: flex-end;
}

.hero-image-wrapper {
    width: 100%;
    max-width: 440px;
    position: relative;
}

.arch-container {
    width: 100%;
    aspect-ratio: 4 / 5.2;
    border-radius: 220px 220px 0 0;
    overflow: hidden;
    background-color: #e5e5e5;
    border: 1px solid rgba(17, 17, 17, 0.05);
    transform: scale(0.9);
    opacity: 0;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.08);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(100%) contrast(1.08);
    transition: transform 1.2s var(--ease-out-expo);
}

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

@media (max-width: 991px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-text-col {
        align-items: center;
    }
    
    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-visual-col {
        justify-content: center;
    }
    
    .hero-image-wrapper {
        max-width: 380px;
    }
    
    .bg-svg-lines {
        left: 50%;
        width: 90vw;
        height: 90vw;
    }
    
    .floating-pyramid {
        top: 15%;
        right: 15%;
    }
}

/* ==========================================================================
   ТРЕХКОЛОНОЧНАЯ НИЖНЯЯ СЕКЦИЯ
   ========================================================================== */

.bottom-section {
    padding: 6rem 0 8rem 0;
    border-top: 1px solid var(--border-color);
}

.bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.grid-col {
    display: flex;
    flex-direction: column;
    padding: 0 3rem;
}

.grid-col:first-child {
    padding-left: 4rem;
}

.grid-col:last-child {
    padding-right: 4rem;
}

.grid-col:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.col-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-color);
    margin-bottom: 3.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.col-num {
    opacity: 0.4;
}

/* Стили колонки услуг */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.service-item {
    display: flex;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(17, 17, 17, 0.05);
    transition: var(--transition-smooth);
}

.service-item:hover {
    border-bottom-color: var(--text-color);
}

.service-icon {
    font-size: 1.25rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 0.25rem;
    transition: transform 0.4s var(--ease-out-expo);
}

.service-item:hover .service-icon {
    transform: rotate(15deg) scale(1.1);
}

.service-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.service-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Стили колонки проектов */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.project-card {
    display: block;
    cursor: none; /* Скрываем стандартный курсор над карточками */
}

.project-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 2.7;
    overflow: hidden;
    margin-bottom: 1.25rem;
    background-color: #e5e5e5;
    border: 1px solid rgba(17, 17, 17, 0.04);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: transform 0.8s var(--ease-out-expo), filter 0.8s var(--ease-out-expo);
}

.project-card:hover .project-img {
    transform: scale(1.06);
    filter: grayscale(0%); /* При ховере плавно возвращаем цвет для интерактивности */
}

.project-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Стили колонки о нас */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.about-footer-link {
    margin-top: 2rem;
}

.future-link {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--text-color);
    transition: gap 0.3s ease;
}

.future-link:hover {
    gap: 2rem;
}

.future-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.future-link:hover .future-arrow {
    transform: translateX(4px);
}

/* Адаптив для экранов до 1400px */
@media (max-width: 1400px) {
    .bottom-section.container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Адаптив для нижней секции */
@media (max-width: 1024px) {
    .bottom-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .grid-col {
        padding: 4rem 2rem !important;
        border-right: none !important;
    }

    .grid-col:not(:last-child) {
        border-bottom: 1px solid var(--border-color);
    }

    .grid-col:first-child {
        padding-left: 2rem !important;
        padding-top: 0 !important;
    }

    .grid-col:last-child {
        padding-right: 2rem !important;
        padding-bottom: 0 !important;
    }
    
    .col-title {
        margin-bottom: 2rem;
    }
    
    .project-img-wrap {
        aspect-ratio: 16 / 9;
    }
}

/* ==========================================================================
   ПОДВАЛ (FOOTER)
   ========================================================================== */

.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-socials {
    display: flex;
    gap: 2.5rem;
}

.footer-socials a {
    letter-spacing: 0.1em;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-socials a:hover {
    color: var(--text-color);
}

@media (max-width: 576px) {
    .grid-col {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .grid-col:first-child {
        padding-left: 1.25rem !important;
    }

    .grid-col:last-child {
        padding-right: 1.25rem !important;
    }

    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-socials {
        gap: 1.5rem;
    }
}

/* ==========================================================================
   ВЫРАВНИВАНИЯ И АНИМАЦИИ ScrollTrigger
   ========================================================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
}

/* ==========================================================================
   АДАПТИВ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ (ДО 380PX И НИЖЕ)
   ========================================================================== */

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-section {
        padding-top: 6.5rem;
        padding-bottom: 3rem;
    }

    .hero-title {
        font-size: 2.15rem; /* Оптимальный фиксированный размер для предотвращения переносов длинных слов */
        margin-bottom: 1.75rem;
        line-height: 1.05;
    }

    .hero-desc {
        margin-bottom: 2.25rem;
        font-size: 0.95rem;
    }

    .btn {
        padding: 1rem 2rem;
        width: 100%;
        justify-content: center;
    }

    .hero-image-wrapper {
        max-width: 100%;
    }

    .arch-container {
        border-radius: 160px 160px 0 0;
    }

    .bg-svg-lines {
        width: 100vw;
        height: 100vw;
    }

    .floating-pyramid {
        width: 90px;
        height: 90px;
        top: 20%;
        right: 10%;
    }

    .left-polygon {
        width: 50px;
        height: 50px;
        bottom: 20%;
        left: 5%;
    }

    .bottom-section {
        padding: 4rem 0 5rem 0;
    }

    .grid-col {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .grid-col:first-child {
        padding-left: 1rem !important;
    }

    .grid-col:last-child {
        padding-right: 1rem !important;
    }

    .bottom-grid {
        gap: 3.5rem;
    }

    .col-title {
        margin-bottom: 1.5rem;
    }

    .services-list {
        gap: 1.75rem;
    }

    .service-item {
        gap: 1rem;
        padding-bottom: 1.25rem;
    }

    .projects-list {
        gap: 2rem;
    }

    .about-content {
        gap: 1.25rem;
    }

    .mobile-menu-container {
        padding: 5rem 1rem 1.5rem 1rem;
    }

    .mobile-links {
        gap: 1.5rem;
    }

    .mobile-link {
        font-size: 2rem;
        gap: 1rem;
    }
}

