/* ===================== ШРИФТ JINDO ===================== */
@font-face {
    font-family: 'Jindo';
    src: url('../fonts/Jindo Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}

/* Базовые настройки */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #050505;
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #050505;
}
::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: #333333;
}


/* ===================== SCROLL REVEAL ===================== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

/* ===================== АНИМАЦИЯ ПОЯВЛЕНИЯ ===================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fade-in-delay-1 { animation-delay: 0.15s; }
.fade-in-delay-2 { animation-delay: 0.3s; }
.fade-in-delay-3 { animation-delay: 0.45s; }

/* ===================== ПУЛЬСИРОВАНИЕ ФОНА ===================== */
@keyframes pulseSlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}
.animate-pulse-slow {
    animation: pulseSlow 8s ease-in-out infinite;
}

/* ===================== HEADER SHRINK ===================== */
/*
   Высота зафиксирована через JS (offsetHeight при загрузке).
   overflow: hidden обрезает боковые элементы при сжатии.
   Анимируется ТОЛЬКО max-width — никаких вертикальных свойств.
*/

#top-header {
    overflow: hidden;
    transition: max-width 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.ferz-wordmark,
.header-right-group {
    flex-shrink: 0;
    white-space: nowrap;
    transition: opacity 0.25s ease 0.48s;
}

#top-header nav {
    z-index: 10;
}

#top-header.header-shrunk {
    max-width: 460px;
}

#top-header.header-shrunk .ferz-wordmark,
#top-header.header-shrunk .header-right-group {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease 0s;
}

/* ===================== NAV LINKS ===================== */
.nav-link {
    position: relative;
    color: white;
    transition: color 0.3s ease;
    text-decoration: none;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: white;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link:hover {
    color: rgba(255,255,255,0.7);
}
.nav-link:hover::after {
    width: 100%;
}

/* ===================== СЕРВИСНЫЕ ТАБЫ ===================== */
.service-content {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}
.service-content.active {
    display: block;
    opacity: 1;
    position: relative;
    transform: translateY(0);
    top: auto;
}

.service-tab {
    transition: color 0.3s, background 0.3s;
}
.service-tab:hover {
    color: white !important;
}

/* ===================== FAQ ===================== */
.faq-button.active .faq-icon {
    transform: rotate(180deg);
}
.faq-item {
    transition: border-color 0.3s;
}
.faq-item:hover {
    border-color: rgba(255,255,255,0.08);
}
.faq-button.active {
    color: white;
}
.faq-item.faq-open {
    border-left: 2px solid rgba(255,255,255,0.15);
}

/* ===================== КАРТОЧКИ ПРОЦЕССА ===================== */
.process-card-anim {
    transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.5s, border-color 0.5s, opacity 0.5s, box-shadow 0.5s;
}
.process-card-anim:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}

/* ===================== FLYWHEEL ANIMATION ===================== */
@keyframes flowDown {
    0% { top: -20%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.animate-flow {
    height: 40%;
    animation: flowDown 3s infinite linear;
}

/* ===================== FROSTED GLASS ===================== */
.team-card,
.process-card-anim,
.faq-item,
.glass-card {
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.glass-card {
    background: rgba(10, 10, 10, 0.7) !important;
}

.process-card-anim {
    background: rgba(5, 5, 5, 0.7) !important;
}

.faq-item {
    background: rgba(10, 10, 10, 0.7) !important;
}

/* ===================== TEAM CARDS ===================== */
.team-card {
    position: relative;
    background: rgba(10, 10, 10, 0.7) !important;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.45s, box-shadow 0.45s, transform 0.45s;
}
.team-card:hover {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    transform: translateY(-4px);
}

/* Spotlight */
.team-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 2;
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.05), transparent 50%);
}
.team-card:hover .team-spotlight { opacity: 1; }

/* Слайдер — горизонтальный, 200% ширины карточки */
.team-slider {
    display: flex;
    width: 200%;
    transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
.team-slider.flipped {
    transform: translateX(-50%);
}

/* Передняя и задняя панели — каждая 50% слайдера = 100% карточки */
.team-front,
.team-back {
    width: 50%;
    flex-shrink: 0;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}
.team-back {
    align-items: flex-start;
    text-align: left;
}

/* Аватарка (большая, фронт) */
.team-avatar-ring {
    position: relative;
    width: 82px;
    height: 82px;
    flex-shrink: 0;
    margin-bottom: 1.1rem;
}
.team-avatar-ring::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 8px;
    background: conic-gradient(rgba(255,255,255,0.18) 0deg, transparent 120deg, rgba(255,255,255,0.06) 240deg, transparent 360deg);
    opacity: 0;
    transition: opacity 0.5s, transform 0.6s;
    transform: rotate(0deg);
}
.team-card:hover .team-avatar-ring::before { opacity: 1; transform: rotate(90deg); }

.team-avatar {
    width: 82px;
    height: 82px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #1e1e1e;
    transition: border-color 0.4s;
    position: relative;
    z-index: 1;
    display: block;
}
.team-card:hover .team-avatar { border-color: rgba(255,255,255,0.18); }

/* Аватарка маленькая (бэк) */
.team-avatar-sm {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid #262626;
    flex-shrink: 0;
    display: block;
}

/* Имя и роль */
.team-name {
    font-weight: 700;
    color: white;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.team-role-label {
    font-size: 0.67rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Бэк: шапка с маленькой аватаркой + имя */
.team-back-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    width: 100%;
}

/* Бэк: текст био */
.team-back-bio {
    font-size: 0.8rem;
    color: #777;
    line-height: 1.7;
    flex: 1;
    width: 100%;
}

/* Бэк: иконки соцсетей */
.team-back-socials {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.1rem;
    margin-bottom: 1rem;
}

/* Иконки соцсетей */
.team-social-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #111;
    border: 1px solid #262626;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}
.team-social-icon:hover {
    background: white;
    color: black;
    border-color: white;
    transform: translateY(-2px);
}

/* Кнопка "View more" (фронт) */
.team-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 1.25rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: #444;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.04em;
    transition: color 0.3s;
}
.team-card:hover .team-open-btn { color: #888; }
.team-open-btn svg { transition: transform 0.3s; }
.team-open-btn:hover svg { transform: translateX(3px); }

/* Кнопка "Back" (бэк) */
.team-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: #444;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.04em;
    padding: 0;
    transition: color 0.3s;
}
.team-close-btn:hover { color: #888; }
.team-close-btn svg { transition: transform 0.3s; }
.team-close-btn:hover svg { transform: translateX(-3px); }

/* ===================== SCROLL PROGRESS ===================== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: white;
    z-index: 9999;
    transition: width 0.1s linear;
    transform-origin: left;
    box-shadow: 0 0 8px rgba(255,255,255,0.6);
}

/* ===================== BACK TO TOP ===================== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #111;
    border: 1px solid #262626;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.25s,
                color 0.25s,
                border-color 0.25s;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#back-to-top:hover {
    background: white;
    color: black;
    border-color: white;
}

/* ===================== HOVER НА КАРТОЧКАХ VISION ===================== */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

/* ===================== WORDMARK ===================== */
.ferz-wordmark {
    font-family: 'Jindo', serif;
    font-weight: 500;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0.12em;
    color: white;
    text-decoration: none;
}
.ferz-wordmark:hover {
    opacity: 0.75;
}

/* ===================== HERO CTA BUTTONS ===================== */
.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: white;
    color: black;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 0 0 rgba(255,255,255,0.2);
}
.hero-cta-primary:hover {
    background: rgba(255,255,255,0.7);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255,255,255,0.12);
}
.hero-cta-primary svg {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-cta-primary:hover svg {
    transform: translateX(4px);
}

.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.75rem;
    background: transparent;
    color: white;
    border: 1px solid #262626;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.hero-cta-secondary:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.04);
    transform: translateY(-2px);
}

/* ===================== SERVICE SHIMMER ===================== */
@keyframes shimmerSweep {
    0%   { transform: translateX(-120%) skewX(-12deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(220%) skewX(-12deg); opacity: 0; }
}

.service-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 35%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.045), transparent);
    pointer-events: none;
    z-index: 5;
    transform: translateX(-120%) skewX(-12deg);
}
.group:hover .service-shimmer {
    animation: shimmerSweep 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ===================== MOBILE MENU ===================== */
#mobile-menu {
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
#mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    transform: translateY(12px);
    opacity: 0;
    transition: color 0.3s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s;
}
#mobile-menu.open .mobile-nav-link {
    color: white;
    transform: translateY(0);
    opacity: 1;
}
#mobile-menu.open .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-nav-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-nav-link:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-nav-link:nth-child(6) { transition-delay: 0.32s; }
.mobile-nav-link:hover {
    color: rgba(255,255,255,0.6);
}

/* Burger animation */
#burger-btn.open .burger-line:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
#burger-btn.open .burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#burger-btn.open .burger-line:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ===================== CONTACT SECTION ===================== */
.contact-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 2rem;
    background: white;
    color: black;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.contact-btn-primary:hover {
    background: rgba(255,255,255,0.7);
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(255,255,255,0.12);
}

.contact-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: transparent;
    color: white;
    border: 1px solid #262626;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.contact-btn-secondary:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.04);
    transform: translateY(-2px);
}
