/**
 * Common CSS - Shared Styles
 * Extracted from index.html for better code organization
 */

/* CSS Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Luxury Color Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1a1a24;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.45);
    --accent-gold: #d4af37;
    --accent-gold-light: rgba(212, 175, 55, 0.15);
    --accent-purple: #9b59b6;
    --accent-purple-light: rgba(155, 89, 182, 0.15);
    --accent-blue: #3498db;
    --accent-blue-light: rgba(52, 152, 219, 0.15);
    --accent-green: #27ae60;
    --accent-green-light: rgba(39, 174, 96, 0.15);
    --accent-pink: #e91e63;
    --accent-pink-light: rgba(233, 30, 99, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(212, 175, 55, 0.3);
    --shadow-glow: 0 8px 32px rgba(212, 175, 55, 0.1);
    --shadow-glow-hover: 0 12px 48px rgba(212, 175, 55, 0.15);

    /* Typography - with font-display: swap fallback */
    --font-display: 'Playfair Display', 'Georgia', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

    /* Fluid Spacing using clamp() */
    --spacing-xs: clamp(0.4rem, 0.8vw, 0.6rem);
    --spacing-sm: clamp(0.8rem, 1.5vw, 1.2rem);
    --spacing-md: clamp(1.5rem, 3vw, 2.5rem);
    --spacing-lg: clamp(3rem, 5vw, 4rem);
    --spacing-xl: clamp(6rem, 10vw, 8rem);

    /* Animation */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* Touch Target Size - Minimum 44px */
    --touch-target: 44px;
}

/* Base Styles */
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus Visibility for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Skip Navigation Link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gold);
    color: var(--bg-primary);
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
    border-radius: 0 0 8px 8px;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 1;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-sm) 0;
    transition: all 0.3s var(--transition-smooth);
}

nav.scrolled {
    background: rgba(10, 10, 15, 0.98);
    padding: 0.6rem 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.03em;
    position: relative;
    transition: color 0.3s var(--transition-smooth);
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transition: transform 0.3s var(--transition-smooth);
}

.logo:hover {
    color: var(--accent-gold);
}

.logo:hover::after {
    transform: scaleX(1);
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    font-weight: 500;
    transition: color 0.3s var(--transition-smooth);
    position: relative;
    padding: 0.5rem 1rem;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-purple));
    transition: width 0.3s var(--transition-smooth);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s var(--transition-smooth);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Section Styles */
section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.section-header {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-label {
    color: var(--accent-gold);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.section-label::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--accent-gold);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    line-height: 1.15;
}

.section-description {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.8;
}

/* Footer */
footer {
    padding: var(--spacing-lg) 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: var(--spacing-xl);
    position: relative;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s var(--transition-smooth);
    padding: 0.5rem 1rem;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--accent-gold);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Scroll Animation */
.fade-in-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s var(--transition-smooth), transform 1s var(--transition-smooth);
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 8px;
        background: var(--bg-card);
    }
}

/* Container Queries for Advanced Responsiveness */
@container (min-width: 400px) {
    .skill-card,
    .project-card {
        --card-padding: 1.5rem;
    }
}

@container (min-width: 600px) {
    .skill-card,
    .project-card {
        --card-padding: 2rem;
    }
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in-section {
        opacity: 1;
        transform: none;
    }
}
