/* ============================================
   VARIANT DOCK — Tilda-style + macOS Dock Nav
   СИБИРЬКОМЬЮНИТИ
   ============================================ */

/* --- VARIABLES --- */
:root {
    --font: 'Inter', sans-serif;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
    --bg: #09090b;
    --bg-alt: #111114;
    --bg-card: #16161a;
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text: #fafafa;
    --text-2: rgba(255, 255, 255, 0.6);
    --text-3: rgba(255, 255, 255, 0.35);
    --accent: #1f3a8a;
    --accent-light: #2447b1;
    --accent-glow: rgba(90, 92, 240, 0.25);
    --accent-subtle: rgba(99, 102, 241, 0.08);
    --gradient: linear-gradient(-90deg, #1f3a8a, #429210);
    --dock-bg: rgba(20, 20, 24, 0.75);
    --dock-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    --placeholder-bg: linear-gradient(145deg, #1a1a2e, #16161a);
    --input-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #f4f4f5;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --text: #09090b;
    --text-2: rgba(9, 9, 11, 0.6);
    --text-3: rgba(9, 9, 11, 0.35);
    --accent: #1f3a8a;
    --accent-light: #2447b1;
    --accent-glow: rgba(90, 92, 240, 0.25);
    --accent-subtle: rgba(79, 70, 229, 0.06);
    --gradient: linear-gradient(-90deg, #1f3a8a, #429210);
    --dock-bg: rgba(255, 255, 255, 0.8);
    --dock-border: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    --placeholder-bg: linear-gradient(145deg, #f0f0f5, #e8e8ee);
    --input-bg: rgba(0, 0, 0, 0.04);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

a { color: inherit; text-decoration: none; transition: color 0.3s ease; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }

/* --- WIDE CONTAINER (Tilda-style) --- */
.wide {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 60px;
    overflow: hidden;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 60px;
    transition: all 0.3s var(--ease);
    cursor: pointer;
    border: none;
}

.btn--accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn--accent:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn--glass {
    background: var(--bg-glass);
    color: var(--text);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.btn--glass:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.btn--full { width: 100%; }

/* ============================================
   DOCK NAVIGATION (macOS style)
   ============================================ */
.dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.dock__bar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 8px 12px;
    background: var(--dock-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--dock-border);
    border-radius: 22px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dock__separator {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 6px;
    align-self: center;
}

.dock__item {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--text-2);
    transition: all 0.25s var(--ease-bounce);
    transform-origin: bottom center;
}

.dock__item svg {
    width: 22px;
    height: 22px;
    transition: all 0.25s var(--ease-bounce);
}

.dock__item:hover {
    transform: scale(1.4) translateY(-8px);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* Magnify neighbors on hover (CSS-only approximation) */
.dock__item:hover + .dock__item,
.dock__item:has(+ .dock__item:hover) {
    transform: scale(1.15) translateY(-3px);
}

.dock__item.active {
    color: var(--accent);
}

.dock__item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
}

/* Tooltip */
.dock__item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dock__item:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Theme toggle icons */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ============================================
   MOBILE HEADER (replaces dock on small screens)
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 9999;
    background: var(--dock-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
}

.mobile-header__logo-img {
    height: 32px;
    width: auto;
}

.mobile-header__burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    padding: 4px 0;
    background: none;
    border: none;
}

.mobile-header__burger span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-header__burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-header__burger.active span:nth-child(2) {
    opacity: 0;
}
.mobile-header__burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.mobile-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.mobile-nav__link {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    padding: 8px;
    transition: color 0.3s ease;
}

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

.mobile-nav__theme {
    margin-top: 16px;
    padding: 12px 24px;
    border-radius: 60px;
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--accent);
}

/* ============================================
   SECTION BASE
   ============================================ */
.section {
    padding: 140px 0;
    width: 100%;
    overflow: hidden;
}

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

.section__label {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.section__title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 64px;
    letter-spacing: -0.5px;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background: var(--bg);
    z-index: 0;
}

.hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 40%, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.6;
}

.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: 1000px;
    padding: 0 40px;
}

.hero__logo {
    height: 100%;
    margin: 0 auto 40px;
    opacity: 0.8;
    color: #332C3C;
    filter: drop-shadow(1px 1px 1px rgb(49, 102, 76));
}

[data-theme="light"] .hero__logo {
    filter: drop-shadow(1px 1px 1px rgb(49, 102, 76));
}

.hero__title {
    font-size: clamp(36px, 7vw, 72px);
    font-weight: 900;
    line-height: 1.08;
    margin-bottom: 28px;
    letter-spacing: -1px;
}

.hero__title--gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__desc {
    font-size: clamp(15px, 1.8vw, 18px);
    color: var(--text-2);
    max-width: 700px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

.hero__cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 80px;
}

.hero__counters {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.hero__counter {
    text-align: center;
}

.hero__counter-num {
    font-size: clamp(36px, 5vw, 48px);
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline;
}

.hero__counter-plus {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__counter-label {
    display: block;
    font-size: 13px;
    color: var(--text-3);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero__scroll {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--text-3);
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   ABOUT
   ============================================ */
.about__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
    min-width: 0;
}

.about__cols > * {
    min-width: 0;
}

.about__text p {
    font-size: 16px;
    color: var(--text-2);
    margin-bottom: 20px;
    line-height: 1.8;
}

.about__text strong {
    color: var(--text);
}

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

.about__card {
    display: flex;
    gap: 20px;
    padding: 28px;
    border-radius: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.about__card:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.about__card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--accent-subtle);
    color: var(--accent);
}

.about__card-icon svg {
    width: 24px;
    height: 24px;
}

.about__card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.about__card p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.5;
}

/* ============================================
   DIRECTIONS — edge-to-edge scrollable row
   ============================================ */
.directions__row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    width: 100%;
}

.dir-card {
    padding: 48px 32px;
    border-right: 1px solid var(--border);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.dir-card:last-child {
    border-right: none;
}

.dir-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.dir-card:hover::before {
    opacity: 0.06;
}

.dir-card:hover {
    transform: translateY(-4px);
}

.dir-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--accent-subtle);
    color: var(--accent);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.dir-card__icon svg {
    width: 26px;
    height: 26px;
}

.dir-card:hover .dir-card__icon {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 24px var(--accent-glow);
}

.dir-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.dir-card p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* ============================================
   PORTFOLIO — full bleed grid
   ============================================ */
.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100%;
}

.project-card {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
}

.project-card:nth-child(4n) {
    border-right: none;
}

.project-card:nth-last-child(-n+4) {
    border-bottom: none;
}

.project-card:hover {
    z-index: 2;
    box-shadow: var(--card-shadow);
    transform: scale(1.02);
}

.project-card__img {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.project-card__placeholder {
    width: 100%;
    height: 100%;
    background: var(--placeholder-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: all 0.4s ease;
}

.project-card:hover .project-card__placeholder {
    background: var(--accent-subtle);
}

.project-card:hover .project-card__placeholder svg {
    opacity: 0.7;
    transform: scale(1.1);
}

.project-card__placeholder svg {
    transition: all 0.4s ease;
}

.project-card__body {
    padding: 28px 24px;
}

.project-card__tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    border: 1px solid currentColor;
    margin-bottom: 12px;
}

.project-card__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.project-card__desc {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
}

/* ============================================
   CONTACTS
   ============================================ */
.contacts__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
    min-width: 0;
}

.contacts__cols > * {
    min-width: 0;
}

.contacts__info {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contacts__row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.contacts__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--accent-subtle);
    color: var(--accent);
}

.contacts__icon svg {
    width: 24px;
    height: 24px;
}

.contacts__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    margin-bottom: 4px;
}

.contacts__value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    transition: color 0.3s ease;
    word-break: break-word;
}

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

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

.contacts__input {
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.contacts__input::placeholder {
    color: var(--text-3);
}

.contacts__input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.contacts__textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 80px 0 40px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer__logo {
    height: 36px;
    margin-bottom: 16px;
}

.footer__brand p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    max-width: 300px;
}

.footer__col h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.footer__col a {
    display: block;
    font-size: 14px;
    color: var(--text-2);
    padding: 4px 0;
    transition: color 0.3s ease;
}

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

.footer__bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer__bottom p {
    font-size: 13px;
    color: var(--text-3);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.anim {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.anim.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .directions__row {
        grid-template-columns: repeat(3, 1fr);
    }

    .dir-card:nth-child(3) {
        border-right: none;
    }

    .dir-card:nth-child(3n) {
        border-right: none;
    }

    .portfolio__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-card:nth-child(2n) {
        border-right: none;
    }

    .project-card:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    /* Hide dock, show mobile header */
    .dock {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

    html {
        scroll-padding-top: 64px;
    }

    .section {
        padding: 80px 0;
    }

    .section__title {
        margin-bottom: 40px;
    }

    .wide {
        padding: 0 20px;
    }

    .hero__content {
        padding: 80px 20px 0;
    }

    .hero__scroll {
        bottom: 30px;
    }

    .hero__counters {
        gap: 24px;
    }

    .hero__cta {
        margin-bottom: 48px;
    }

    .about__cols {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    .dir-card {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .dir-card:last-child {
        border-bottom: none;
    }

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

    .project-card {
        border-right: none;
    }

    .project-card:last-child {
        border-bottom: none;
    }

    .contacts__cols {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 480px) {
    .wide {
        padding: 0 16px;
    }

    .hero__content {
        padding: 72px 16px 0;
    }

    .hero__cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        padding: 14px 28px;
        font-size: 14px;
    }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

::selection {
    background: var(--accent);
    color: #fff;
}
