@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: #000; color: #fff; font-family: system-ui, -apple-system, sans-serif; overflow-x: hidden; -webkit-font-smoothing: antialiased; }

/* PRELOADER */
.preloader { position: fixed; inset: 0; z-index: 9999; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity 0.6s, visibility 0.6s; }
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-text { font-family: 'Instrument Serif', serif; font-size: 2.5rem; color: #fff; animation: preloaderPulse 1.2s ease-in-out infinite; }
@keyframes preloaderPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* CUSTOM CURSOR */
.cursor-dot { width: 8px; height: 8px; background: #fff; border-radius: 50%; position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9998; transition: transform 0.15s; mix-blend-mode: difference; }
.cursor-ring { width: 40px; height: 40px; border: 1.5px solid rgba(255,255,255,0.5); border-radius: 50%; position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9997; transition: width 0.3s, height 0.3s, border-color 0.3s; mix-blend-mode: difference; }
.cursor-ring.hover { width: 60px; height: 60px; border-color: #fff; }
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* LIQUID GLASS */
.liquid-glass {
    background: rgba(255,255,255,0.01);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: none;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.15);
    position: relative; overflow: hidden;
}
.liquid-glass::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.4px;
    background: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 20%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.15) 80%, rgba(255,255,255,0.45) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

/* FADE-IN ANIMATIONS */
.fade-in { opacity: 0; transform: translateY(24px); transition: all 0.8s cubic-bezier(0.16,1,0.3,1); }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-left { opacity: 0; transform: translateX(-30px); transition: all 0.8s cubic-bezier(0.16,1,0.3,1); }
.fade-left.visible { opacity: 1; transform: translateX(0); }
.fade-right { opacity: 0; transform: translateX(30px); transition: all 0.8s cubic-bezier(0.16,1,0.3,1); }
.fade-right.visible { opacity: 1; transform: translateX(0); }

/* HERO VIDEO */
#hero-video {
    transition: opacity 1.2s ease-in-out;
    filter: contrast(1.1) brightness(0.8) saturate(1.2) blur(2px);
    transform: scale(1.05);
}

/* PHOTO MASK */
.photo-mask {
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* PARALLAX */
.parallax-img { transition: transform 0.1s linear; will-change: transform; }

/* MARQUEE */
.marquee-wrap { overflow: hidden; white-space: nowrap; border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); padding: 28px 0; }
.marquee-track { display: inline-flex; animation: marqueeScroll 20s linear infinite; }
.marquee-track span { font-family: 'Instrument Serif', serif; font-size: 1.5rem; color: rgba(255,255,255,0.15); margin-right: 3rem; font-style: italic; }
@keyframes marqueeScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* STATS */
.stat-number { font-family: 'Instrument Serif', serif; font-size: 4rem; line-height: 1; }

/* PROCESS TIMELINE */
.process-line { position: relative; }
.process-line::before { content: ''; position: absolute; top: 24px; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.1); }
.process-step { position: relative; z-index: 1; }
.process-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4); margin-bottom: 24px; transition: background 0.3s; }
.process-step:hover .process-dot { background: #fff; }

/* FAQ ACCORDION */
.faq-item { border-bottom: 1px solid rgba(255,255,255,0.05); }
.faq-question { width: 100%; text-align: left; background: none; border: none; color: #fff; padding: 24px 0; font-size: 1.1rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-question:hover { color: rgba(255,255,255,0.8); }
.faq-icon { transition: transform 0.3s; font-size: 1.5rem; color: rgba(255,255,255,0.3); }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s; padding: 0 0; }
.faq-item.active .faq-answer { max-height: 300px; padding: 0 0 24px 0; }

/* BEFORE/AFTER SLIDER */
.ba-container { position: relative; overflow: hidden; border-radius: 1.5rem; aspect-ratio: 16/9; cursor: col-resize; }
.ba-before, .ba-after { position: absolute; inset: 0; }
.ba-before { z-index: 2; overflow: hidden; width: 50%; }
.ba-before img, .ba-after img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.ba-after { z-index: 1; }
.ba-handle { position: absolute; top: 0; bottom: 0; width: 4px; background: #fff; z-index: 3; left: 50%; transform: translateX(-50%); }
.ba-handle::after { content: '⟷'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; color: #000; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.ba-label { position: absolute; top: 16px; padding: 4px 16px; border-radius: 999px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; z-index: 4; }
.ba-label-before { left: 16px; background: rgba(255,255,255,0.15); color: #fff; }
.ba-label-after { right: 16px; background: rgba(255,255,255,0.9); color: #000; }

/* TECH STACK */
.tech-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; border-radius: 1rem; transition: background 0.3s; }
.tech-item:hover { background: rgba(255,255,255,0.05); }
.tech-item span { font-size: 0.75rem; color: rgba(255,255,255,0.4); }

/* CONTACT FORM */
.form-input { width: 100%; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 1rem; padding: 16px 20px; color: #fff; font-size: 0.95rem; outline: none; transition: border-color 0.3s; }
.form-input:focus { border-color: rgba(255,255,255,0.3); }
.form-input::placeholder { color: rgba(255,255,255,0.25); }
textarea.form-input { resize: vertical; min-height: 120px; }

/* MOBILE MENU */
.mobile-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.95); backdrop-filter: blur(20px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; opacity: 0; visibility: hidden; transition: all 0.4s; }
.mobile-overlay.active { opacity: 1; visibility: visible; }
.mobile-overlay a { font-family: 'Instrument Serif', serif; font-size: 2.5rem; color: #fff; text-decoration: none; opacity: 0.6; transition: opacity 0.3s; }
.mobile-overlay a:hover { opacity: 1; }
.burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; z-index: 101; }
.burger span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: all 0.3s; }
.burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }
@media (max-width: 768px) { .burger { display: block; } .desktop-nav { display: none !important; } }

/* BACK TO TOP */
.back-to-top { position: fixed; bottom: 32px; right: 32px; z-index: 90; width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.back-to-top.visible { opacity: 1; visibility: visible; }

/* PREVIEW MODAL */
.preview-modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.92); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.4s; padding: 40px; }
.preview-modal.active { opacity: 1; visibility: visible; }
.preview-frame-wrap { position: relative; width: 100%; max-width: 900px; height: 85vh; border-radius: 1.5rem; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 0 60px rgba(0,0,0,0.5); }
.preview-frame-wrap iframe { width: 100%; height: 100%; border: none; background: #000; }
.preview-close { position: absolute; top: -50px; right: 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.preview-close:hover { background: rgba(255,255,255,0.2); }
.preview-title { position: absolute; top: -46px; left: 0; color: #fff; font-size: 1rem; font-weight: 500; }
.preview-tag { color: rgba(255,255,255,0.4); font-size: 0.7rem; display: block; margin-top: 2px; }

/* PORTFOLIO GRID */
.port-card { border-radius: 1.25rem; overflow: hidden; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); transition: border-color 0.4s, transform 0.4s; cursor: pointer; }
.port-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-4px); }
.port-card video, .port-card .anim-bg { width: 100%; aspect-ratio: 16/10; object-fit: cover; transition: transform 0.6s; }
.port-card:hover video, .port-card:hover .anim-bg { transform: scale(1.05); }
.port-meta { padding: 16px 20px; }
.port-title { font-size: 1rem; color: #fff; font-weight: 500; margin-bottom: 4px; }
.port-tag { font-size: 0.65rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.12em; }
.port-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.6rem; color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.08); }

/* CSS ANIMATED BACKGROUNDS */
.anim-bg { display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.anim-bg-1 { background: linear-gradient(135deg, #0a0a2e, #1a0a3e, #0a1a3e); animation: shimmer1 6s ease-in-out infinite; }
.anim-bg-2 { background: linear-gradient(135deg, #1a0a0a, #2a1a0a, #1a0a1a); animation: shimmer2 8s ease-in-out infinite; }
.anim-bg-3 { background: linear-gradient(135deg, #0a1a0a, #0a2a1a, #1a2a0a); animation: shimmer3 7s ease-in-out infinite; }
.anim-bg-4 { background: linear-gradient(135deg, #1a1a2e, #0a0a1e, #2a1a3e); animation: shimmer4 5s ease-in-out infinite; }
@keyframes shimmer1 { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes shimmer2 { 0%,100% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(30deg); } }
@keyframes shimmer3 { 0%,100% { filter: brightness(0.8); } 50% { filter: brightness(1.2); } }
@keyframes shimmer4 { 0%,100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }
.anim-bg .anim-text { font-family: 'Instrument Serif', serif; font-size: 1.8rem; color: rgba(255,255,255,0.15); text-align: center; line-height: 1.2; z-index: 1; padding: 20px; }
.anim-bg .anim-orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.4; animation: orbFloat 8s ease-in-out infinite; }
@keyframes orbFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px,-20px) scale(1.2); } }

/* RESPONSIVE */
@media (max-width: 768px) {
    .stat-number { font-size: 2.5rem; }
    .hero-title { font-size: 3.5rem !important; }
    .section-title { font-size: 2.2rem !important; }
}
