/* === Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 163, 94, 0.3) transparent;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(200, 163, 94, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 163, 94, 0.5);
}

::selection {
    background: rgba(200, 163, 94, 0.2);
    color: #f5ebd8;
}

body {
    overflow-x: hidden;
}

/* === Grain Overlay === */
.grain-overlay {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.4;
}

/* === Ambient Background === */
.ambient-bg {
    z-index: -1;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.ambient-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(200, 163, 94, 0.4), transparent);
    top: -10%;
    right: -10%;
    animation: float1 20s ease-in-out infinite;
}

.ambient-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(180, 140, 80, 0.3), transparent);
    bottom: 20%;
    left: -5%;
    animation: float2 25s ease-in-out infinite;
}

.ambient-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(220, 180, 120, 0.25), transparent);
    top: 50%;
    right: 30%;
    animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, 60px) scale(1.1); }
    66% { transform: translate(40px, -40px) scale(0.95); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -80px) scale(1.05); }
    66% { transform: translate(-40px, 40px) scale(0.9); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, -50px) scale(1.15); }
    66% { transform: translate(70px, 30px) scale(0.95); }
}

/* === Hero Light Beam === */
.hero-light-beam {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(200, 163, 94, 0.03) 30%,
        rgba(200, 163, 94, 0.05) 50%,
        rgba(200, 163, 94, 0.03) 70%,
        transparent 100%
    );
    animation: lightSway 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes lightSway {
    0%, 100% { transform: translateX(-50%) rotate(-3deg); }
    50% { transform: translateX(-50%) rotate(3deg); }
}

/* === Hero Background Image Parallax === */
.hero-bg-img {
    transition: transform 0.1s linear;
}

/* === Navigation === */
#navbar {
    transition: background-color 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
    background-color: rgba(13, 11, 8, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(200, 163, 94, 0.6), transparent);
    transition: width 0.5s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* === Hamburger Icon === */
.hamburger-icon {
    width: 20px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 1px;
    background-color: #d4b87a;
    transition: all 0.4s ease;
    transform-origin: center;
}

.hamburger-icon span:first-child {
    width: 100%;
}

.hamburger-icon span:last-child {
    width: 60%;
    margin-left: auto;
}

.menu-open .hamburger-icon span:first-child {
    transform: rotate(45deg) translate(4px, 5px);
}

.menu-open .hamburger-icon span:last-child {
    width: 100%;
    transform: rotate(-45deg) translate(4px, -5px);
}

/* === Mobile Menu === */
#mobileMenu.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

#mobileMenu.active .mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.active .mobile-nav-link:nth-child(2) { transition-delay: 0.2s; }
#mobileMenu.active .mobile-nav-link:nth-child(3) { transition-delay: 0.3s; }
#mobileMenu.active .mobile-nav-link:nth-child(4) { transition-delay: 0.4s; }

/* === Reveal Animations === */
.reveal-up {
    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);
}

.reveal-up.revealed {
    opacity: 1 !important;
    transform: translateY(0);
}

/* === Program Cards === */
.program-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(200, 163, 94, 0.02) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.7s ease;
}

.program-card:hover::before {
    opacity: 1;
}

/* === Gallery Cards === */
.gallery-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 163, 94, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-card:hover::after {
    opacity: 1;
}

/* === Glass Card === */
.glass-card {
    background: rgba(30, 26, 34, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(200, 163, 94, 0.1);
    border-radius: 2px;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(200, 163, 94, 0.05) 0%,
        transparent 50%,
        rgba(200, 163, 94, 0.02) 100%
    );
    border-radius: 2px;
    pointer-events: none;
}

/* === Form Elements === */
.form-input,
.form-select {
    transition: border-color 0.5s ease;
}

.form-input:focus,
.form-select:focus {
    border-bottom-color: rgba(200, 163, 94, 0.6);
}

.form-input::placeholder {
    color: rgba(130, 120, 140, 0.5);
}

.form-select {
    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='%23AEA8B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 24px;
}

.form-select option {
    background: #15120e;
    color: #e8d5b0;
}

/* === Cursor Glow === */
#cursorGlow {
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
    .ambient-orb-1 {
        width: 300px;
        height: 300px;
    }
    
    .ambient-orb-2 {
        width: 250px;
        height: 250px;
    }
    
    .ambient-orb-3 {
        width: 200px;
        height: 200px;
    }
    
    .hero-light-beam {
        width: 100px;
    }
}

/* === Image Shimmer Loading === */
img {
    opacity: 0;
    transition: opacity 0.6s ease;
}

img.loaded {
    opacity: 1;
}

/* Gallery card images should respect different opacity */
.gallery-card img,
.program-card img {
    transition: opacity 0.6s ease, transform 0.7s ease;
}

/* === Smooth Scroll Padding === */
section {
    scroll-margin-top: 96px;
}

@media (max-width: 1024px) {
    section {
        scroll-margin-top: 80px;
    }
}