/**
 * Critical CSS - Inline Styles
 * Styles required for above-the-fold content to render immediately
 * This should be inlined in <head> to eliminate render-blocking CSS
 * Generated for: index.html, privacy.html
 */

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-soft);
    background: var(--bg);
    overflow-x: hidden;
    padding-top: 0;
}

main {
    padding-top: var(--header-height, 70px);
}

/* ==========================================================================
   Skip Link (Accessibility)
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--text);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   Header - Critical Styles
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(var(--bg-rgb), 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem clamp(1rem, 4vw, 4rem);
    height: var(--header-height, 70px);
    min-height: var(--header-height, 70px);
}

.site-header__main--minimal {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.site-header__main--minimal::before {
    content: '';
    grid-column: 1;
}

.site-header__main--minimal .brand {
    grid-column: 2;
    justify-content: center;
}

.site-header__main--minimal .header-actions {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .site-header__main--minimal {
        grid-template-columns: auto auto;
    }

    .site-header__main--minimal::before {
        display: none;
    }

    .site-header__main--minimal .brand {
        grid-column: 1;
    }

    .site-header__main--minimal .header-actions {
        grid-column: 2;
    }
}

.brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    height: clamp(32px, 5vw, 46px);
    width: auto;
}

.services-empty {
    display: none;
}

.services-empty.is-visible {
    display: block;
}

/* ==========================================================================
   Hero Section - Above the Fold
   ========================================================================== */

.hero-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, rgba(var(--bg-rgb), 0.98) 0%, rgba(var(--surface-rgb), 0.95) 100%);
}

.hero-content {
    max-width: 1200px;
    padding: 2rem;
    text-align: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text), var(--text-soft));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(var(--white-rgb), 0.8);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Homepage Hero - Critical Styles
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: calc(-1 * var(--header-height, 70px));
    padding: 0;
    padding-top: var(--header-height, 70px);
    background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
    overflow: hidden;
}

.hero-video-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: brightness(0.75) contrast(1.15) saturate(1.1);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 400px at 50% 0%, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%),
        linear-gradient(135deg, rgba(var(--surface-rgb), 0.88) 0%, rgba(var(--surface-rgb), 0.8) 50%, rgba(var(--surface-rgb), 0.88) 100%);
    z-index: 1;
    backdrop-filter: blur(0.5px);
}

.hero-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 3rem);
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.6;
    color: rgba(var(--white-rgb), 0.85);
    margin-bottom: 3rem;
}

.hero-trust-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    text-align: left;
}

.trust-point {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(var(--white-rgb), 0.04);
    border: 1px solid rgba(var(--primary-rgb), 0.4);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(var(--shadow-rgb), 0.1);
}

.trust-point svg {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.trust-point strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.trust-point span {
    font-size: 0.9rem;
    color: var(--muted);
}

.hero-cta-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-cta-primary,
.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.35rem 2.75rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
}

.hero-cta-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary));
    color: var(--text);
}

.hero-cta-secondary {
    background: rgba(var(--white-rgb), 0.08);
    color: var(--text);
    border: 1px solid rgba(var(--white-rgb), 0.22);
    padding: 0.95rem 1.5rem;
}

@media (max-width: 768px) {
    .site-header {
        flex-wrap: nowrap;
    }

    .header-actions {
        flex-wrap: nowrap;
        width: auto;
        margin-top: 0;
    }

    .hero {
        background:
            linear-gradient(135deg, rgba(var(--surface-rgb), 0.92) 0%, rgba(var(--surface-rgb), 0.86) 50%, rgba(var(--surface-rgb), 0.92) 100%),
            url('/assets/visuals/images/hero_home-mobile.jpg') center/cover no-repeat;
    }

    .hero-video-container {
        display: none;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-trust-points {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .trust-point {
        padding: 1rem;
    }

    .hero-cta-primary {
        width: 100%;
        justify-content: center;
        font-size: 1rem;
        padding: 1.1rem 2rem;
    }
}

@media (max-width: 480px) {
    .hero-container {
        padding: 2rem 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .trust-point strong {
        font-size: 0.95rem;
    }

    .trust-point span {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   Buttons - Critical CTA Styles
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary));
    color: var(--text);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

.btn.secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn.secondary:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(var(--white-rgb), 0.05) 25%,
        var(--border) 50%,
        rgba(var(--white-rgb), 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;
    }
}

/* ==========================================================================
   Image Loading Optimization
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded,
img[loading="lazy"][src] {
    opacity: 1;
}

/* Reserve space for images to prevent CLS */
img:not([width]):not([height]) {
    aspect-ratio: attr(width) / attr(height);
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.section {
    padding: 4rem 0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.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-center {
    text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .site-header {
        padding: 0.75rem 0;
    }

    .brand-logo {
        height: 32px;
    }

    .hero-section {
        min-height: 60vh;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* Prevent layout shift for lazy-loaded images */
[data-src],
[data-srcset] {
    min-height: 200px;
    background: rgba(var(--white-rgb), 0.03);
}

/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
