/* ========== BASE & RESET ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ========== REVEAL ANIMATIONS (progressive enhancement) ========== */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-active .reveal {
    opacity: 0;
    transform: translateY(32px);
}

.js-active .reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.js-active .reveal:nth-child(2) { transition-delay: 80ms; }
.js-active .reveal:nth-child(3) { transition-delay: 160ms; }
.js-active .reveal:nth-child(4) { transition-delay: 240ms; }
.js-active .reveal:nth-child(5) { transition-delay: 320ms; }
.js-active .reveal:nth-child(6) { transition-delay: 400ms; }

/* ========== HERO ANIMATIONS ========== */
.hero-orb {
    animation: orb-float 8s ease-in-out infinite;
}

.hero-orb:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 10s;
}

.hero-orb:nth-child(3) {
    animation-delay: -5s;
    animation-duration: 12s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -25px) scale(1.05); }
    66% { transform: translate(-15px, 15px) scale(0.95); }
}

.hero-badge {
    animation: badge-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.2s;
}

.hero-badge span:first-child {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes badge-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ========== CARD TILT EFFECT ========== */
.card-tilt {
    transform: perspective(800px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s ease,
                border-color 0.4s ease;
}

/* ========== NAVIGATION ========== */
#site-header {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#site-header.scrolled {
    background: rgba(6, 13, 24, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
    padding: 0;
}

#site-header.scrolled nav {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* ========== MOBILE MENU ========== */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

.menu-line {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.2s ease,
                width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-toggle.active .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

.menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
    width: 0;
}

.menu-toggle.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 24px;
    margin-left: 0;
}

/* ========== FORM STYLES ========== */
input:focus, textarea:focus {
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: rgba(255,255,255,0.2);
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: rgba(239,68,68,0.5) !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #060d18;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .card-tilt { transform: none !important; }
}

/* ========== FOCUS VISIBLE ========== */
:focus-visible {
    outline: 2px solid #34D399;
    outline-offset: 2px;
    border-radius: 4px;
}
