/* KemiSclicks - Live Animations */

/* ── Keyframes ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33%      { transform: translateY(-12px) rotate(2deg); }
    66%      { transform: translateY(6px) rotate(-1deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.4); }
    50%      { box-shadow: 0 0 40px rgba(118, 75, 162, 0.6); }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes aperture-pulse {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50%      { transform: scale(1.08); opacity: 0.25; }
}

@keyframes ripple {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes count-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-in-left {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes hero-title-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ── Navbar scroll effect ── */
.navbar {
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.navbar .logo-icon {
    transition: transform 0.4s ease;
}

.navbar.scrolled .logo-icon,
.nav-logo:hover .logo-icon {
    transform: rotate(-15deg) scale(1.1);
}

/* ── Hero ── */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #533483, #667eea);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    padding: 120px 0 100px;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.hero-orb-1 {
    width: 300px;
    height: 300px;
    background: #667eea;
    top: -80px;
    left: -60px;
    animation: float 8s ease-in-out infinite;
}

.hero-orb-2 {
    width: 250px;
    height: 250px;
    background: #f093fb;
    bottom: -60px;
    right: -40px;
    animation: float 10s ease-in-out infinite reverse;
}

.hero-orb-3 {
    width: 180px;
    height: 180px;
    background: #4facfe;
    top: 40%;
    right: 15%;
    animation: float 7s ease-in-out infinite 1s;
}

.hero-aperture {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-aperture-1 {
    width: 200px;
    height: 200px;
    top: 15%;
    left: 8%;
    animation: aperture-pulse 6s ease-in-out infinite;
}

.hero-aperture-2 {
    width: 140px;
    height: 140px;
    bottom: 20%;
    right: 10%;
    animation: aperture-pulse 8s ease-in-out infinite 2s;
}

.hero-aperture-3 {
    width: 80px;
    height: 80px;
    top: 60%;
    left: 20%;
    animation: spin-slow 20s linear infinite;
    border-style: dashed;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-badge .live-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-glow 2s ease infinite;
    box-shadow: 0 0 8px #4ade80;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #fff 0%, #e0e7ff 40%, #fff 60%, #c7d2fe 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: hero-title-in 1s ease-out 0.4s both, shimmer 4s linear infinite 1.4s;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.hero-buttons .btn {
    position: relative;
    overflow: hidden;
}

.hero-buttons .btn-primary {
    animation: pulse-glow 3s ease infinite;
}

.hero-buttons .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.hero-buttons .btn:hover::after {
    width: 300px;
    height: 300px;
}

/* ── Live Stats Bar ── */
.live-stats {
    position: relative;
    z-index: 2;
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 1.2s both;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.2rem 2rem;
    text-align: center;
    min-width: 130px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.18);
}

.stat-card .stat-icon {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    display: block;
}

.stat-card .stat-number.counting {
    animation: count-pop 0.4s ease-out;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.3rem;
}

/* ── Scroll Reveal (visible by default; hidden only when JS is active) ── */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

html.js-animations .reveal {
    opacity: 0;
}

.reveal.revealed {
    opacity: 1;
}

html.js-animations .reveal-up    { transform: translateY(40px); }
html.js-animations .reveal-left  { transform: translateX(-40px); }
html.js-animations .reveal-right { transform: translateX(40px); }
html.js-animations .reveal-scale { transform: scale(0.9); }

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
    transform: translate(0);
}

.reveal-scale.revealed {
    transform: scale(1);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.5s; }

/* ── Section headings ── */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.section-title.revealed::after {
    width: 60px;
}

/* ── Feature cards ── */
.feature-item {
    border-radius: 16px;
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 16px;
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
}

.feature-item:hover::before {
    opacity: 1;
}

.feature-item i {
    transition: transform 0.4s ease, color 0.4s ease;
    display: inline-block;
}

.feature-item:hover i {
    transform: scale(1.2) rotate(-5deg);
    color: #667eea;
}

/* ── Photo grid enhancements ── */
.photo-item {
    animation: none;
}

html.js-animations .photo-item.revealed {
    animation: fadeInUp 0.6s ease-out both;
}

.photo-grid.stagger-children .photo-item:nth-child(1)  { animation-delay: 0.05s; }
.photo-grid.stagger-children .photo-item:nth-child(2)  { animation-delay: 0.1s; }
.photo-grid.stagger-children .photo-item:nth-child(3)  { animation-delay: 0.15s; }
.photo-grid.stagger-children .photo-item:nth-child(4)  { animation-delay: 0.2s; }
.photo-grid.stagger-children .photo-item:nth-child(5)  { animation-delay: 0.25s; }
.photo-grid.stagger-children .photo-item:nth-child(6)  { animation-delay: 0.3s; }
.photo-grid.stagger-children .photo-item:nth-child(7)  { animation-delay: 0.35s; }
.photo-grid.stagger-children .photo-item:nth-child(8)  { animation-delay: 0.4s; }
.photo-grid.stagger-children .photo-item:nth-child(9)  { animation-delay: 0.45s; }
.photo-grid.stagger-children .photo-item:nth-child(10) { animation-delay: 0.5s; }
.photo-grid.stagger-children .photo-item:nth-child(11) { animation-delay: 0.55s; }
.photo-grid.stagger-children .photo-item:nth-child(12) { animation-delay: 0.6s; }

/* ── Floating action shimmer on CTA ── */
.btn-outline {
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-outline:hover::before {
    left: 100%;
}

/* ── Page header animation (gallery, about, etc.) ── */
.page-header.reveal-up.revealed h1 {
    background: linear-gradient(135deg, #333, #667eea);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-canvas { display: none; }
    .reveal { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .live-stats { gap: 1rem; }
    .stat-card { min-width: 110px; padding: 1rem 1.2rem; }
    .stat-card .stat-number { font-size: 1.5rem; }
    .hero-aperture, .hero-orb { display: none; }
}
