/**
 * Copyright (c) 2024-present, Prime Nevada
 * All rights reserved.
 *
 * This source code is licensed under the BSD 4-Clause license found in the
 * LICENSE.md file in the root directory of this source tree.
 */

:root {
    /* Layout Measurements */
    --nav-height: 80px;
    --header-height: calc(1rem + 1rem + 24px); /* padding-top + padding-bottom + approximate text height */
    --header-height-mobile: calc(1rem + 1rem + 24px);

    /* Brand Colors */
    --color-brand-primary: #000000;
    --color-brand-secondary: #36393D;
    --color-brand-teal: #008080;
    --color-brand-orange: #CC5500;

    /* Text Colors */
    --color-text-primary: #ffffff;
    --color-text-secondary: #36393D;
    --color-text-muted: rgba(255, 255, 255, 0.7);

    /* Background Colors */
    --color-bg-primary: #000000;
    --color-bg-secondary: #36393D;
    --color-bg-overlay: rgba(0, 0, 0, 0.95);
    --color-bg-teal: rgba(0, 128, 128, 0.1);

    /* UI Elements */
    --color-focus-outline: #008080;
    --color-error: #CC5500;
    --color-success: #008080;
    
    /* Border Colors */
    --color-border-light: rgba(255, 255, 255, 0.1);
    --color-border-input: #36393D;
    
    /* Gradients */
    --gradient-teal: linear-gradient(135deg, rgba(0, 128, 128, 0.1), rgba(0, 128, 128, 0.2));
    --gradient-orange: linear-gradient(135deg, rgba(204, 85, 0, 0.1), rgba(204, 85, 0, 0.2));

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-nav: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Font Weights */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
}

h1, .h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2, .h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h3, .h3 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: 2rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1);
}

h4, .h4 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* Base text styles */
p {
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Skip Link - Hidden by default, visible on focus */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    padding: 8px;
    z-index: 100;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--color-focus-outline);
    outline-offset: 2px;
}

/* Focus styles for interactive elements */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--color-focus-outline);
    outline-offset: 2px;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-bg-overlay);
    padding: 1rem 2rem;
    z-index: 1000;
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--color-border-light);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 3rem;
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg-primary);
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
    color: var(--color-text-primary);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.7;
    will-change: opacity;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 70vw;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
    color: #ffffff;
    font-family: 'Playfair Display', serif;
}

.hero h1,
h1 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-family: var(--font-body);
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Mobile styles */
@media (max-width: 768px) {
    .hero {
        padding: 0 1.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
        padding-top: calc(var(--header-height-mobile) + 1rem);
    }

    .hero-content p {
        font-size: 1.25rem;
    }

    .hero-content {
        padding: 1rem;
    }
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 6rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    transition: transform 0.3s ease;
    content-visibility: auto;
    contain-intrinsic-size: 1px 5000px;
    border-bottom: 5px solid var(--color-brand-orange);
    will-change: transform;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-teal);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover::before {
    opacity: 1;
}

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

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

.portfolio-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.4), transparent);
    color: var(--color-text-primary);
    z-index: 1;
}

    .portfolio-content h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: var(--color-text-primary);
        line-height: 1.2;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

.portfolio-content p {
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--color-text-primary);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .portfolio-item {
        aspect-ratio: auto;
        min-height: 350px;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .portfolio-item img {
        flex: 1;
        min-height: 200px;
    }

    .portfolio-content h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    .portfolio-content p {
        font-size: 1rem;
    }

    .portfolio-content {
        padding: 1.5rem;
        position: relative;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
        flex-shrink: 0;
    }
}

/* Feature Section */
.feature-section {
    padding: 8rem 2rem;
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
}

.feature-section:nth-child(odd) {
    background: none;
}

.feature-section:nth-child(even) {
    background: none;
}

.feature-content {
    flex: 1;
}

.feature-content ul {
    list-style-position: inside;
    padding-left: 0;
    margin-top: 1rem;
}

.feature-content li {
    margin-bottom: 0.5rem;
}

.feature-image {
    flex: 1;
    position: relative;
    aspect-ratio: 4/3;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-content h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: var(--font-weight-medium);
    letter-spacing: -1px;
}

.feature-content p {
    font-size: 1.2rem;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
}

/* Stats Section */
.stats-section {
    padding: 6rem 2rem;
    background: var(--gradient-teal);
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-brand-teal);
}

.stat-item p {
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

/* Contact Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--color-text-primary);
}

input, textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-border-input);
    background-color: transparent;
    color: var(--color-text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

input:focus, textarea:focus {
    border-color: var(--color-brand-teal);
    background-color: transparent;
}

button, .button {
    background-color: var(--color-brand-teal);
    color: var(--color-text-primary);
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 3rem;
    text-decoration: none;
    display: inline-block;
    font-family: var(--font-nav);
    font-weight: var(--font-weight-semibold);
}

button:hover, .button:hover {
    background-color: var(--color-brand-orange);
    transform: translateY(-2px);
    color: var(--color-text-primary);
}

button.secondary, .button.secondary {
    background-color: var(--color-brand-secondary);
}

button.secondary:hover, .button.secondary:hover {
    background-color: var(--color-brand-teal);
}

/* Error states */
.error {
    color: var(--color-error);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--color-error);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .feature-section {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1, .h1 {
        font-size: 2.5rem;
    }
    
    h2, .h2 {
        font-size: 2rem;
    }
    
    h3, .h3 {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        padding-top: calc(var(--header-height-mobile) + 1rem);
    }

    .hero-content p {
        font-size: 1.25rem;
        color: var(--color-text-primary);
    }

    .hero {
        padding: 0 1.5rem;
    }
}

/* Ensure images have proper aspect ratios */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Improved heading hierarchy */
h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

/* Ensure proper spacing for readability */
p {
    margin-bottom: 1.5rem;
}

/* Improved link styles */
a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-brand-teal);
}

/* Footer Styles */
footer {
    background-color: var(--color-bg-primary);
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--color-border-light);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h4 {
    color: var(--color-text-primary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.footer-section p {
    color: var(--color-text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--color-brand-teal);
}

.footer-bottom {
    max-width: 1400px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
    text-align: center;
    color: var(--color-text-primary);
    font-size: 0.8rem;
}

.footer-bottom p {
    max-width: none;
    color: var(--color-text-primary);
    font-size: 0.8rem;
}

/* Call to action elements */
.cta-button {
    background-color: var(--color-brand-orange);
    color: var(--color-text-primary);
    padding: 1.2rem 2.4rem;
    border: none;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: var(--font-nav);
    font-weight: var(--font-weight-semibold);
}

.cta-button:hover {
    background-color: var(--color-brand-teal);
    transform: translateY(-2px);
}

/* Links */
a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-brand-teal);
}

/* Section highlights */
.highlight-text {
    color: var(--color-brand-teal);
}

.highlight-orange {
    color: var(--color-brand-orange);
}

/* Cards and containers */
.card {
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-brand-secondary);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--color-brand-teal);
    transform: translateY(-3px);
}

/* Progress bars and indicators */
.progress-bar {
    background-color: var(--color-brand-secondary);
}

.progress-bar .fill {
    background-color: var(--color-brand-teal);
}

/* Alerts and notifications */
.alert-success {
    border-left: 4px solid var(--color-brand-teal);
    background-color: transparent;
}

.alert-warning {
    border-left: 4px solid var(--color-brand-orange);
    background-color: transparent;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1, .h1 {
        font-size: 2.5rem;
    }

    h2, .h2 {
        font-size: 2rem;
    }

    h3, .h3 {
        font-size: 1.75rem;
    }

    h4, .h4 {
        font-size: 1.25rem;
    }
}

.thank-you-content {
    text-align: center;
    padding: 4rem 2rem;
}

.thank-you-content h1 {
    margin-bottom: 1.5rem;
}

.thank-you-content p {
    margin-bottom: 2rem;
    color: var(--color-text-primary);
}

/* Cookie Consent Dialog */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    color: var(--color-text-primary);
    z-index: 1000;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
}

.cookie-content p {
    margin: 0;
    flex: 1;
    min-width: 280px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cookie-buttons button {
    margin: 0;
    min-width: 120px;
    font-family: var(--font-nav);
    font-weight: var(--font-weight-semibold);
}

.cookie-link {
    color: var(--color-brand-teal);
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.cookie-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-link {
        margin: 0.5rem 0 0 0;
    }
}

/* Privacy Policy Page */
.privacy-content {
    padding: 4rem 2rem;
    background: var(--color-bg-primary);
}

.privacy-content .content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.privacy-content h2 {
    margin-bottom: 0.5rem;
}

.privacy-content h3 {
    margin-top: 2.5rem;
    color: var(--color-brand-teal);
}

.privacy-content h4 {
    margin-top: 1.5rem;
    color: var(--color-text-primary);
}

.privacy-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.privacy-content ul {
    margin: 1rem 0 1.5rem 1.5rem;
    list-style-type: disc;
}

.privacy-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .privacy-content {
        padding: 2rem 1rem;
    }
    
    .privacy-content h3 {
        margin-top: 2rem;
    }
}

/* Performance optimizations for below-the-fold sections */
.feature-section,
.portfolio-grid,
.stats-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
}

/* Optimize animations for performance */
@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;
    }
}
