/* ===================================
   Base Styles - Complete Fixed Version
   =================================== */

/* Reset and Box Model */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root HTML */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Body Styles */
body {
    width: 100vw; /* Fixed from 100vh */
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-primary, 'Comfortaa', sans-serif);
    font-weight: var(--font-comfortaa-regular, 400);
    line-height: 1.6;
    color: var(--text-color, #ffffff);
    background-color: var(--bg-color, #0A0A0A);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    
    /* Loading state */
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Loading States */
body.loaded {
    opacity: 1;
}

body.assets-error {
    opacity: 1;
    background-color: var(--bg-color, #0A0A0A);
}

/* Overlay visible state */
body.overlay-visible {
    overflow: hidden;
}

/* Background overlay for better text readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.5) 100%
    ); */
    pointer-events: none;
    z-index: 0;
}

/* Main content wrapper */
main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* Section defaults */
section {
    position: relative;
    z-index: 1;
}

/* ===================================
   Typography
   =================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--font-comfortaa-bold, 700);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-color, #45B7AF);
    text-decoration: none;
    transition: color var(--transition-fast, 0.2s ease);
}

a:hover {
    color: var(--primary-color, #FF6B6B);
}

/* ===================================
   Accessibility Styles
   =================================== */

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color, #FF6B6B);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 10000;
    font-weight: var(--font-comfortaa-medium, 500);
}

.skip-link:focus {
    top: 0;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for better keyboard navigation */
:focus {
    outline: 2px solid var(--primary-color, #FF6B6B);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Focus visible for keyboard users */
:focus-visible {
    outline: 2px solid var(--primary-color, #FF6B6B);
    outline-offset: 2px;
}

/* ===================================
   Utility Classes
   =================================== */

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width, 1280px);
    margin: 0 auto;
    padding: 0 var(--spacing-md, 1rem);
}

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display utilities */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* Flexbox utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Spacing utilities */
.mt-1 { margin-top: var(--spacing-sm, 0.5rem); }
.mt-2 { margin-top: var(--spacing-md, 1rem); }
.mt-3 { margin-top: var(--spacing-lg, 2rem); }
.mt-4 { margin-top: var(--spacing-xl, 4rem); }

.mb-1 { margin-bottom: var(--spacing-sm, 0.5rem); }
.mb-2 { margin-bottom: var(--spacing-md, 1rem); }
.mb-3 { margin-bottom: var(--spacing-lg, 2rem); }
.mb-4 { margin-bottom: var(--spacing-xl, 4rem); }

/* ===================================
   Loading States
   =================================== */

.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color, #FF6B6B);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 9999;
    pointer-events: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Show spinner only during loading */
body:not(.loaded) .loading-spinner {
    display: block;
}

body.loaded .loading-spinner {
    display: none;
}

/* ===================================
   Selection Styles
   =================================== */

::selection {
    background-color: var(--primary-color, #FF6B6B);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color, #FF6B6B);
    color: white;
}

/* ===================================
   Scrollbar Styles
   =================================== */

/* Webkit browsers */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* ===================================
   Responsive Images & Media
   =================================== */

img, video {
    max-width: 100%;
    height: auto;
    display: block;
    /* Prevent images from being draggable */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    /* Additional prevention methods */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Lazy loading styles */
img[loading="lazy"] {
    background: rgba(255, 255, 255, 0.05);
}

/* ===================================
   Form Elements
   =================================== */

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .header, 
    .info-overlay, 
    .header-social-links,
    .skip-link,
    video {
        display: none !important;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* ===================================
   Responsive Breakpoints
   =================================== */

/* Tablet */
@media screen and (max-width: 1024px) {
    html {
        font-size: 15px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    body::before {
        background: radial-gradient(
            ellipse at center,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.6) 100%
        );
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* ===================================
   Animation Utilities
   =================================== */

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from { 
        transform: translateY(40px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

/* ===================================
   High Contrast Mode Support
   =================================== */

@media (prefers-contrast: high) {
    :focus {
        outline: 3px solid currentColor;
        outline-offset: 3px;
    }
    
    body::before {
        display: none;
    }
}

/* ===================================
   Reduced Motion Support
   =================================== */

@media (prefers-reduced-motion: reduce) {
    *, 
    *::before, 
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}