/* NON-CRITICAL CSS - Loaded after initial render */

/* Additional Font Weights */
@font-face {
    font-family: 'Apercu';
    src: url('../fonts/apercu/apercu_medium_pro.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Apercu Mono';
    src: url('../fonts/apercu/apercu_mono_pro.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Extended Color Palette */
:root {
    --color-primary: #2c5f2d;
    --color-primary-light: #4a7a4d;
    --color-primary-dark: #1e4220;
    --color-secondary: #c55a3f;
    --color-tertiary: #8b9d83;
    --color-accent: #d4a574;
    
    /* Neutral System */
    --color-neutral-50: #fafaf9;
    --color-neutral-100: #f5f5f4;
    --color-neutral-200: #e7e5e4;
    --color-neutral-300: #d6d3d1;
    --color-neutral-400: #a8a29e;
    --color-neutral-500: #78716c;
    --color-neutral-600: #57534e;
    --color-neutral-700: #44403c;
    --color-neutral-800: #292524;
    --color-neutral-900: #1c1917;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-round: 50px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
}

/* Typography System */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

/* Section Styling */
.section {
    padding: var(--space-2xl) 0;
    position: relative;
}

.section:nth-child(even) {
    background-color: var(--color-neutral-50);
}

.section h2 {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-neutral-800);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.section p {
    max-width: 65ch;
    margin: 0 auto var(--space-md);
    text-align: center;
    color: var(--color-neutral-600);
    font-size: 1.125rem;
    line-height: 1.7;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.portfolio-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--color-neutral-100);
}

.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: var(--space-md);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .overlay {
    transform: translateY(0);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.video-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail-wrapper {
    position: relative;
    aspect-ratio: 16/9;
}

.video-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    transition: transform 0.3s ease;
}

.video-item:hover .video-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Form Styling */
form {
    max-width: 600px;
    margin: var(--space-xl) auto 0;
    display: grid;
    gap: var(--space-md);
}

input, textarea {
    padding: var(--space-md);
    border: 2px solid var(--color-neutral-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

button {
    padding: var(--space-md) var(--space-xl);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-round);
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    justify-self: center;
}

button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form Messages */
.form-message {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
    font-weight: 500;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Footer */
footer {
    background: var(--color-neutral-800);
    color: var(--color-neutral-100);
    padding: var(--space-xl) 0;
    text-align: center;
    margin-top: var(--space-2xl);
}

footer .container {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

footer h3 {
    color: white;
    margin-bottom: var(--space-sm);
}

footer a {
    color: var(--color-neutral-300);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Image States */
.loaded {
    animation: fadeInUp 0.3s ease-out;
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .section {
        padding: var(--space-xl) 0;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--space-md);
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    form {
        margin-top: var(--space-lg);
    }
    
    footer .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }
    
    .section {
        padding: var(--space-lg) 0;
    }
}

/* Print Styles */
@media print {
    .hero-slideshow,
    .hamburger-nav,
    button {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .section {
        break-inside: avoid;
    }
}