/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-bar {
    width: 120px;
    height: 1px;
    background: rgba(56, 189, 248, 0.2);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.loader-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #38bdf8;
    animation: loadProgress 1.5s ease-out forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

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

#navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background 0.5s ease;
}

#navbar.scrolled .nav-overlay {
    background: rgba(15, 23, 42, 0.6);
}

.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#mobile-menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

#mobile-menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 24px;
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

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

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

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

/* Hero */
.hero-overlay {
    background: linear-gradient(
        to bottom,
        rgba(15, 23, 42, 0.6) 0%,
        rgba(15, 23, 42, 0.3) 50%,
        rgba(15, 23, 42, 0.8) 100%
    );
}

.hero-subtitle {
    opacity: 0;
    animation: fadeUp 0.8s ease 0.5s forwards;
}

.hero-headline {
    opacity: 0;
    animation: fadeUp 0.8s ease 0.7s forwards;
}

.hero-description {
    opacity: 0;
    animation: fadeUp 0.8s ease 0.9s forwards;
}

.hero-ctas {
    opacity: 0;
    animation: fadeUp 0.8s ease 1.1s forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Reveal Animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(40px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu Section */
.menu-label,
.about-label,
.experience-label,
.location-label,
.cta-label {
    opacity: 1;
}

.menu-title,
.about-title,
.experience-title,
.location-title,
.cta-title {
    opacity: 1;
}

.menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
    transition: padding-left 0.3s ease;
}

.menu-item:hover {
    padding-left: 8px;
}

/* About Section */
.about-image-wrapper {
    position: relative;
}

.about-image-aspect {
    overflow: hidden;
}

.about-image-aspect img {
    transition: transform 0.8s ease;
}

.about-image-aspect:hover img {
    transform: scale(1.03);
}

/* Experience Cards */
.experience-card {
    transition: transform 0.4s ease;
}

.experience-card:hover {
    transform: translateY(-8px);
}

.experience-card-image {
    overflow: hidden;
}

.experience-card-image img {
    transition: transform 0.6s ease;
}

.experience-card:hover .experience-card-image img {
    transform: scale(1.05);
}

/* Location */
.location-map-wrapper {
    overflow: hidden;
}

.location-map-aspect {
    position: relative;
}

.location-map-aspect::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(56, 189, 248, 0.2);
    pointer-events: none;
}

/* Footer */
footer a {
    text-decoration: none;
}

/* Mobile Menu Button */
#mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Smooth scroll offset for fixed nav */
section[id] {
    scroll-margin-top: 80px;
}

/* Selection */
::selection {
    background: rgba(56, 189, 248, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(56, 189, 248, 0.3);
    color: #fff;
}

/* Focus visible */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 4px;
}

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

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}
