/* ============================================
   휴벤텍 커스텀 스타일 & 애니메이션
   ============================================ */

/* --- 스크롤 트리거 애니메이션 --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fade-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-fade-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fade-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-scale-up {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-scale-up.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* --- 스태거 딜레이 (자식 요소) --- */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.5s; }
.stagger-children > *:nth-child(7) { transition-delay: 0.6s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.7s; }
.stagger-children > *:nth-child(9) { transition-delay: 0.8s; }
.stagger-children > *:nth-child(10) { transition-delay: 0.9s; }

/* --- 히어로 그라데이션 시프트 --- */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-gradient {
    background: linear-gradient(-45deg, #0F4C81, #0A3560, #1A7A5C, #14614A);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* --- 떠다니는 장식 요소 --- */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-25px) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(-2deg); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-40px) rotate(5deg); }
}

@keyframes floatReverse {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(30px) rotate(-3deg); }
}

.float-animation { animation: float 6s ease-in-out infinite; }
.float-animation-slow { animation: floatSlow 8s ease-in-out infinite; }
.float-animation-reverse { animation: floatReverse 7s ease-in-out infinite; }

/* --- 펄스 링 (CTA 버튼) --- */
@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid currentColor;
    animation: pulseRing 2s ease-out infinite;
}

/* --- 타임라인 라인 드로우 --- */
@keyframes drawLine {
    from { height: 0; }
    to { height: 100%; }
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, #0F4C81, #1A7A5C);
    transform: translateX(-50%);
}

.timeline-line.is-visible {
    animation: drawLine 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 모바일 타임라인 */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }
}

/* --- 카운터 스케일 인 --- */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.counter-animate {
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- 슬라이드 인 (플래시 메시지) --- */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- 카드 호버 효과 --- */
.card-hover {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(15, 76, 129, 0.15);
}

/* --- 장비 카드 플립 효과 --- */
.equipment-card {
    perspective: 1000px;
}

.equipment-card-inner {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
}

.equipment-card:hover .equipment-card-inner {
    transform: rotateY(5deg) scale(1.02);
}

/* --- 아코디언 --- */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-content.is-open {
    max-height: 500px;
}

/* --- 네비게이션 스크롤 상태 --- */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-scrolled .nav-logo-text {
    color: #0F4C81 !important;
}

.nav-scrolled .nav-logo-sub {
    color: #94a3b8 !important;
}

.nav-scrolled .nav-menu-text {
    color: #334155 !important;
}

.nav-scrolled .nav-menu-text:hover {
    color: #0F4C81 !important;
}

/* --- 프로그레스 바 --- */
@keyframes progressBar {
    from { width: 0; }
}

.progress-bar {
    animation: progressBar 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- 그리드 패턴 배경 --- */
.grid-pattern {
    background-image:
        linear-gradient(rgba(15, 76, 129, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 76, 129, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* --- 글래스모피즘 --- */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- 분자 구조 장식 SVG 회전 --- */
@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-slow { animation: spinSlow 30s linear infinite; }

/* --- 타이핑 효과 커서 --- */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: #E8A838;
    font-weight: 100;
}

/* --- 스크롤바 커스텀 --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* --- 부드러운 스크롤 --- */
html {
    scroll-behavior: smooth;
}

/* --- 선택 영역 색상 --- */
::selection {
    background: rgba(15, 76, 129, 0.2);
    color: #0F4C81;
}
