/* ============================================
   CORE STYLES - Base Configuration & Global Styles
   
   Purpose: Foundational CSS including:
   - CSS Variables (colors, fonts, spacing)
   - Reset and base element styles
   - Typography and global utilities
   - Accessibility features
   - Browser compatibility fixes
   
   Dependencies: None (loads first)
   Updated: 2025
   ============================================ */

/* ============================================
   CSS CUSTOM VARIABLES
   Define all global design tokens here
   ============================================ */
:root {
    /* Colors */
    --bg-color: #ebe9e6;              /* Main background: Light beige */
    --text-color: #DCE3E8;            /* Light text for dark backgrounds */
    --text-color-dark: #2C2825;       /* Dark text for light backgrounds */
    --accent-color: #D3AA2C;          /* Primary accent: Gold */
    
    /* Typography */
    --font-family-primary: 'Inter', sans-serif;
    --font-family-logo: 'Old Standard TT', serif;
    --font-family-hero: 'Fascinate', cursive;
    
    /* Spacing - Consistent across site */
    --padding-desktop: 5vw;
    --padding-mobile: 4vw;
    --section-spacing-desktop: 7vw;
    --section-spacing-mobile: 10vw;
    --header-content-gap: 5mm;
    --header-height-dynamic: 0px;     /* Updated by JavaScript */

    /* Gradient Colors - Used in hero and about sections */
    --gradient-color-1: rgb(166, 44, 44);
    --gradient-color-2: rgb(232, 63, 37);
    --gradient-color-3: rgb(234, 115, 0);
    --gradient-color-4: rgb(211, 202, 121);

    /* Lumos Light Effect - Subtle glow on education cards */
    --lumos-color-inner: rgba(255, 255, 255, 0.15);
    --lumos-color-outer: rgba(255, 255, 255, 0.05);
}


/* ============================================
   BASE RESET & GLOBAL STYLES
   Normalize browser defaults
   ============================================ */
html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family-primary);
    background-color: var(--bg-color);
    color: var(--text-color-dark);
    scroll-behavior: smooth;
    
    /* Font smoothing for better text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Box-sizing for all elements */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Remove default link styling */
a {
    text-decoration: none;
    color: inherit;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}


/* ============================================
   ACCESSIBILITY FEATURES
   WCAG 2.1 AA Compliance
   ============================================ */

/* Skip to main content link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 10px;
}

/* Visible focus indicators for keyboard navigation */
a:focus-visible,
button:focus-visible,
.work-card:focus-visible,
.about-button:focus-visible,
.contact-button:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Remove outline for mouse clicks (not keyboard) */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only content - accessible but invisible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


/* ============================================
   TEXT SELECTION STYLING
   Branded selection colors
   ============================================ */
::selection {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

::-moz-selection {
    background-color: var(--accent-color);
    color: var(--bg-color);
}


/* ============================================
   SCROLLBAR CUSTOMIZATION
   Modern, minimal scrollbar design
   ============================================ */

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

/* Webkit scrollbar (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}


/* ============================================
   WORD WRAPPING & LINE BREAKING
   Prevent text overflow issues
   ============================================ */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Prevent breaking in navigation and buttons */
.main-nav a,
.mobile-bottom-nav nav a,
.about-button,
.contact-button {
    word-break: keep-all;
    hyphens: none;
    white-space: nowrap;
}


/* ============================================
   CURSOR BEHAVIOR
   Touch vs Mouse Device Distinction
   ============================================ */

/* Hide default cursor only on hover-capable devices (mouse) */
@media (hover: hover) and (pointer: fine) {
    html, body {
        cursor: none;
    }
    
    a, button, .work-card, .about-button, .contact-button {
        cursor: none !important;
    }
}

/* Show pointer cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    a, button, .work-card, .about-button, .contact-button {
        cursor: pointer !important;
    }
}


/* ============================================
   REDUCED MOTION ACCESSIBILITY
   Respect user preferences
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* No transforms on hover */
    .work-card:hover,
    .about-image-right img:hover,
    .about-button:hover {
        transform: none;
    }
}


/* ============================================
   HIGH CONTRAST MODE SUPPORT
   Enhanced visibility for accessibility
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --bg-color: #000000;
        --text-color: #FFFFFF;
        --accent-color: #00FF00;
    }
    
    /* Ensure borders are visible */
    .main-header,
    .work-card,
    .education-item,
    .about-button {
        border: 2px solid var(--text-color);
    }
    
    /* Remove subtle effects */
    .custom-cursor,
    .education-section::before {
        display: none;
    }
}


/* ============================================
   PERFORMANCE OPTIMIZATIONS
   GPU acceleration for smooth animations
   ============================================ */

/* Hardware acceleration for animated elements */
.custom-cursor,
.work-card,
.main-header,
.education-item {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Contain paint for better performance */
.work-card,
.education-item {
    contain: layout style paint;
}


/* ============================================
   BROWSER-SPECIFIC FIXES
   Cross-browser compatibility
   ============================================ */

/* iOS Safari viewport height fix */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        min-height: -webkit-fill-available;
    }
}

/* Edge/IE fallback (legacy support) */
@supports (-ms-ime-align: auto) {
    .work-card-grid {
        display: -ms-grid;
    }
}


/* ============================================
   LOADING STATES
   Skeleton loaders for images
   ============================================ */
.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


/* ============================================
   PRINT STYLES
   Optimize for print media
   ============================================ */
@media print {
    /* Hide interactive elements */
    .custom-cursor,
    .main-header,
    .skip-link,
    .nav-circles {
        display: none;
    }
    
    /* Print-friendly colors */
    body {
        background-color: white;
        color: black;
    }
    
    /* Remove effects for print */
    .work-card,
    .education-item,
    .about-button {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    /* Ensure text is readable */
    .hero-subtext,
    .about-headline {
        color: black !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        background-clip: unset !important;
    }
    
    /* Prevent page breaks inside sections */
    section {
        page-break-inside: avoid;
    }
}


/* ============================================
   UTILITY CLASSES
   Reusable helper classes
   ============================================ */

/* Remove focus outline for mouse users, keep for keyboard */
.no-focus-visible:focus:not(:focus-visible) {
    outline: none;
}

/* Dynamic text color classes */
.section-dark-bg {
    color: var(--text-color);
}

.section-light-bg {
    color: var(--text-color-dark);
}


/* ============================================
   END OF CORE STYLES
   Next file: layout.css (header, sections, footer)
   ============================================ */
