/* ============================================
   ROOT COLORS
============================================ */
:root {
    --blue-primary: #1481BA;
    --blue-secondary: #33A7DD;
    --blue-light: #dbe9f0;
    --blue-bg: #d2e0e7;
    --blue-gradient: linear-gradient(135deg, #1481BA, #33A7DD);
    --blue-dark: #0D5F8A;
    --text-dark: #1A2332;
    --text-gray: #64748B;
    --white: #FFFFFF;
    --shadow: rgba(20, 129, 186, 0.15);
}

/* ============================================
   RESET & BASE
============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

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

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #e8edf2; }
::-webkit-scrollbar-thumb { background: var(--blue-primary); border-radius: 15px; }

/* ============================================
   TYPOGRAPHY
============================================ */
.blue-primary { color: var(--blue-primary); }
.blue-secondary { color: var(--blue-secondary); }

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

.serif { font-family: 'Playfair Display', serif; }

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 12px;
}
.section-title .blue-primary { font-weight: 600; }

.section-subtitle {
    text-align: center;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 48px;
    letter-spacing: 1px;
}

.ornament {
    text-align: center;
    font-size: 0.5rem;
    color: var(--blue-primary);
    letter-spacing: 8px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ============================================
   ИНЛАЙН-ИКОНКИ (замена Font Awesome)
============================================ */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    flex-shrink: 0;
}
.icon-bars { display: inline-block; transition: 0.3s; }
.icon-times { display: none; transition: 0.3s; }
.mobile-menu-btn.active .icon-bars { display: none; }
.mobile-menu-btn.active .icon-times { display: inline-block; }

/* ============================================
   CANVAS ДЛЯ ПУЗЫРЬКОВ ПО КЛИКУ
============================================ */
#clickBubblesCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 16px 44px;
    border: none;
    cursor: pointer;
    transition: all 0.4s ease;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-radius: 4px;
    text-align: center;
}

.btn-primary {
    background: var(--blue-gradient);
    color: var(--white);
    box-shadow: 0 4px 30px rgba(20, 129, 186, 0.25);
    border: 2px solid transparent;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 50px rgba(20, 129, 186, 0.35);
    border-color: var(--blue-secondary);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    border-color: var(--white);
}

.btn-service {
    background: transparent;
    color: var(--blue-primary);
    border: 1px solid rgba(20, 129, 186, 0.15);
    padding: 12px 32px;
    font-size: 0.7rem;
    letter-spacing: 2px;
    margin-top: 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.btn-service:hover {
    background: rgba(20, 129, 186, 0.04);
    border-color: var(--blue-primary);
    border-width: 2px;
}

/* ============================================
   HEADER
============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    transition: all 0.4s ease;
}
.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    padding: 14px 0;
    border-bottom: 1px solid rgba(20, 129, 186, 0.04);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.header .logo-img { filter: brightness(0) invert(1); transition: 0.4s; }
.header.scrolled .logo-img { filter: none; }

.header .logo-text { color: rgba(255, 255, 255, 0.8); transition: 0.4s; }
.header.scrolled .logo-text { color: var(--text-gray); }

.header .nav a { color: rgba(255, 255, 255, 0.7); transition: 0.4s; }
.header.scrolled .nav a { color: var(--text-gray); }
.header .nav a:hover { color: var(--white); }
.header.scrolled .nav a:hover { color: var(--blue-primary); }

.header .phone-link { color: rgba(255, 255, 255, 0.9); transition: 0.4s; }
.header.scrolled .phone-link { color: var(--blue-primary); }
.header .phone-link:hover { color: var(--white); }
.header.scrolled .phone-link:hover { color: var(--blue-secondary); }

.header .social-icons a { opacity: 0.5; }
.header .social-icons a:hover { opacity: 0.8; }
.header .social-icons img { transition: 0.4s; }
.header.scrolled .social-icons img { filter: none; }

.header .mobile-menu-btn { color: var(--white); }
.header.scrolled .mobile-menu-btn { color: var(--text-dark); }
.header .mobile-menu-btn:hover { color: var(--white); border-color: rgba(255, 255, 255, 0.1); }
.header.scrolled .mobile-menu-btn:hover { color: var(--blue-primary); border-color: rgba(20, 129, 186, 0.1); }

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.logo-img { height: 38px; }
.logo-text {
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 1px;
    max-width: 200px;
    line-height: 1.3;
}

.nav { display: flex; gap: 32px; align-items: center; }
.nav a {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: 0.3s;
    position: relative;
    padding: 4px 0;
}
.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--blue-gradient);
    transition: 0.3s;
}
.nav a:hover::after { width: 100%; }

.header-contacts {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.phone-link {
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: 0.3s;
}

.social-icons { display: flex; gap: 12px; align-items: center; }
.social-icons a {
    transition: 0.3s;
    display: flex;
    align-items: center;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 4px;
}
.social-icons a:hover { border-color: rgba(255, 255, 255, 0.1); }
.header.scrolled .social-icons a:hover { border-color: rgba(20, 129, 186, 0.1); }
.social-icons img { height: 18px; width: 18px; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: 2px solid transparent;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 10px;
    transition: 0.3s;
    z-index: 1001;
    border-radius: 8px;
}


/* ============================================
   MOBILE MENU
============================================ */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 340px;
    max-width: 85%;
    height: 100%;
    background: var(--white);
    z-index: 999;
    padding: 80px 32px 40px;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 3px solid var(--blue-primary);
}
.mobile-menu-panel.active { right: 0; }

.mobile-menu-panel .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: 2px solid transparent;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px 10px;
    transition: 0.3s;
    border-radius: 8px;
}
.mobile-menu-panel .close-btn:hover {
    color: var(--blue-primary);
    transform: rotate(90deg);
    border-color: rgba(20, 129, 186, 0.1);
}

.mobile-menu-panel .mobile-logo {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(20, 129, 186, 0.04);
}
.mobile-menu-panel .mobile-logo img { height: 36px; }
.mobile-menu-panel .mobile-logo .logo-text {
    font-size: 0.7rem;
    color: var(--text-gray);
    margin-top: 4px;
}

.mobile-menu-panel .mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.mobile-menu-panel .mobile-nav a {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dark);
    padding: 14px 18px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.mobile-menu-panel .mobile-nav a:hover,
.mobile-menu-panel .mobile-nav a.active {
    background: var(--blue-bg);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
    font-weight: 600;
}

.mobile-menu-panel .mobile-contacts {
    padding-top: 20px;
    border-top: 1px solid rgba(20, 129, 186, 0.04);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mobile-menu-panel .mobile-contacts .phone-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--blue-primary);
    padding: 8px 0;
    display: inline-block;
}
.mobile-menu-panel .mobile-contacts .phone-link:hover { color: var(--blue-secondary); }
.mobile-menu-panel .mobile-contacts .social-icons { gap: 16px; }
.mobile-menu-panel .mobile-contacts .social-icons a {
    opacity: 0.3;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 6px;
    transition: 0.3s;
}
.mobile-menu-panel .mobile-contacts .social-icons a:hover {
    opacity: 0.8;
    border-color: rgba(20, 129, 186, 0.1);
}
.mobile-menu-panel .mobile-contacts .social-icons img { height: 22px; width: 22px; }

/* ============================================
   FOOTER
============================================ */
.footer {
    padding: 60px 0 40px;
    background: #0f172a;
    border-top: 1px solid rgba(20,129,186,0.02);
    position: relative;
}
.footer .logo-text { color: #94a3b8; }
.footer .logo-img { filter: brightness(0) invert(1); }

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.footer-brand .logo { margin-bottom: 16px; }
.footer-brand .logo .logo-text { max-width: 280px; font-size: 0.75rem; color: #94a3b8; }

.footer-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-nav a {
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #64748b;
    transition: 0.3s;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}
.footer-nav a:hover { color: var(--blue-secondary); border-bottom-color: var(--blue-secondary); }

.footer-contacts { text-align: right; }
.footer-contacts .phone-link {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 12px;
    color: var(--blue-secondary);
}
.footer-contacts .social-icons { justify-content: flex-end; }
.footer-contacts .social-icons img { opacity: 0.6; }
.footer-contacts .social-icons a {
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 4px;
    transition: 0.3s;
}
.footer-contacts .social-icons a:hover img { opacity: 0.8; }
.footer-contacts .social-icons a:hover { border-color: rgba(255,255,255,0.05); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 32px;
    padding-top: 24px;
    font-size: 0.7rem;
    color: #64748b;
    letter-spacing: 0.5px;
}
.footer-bottom a { color: #94a3b8; transition: 0.3s; border-bottom: 1px solid transparent; }
.footer-bottom a:hover { color: var(--blue-secondary); border-bottom-color: var(--blue-secondary); }

/* ============================================
   BACK TO TOP
============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--white);
    border: 2px solid var(--blue-primary);
    color: var(--blue-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover {
    background: var(--blue-primary);
    color: var(--white);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 30px rgba(20,129,186,0.25);
    border-color: var(--blue-secondary);
}


/* ============================================
   ВОДЯНАЯ ЛИНИЯ ПОД ШАПКОЙ (только при скролле)
============================================ */
.header-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 8px;                    /* тонко */
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.7s ease;
    overflow: visible;
}
.header.scrolled .header-wave { opacity: 1; }

.header-wave svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Волна — полупрозрачная, как плёнка воды */
.header-wave .wave-fill   { fill: rgba(51, 167, 221, 0.28); }
.header-wave .wave-fill-2 { fill: rgba(20, 129, 186, 0.20); }
.header-wave .wave-fill-3 { fill: rgba(20, 129, 186, 0.10); }

/* Очень лёгкое «дыхание» каждой волны */
.header-wave svg path:nth-child(1) {
    animation: headerWaveBreath 6s ease-in-out infinite;
    transform-origin: center;
}
.header-wave svg path:nth-child(2) {
    animation: headerWaveBreath 7.5s ease-in-out infinite reverse;
    animation-delay: 0.5s;
}
.header-wave svg path:nth-child(3) {
    animation: headerWaveBreath 9s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes headerWaveBreath {
    0%   { transform: translateX(0)    scaleY(1); }
    50%  { transform: translateX(-6px) scaleY(1.25); }
    100% { transform: translateX(0)    scaleY(1); }
}

/* Тонкая переливающаяся «искорка» по линии */
.header-wave::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(51, 167, 221, 0.25) 25%,
        rgba(51, 167, 221, 0.65) 50%,
        rgba(51, 167, 221, 0.25) 75%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: headerLineFlow 6s linear infinite;
    pointer-events: none;
}

@keyframes headerLineFlow {
    0%   { background-position:   0% 50%; }
    100% { background-position: 220% 50%; }
}

/* Едва заметное свечение вниз — влажный блеск */
.header-wave::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 6px;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(51, 167, 221, 0.18) 0%,
        rgba(51, 167, 221, 0.06) 45%,
        transparent 80%
    );
    pointer-events: none;
    animation: headerWaveGlow 5s ease-in-out infinite alternate;
}

@keyframes headerWaveGlow {
    0%   { opacity: 0.5; }
    100% { opacity: 0.9; }
}

/* ============================================
   RESPONSIVE (общие правила)
============================================ */
@media (max-width: 992px) {
    .footer-inner { flex-direction: column; align-items: center; text-align: center; }
    .footer-contacts { text-align: center; }
    .footer-contacts .social-icons { justify-content: center; }
    .footer-nav { justify-content: center; }
    .footer-brand .logo { justify-content: center; }
}

@media (max-width: 768px) {
    .nav, .header-contacts { display: none; }
    .mobile-menu-btn { display: block; }
    .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 480px) {
    .logo-text { display: none; }
    .mobile-menu-panel { padding: 70px 20px 30px; width: 300px; }
}