/* ===========================================
   DESIGN TOKENS - "The Clinical Rebel"
   Organic Brutalism | Magenta & X-ray
   =========================================== */

:root {
    /* Colors */
    --primary: #7a0053;
    --primary-container: #9d1b6d;
    --on-primary: #ffffff;
    --on-primary-container: #ffb4d7;
    --on-primary-fixed: #3d0027;
    --on-primary-fixed-variant: #8a015e;
    --primary-fixed: #ffd8e8;
    --primary-fixed-dim: #ffafd5;

    --background: #f9f9f9;
    --on-background: #1a1c1c;

    --surface: #f9f9f9;
    --surface-container: #eeeeee;
    --surface-container-low: #f3f3f4;
    --surface-container-lowest: #ffffff;
    --surface-container-high: #e8e8e8;
    --surface-container-highest: #e2e2e2;
    --on-surface: #1a1c1c;
    --on-surface-variant: #55414a;

    --secondary: #5e5e5e;
    --secondary-container: #e2e2e2;
    --on-secondary: #ffffff;
    --on-secondary-container: #646464;

    --outline: #88717a;
    --outline-variant: #dbbfca;

    --error: #ba1a1a;
    --error-container: #ffdad6;
    --on-error: #ffffff;
    --inverse-primary: #ffafd5;
    --inverse-surface: #2f3131;
    --inverse-on-surface: #f0f1f1;

    /* Zero-radius corners */
    --radius: 0px;
    --radius-lg: 0px;
    --radius-xl: 0px;

    /* Fonts */
    --font-headline: 'Space Grotesk', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --font-label: 'Space Grotesk', sans-serif;

    /* Spacing scale (8pt) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.6s ease, transform 0.6s ease;
}

/* ===================================
   SCROLL ANIMATIONS
   =================================== */

.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow);
}

.animate-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.animate-slide-left {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-slide-right {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s !important; }
.stagger-2 { transition-delay: 0.2s !important; }
.stagger-3 { transition-delay: 0.3s !important; }
.stagger-4 { transition-delay: 0.4s !important; }
.stagger-5 { transition-delay: 0.5s !important; }

/* ===================================
   MICRO-INTERACTIONS
   =================================== */

/* Card lift on hover */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(122, 0, 83, 0.15);
}

/* Image hover: grayscale to color */
.img-reveal {
    filter: grayscale(100%);
    transition: filter 0.7s ease;
}

.img-reveal:hover {
    filter: grayscale(0%);
}

/* Underline animation for links */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* ===================================
   PAGE TRANSITIONS
   =================================== */

.page-container {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-container.active {
    opacity: 1;
    transform: translateY(0);
}

.page-exit {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1c1c;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

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

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

.preloader-logo {
    font-family: var(--font-headline);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    animation: pulse 1.5s ease-in-out infinite;
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: #333;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 2px;
}

.preloader-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7a0053, #ffafd5);
    width: 0;
    animation: loadingBar 1.2s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.98); }
}

@keyframes loadingBar {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Navbar scroll state */
.navbar-scrolled {
    background: rgba(26, 28, 28, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .page-container { transform: none; }
    .animate-fade-up { transform: translateY(20px); }
}

/* ===================================
   MOBILE HAMBURGER & OVERLAY
   =================================== */

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 60;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

#mobileMenuOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(26, 28, 28, 0.98);
    backdrop-filter: blur(20px);
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
}

#mobileMenuOverlay.active {
    transform: translateX(0);
}

.mobile-nav-link {
    font-family: var(--font-headline);
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary-fixed-dim);
}
