/* ─── Base & Utilities ─── */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
}

/* ─── Scroll-triggered animations (progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }

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

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
}

/* ─── Header scroll state ─── */
#header {
    background: transparent;
}

#header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ─── Mobile menu animation ─── */
#mobile-menu.open {
    animation: slideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#menu-btn[aria-expanded="true"] #bar1 {
    transform: translateY(4px) rotate(45deg);
}

#menu-btn[aria-expanded="true"] #bar2 {
    opacity: 0;
}

#menu-btn[aria-expanded="true"] #bar3 {
    transform: translateY(-4px) rotate(-45deg);
}

/* ─── Selection color ─── */
::selection {
    background: #ff6b3f;
    color: white;
}

/* ─── Focus visible ─── */
:focus-visible {
    outline: 2px solid #ff6b3f;
    outline-offset: 2px;
}

/* ─── Custom scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* ─── Form select arrow ─── */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23787880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ─── Subtle pulse for decorative dots ─── */
@media (prefers-reduced-motion: no-preference) {
    .hero-dot {
        animation: pulse 3s ease-in-out infinite;
    }

    .hero-dot:nth-child(2) { animation-delay: 1s; }
    .hero-dot:nth-child(3) { animation-delay: 2s; }
    .hero-dot:nth-child(4) { animation-delay: 0.5s; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.3); }
}
