/**
 * File: global_style.css
 * Project: Dāvis Strazds Portfolio (Systems Architect)
 * Purpose: Global design system and UI components focusing on premium Glassmorphism and fluid scaling.
 * (Mērķis: Globālā dizaina sistēma un UI komponentes ar fokusu uz premium Glassmorphism un plūstošu mērogošanu.)
 * Author: Dāvis Strazds
 * Architecture: Atomic CSS variables for consistent branding and mathematical spatial rhythm.
 * (Arhitektūra: Atomāri CSS mainīgie konsekventam zīmolam un matemātiskam telpiskajam ritmam.)
 */

/* --- DESIGN TOKENS / VARIABLES (Dizaina mainīgie) --- */
:root {
    /* Ultra-dark foundation to absorb light and emphasize focus (Ultra-tumšs pamats, lai absorbētu gaismu un uzsvērtu fokusu) */
    --primary-color: #050505; 

    /* Gold palette sampled from traditional luxury standards for premium authority 
       (Zelta palete ieturēta tradicionālos luksusa standartos premium autoritātei) */
    --accent-gold: #d4af37; 
    
    /* Blue accents for technical/digital feel (Zilie akcenti tehniskai/digitālai sajūtai) */
    --container-max-width: 1600px; /* Wider for TV/Projectors (Platāks TV un projektoriem) */
    --section-padding: clamp(2rem, 10vh, 12rem);
    --fluid-padding: clamp(1rem, 5vw, 6rem); 
    
    /* Scenario Z Default Gaps (Z scenārija noklusējuma atstarpes) */
    --navbar-gap: clamp(1rem, 2vw, 2.5rem);
    
    --accent-blue: #00c6ff;
    /* High-transparency glass surface for depth layering (Augstas caurspīdības stikla virsma dziļuma slāņošanai) */
    --glass-bg: rgba(255, 255, 255, 0.03); 
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-hover: 0 8px 24px rgba(212, 175, 55, 0.3);
    --transition-speed: 0.3s;
    /* Complex multi-stop gradients for rich visual texture (Sarežģīti gradienti bagātīgai vizuālai tekstūrai) */
    --primary-gradient: linear-gradient(135deg, #00c6ff, #0072ff);
    --gold-gradient: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    --error-color: #ff416c;
}

/* === VIEWPORT LOGIC (Skata loģika) === 
   Ensures consistent spatial rhythm and prevents header overlap on anchor navigation.
   (Nodrošina konsekventu telpisko ritmu un novērš galvenes pārklāšanos enkura navigācijā.) */
html {
    scroll-behavior: smooth;
    /* Adjusted scroll padding to account for sticky header height (Pielāgota atkāpe sastingušajai galvenei) */
    scroll-padding-top: 80px; 
    overflow-x: hidden; /* Global safety against horizontal shift (Globālā drošība pret horizontālo nobīdi) */
}

/* === SCROLLBAR INTERFACE (Ritjoslas saskarne) === 
   Minimalist scrollbar to avoid visual clutter. (Minimālistiska ritjosla vizuālā trokšņa mazināšanai.) */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: #050505;
}
::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 10px;
}

/* === CORE BODY STYLING (Galvenie ķermeņa stili) === 
   Global reset and base font-smoothing for high-DPI displays.
   (Globālā atiestatīšana un bāzes fontu izlīdzināšana augstas izšķirtspējas displejiem.) */
::selection {
    background: var(--accent-gold);
    color: #000;
}

* {
    box-sizing: border-box;
}

/* === MEDIA SCALING (Mediju mērogošana) === 
   Ensures all media assets respect container boundaries and do not cause overflow.
   (Nodrošina, ka mediji ievēro konteinera robežas un neizraisa pārplūdi.) */
img, video {
    max-width: 100%;
    height: auto;
    display: block; /* Prevents unwanted whitespace at the bottom (Novērš nevēlamu tukšumu apakšā) */
    /* Smooth entry for lazy-loaded assets (Plūstoša parādīšanās asinhroni ielādētiem resursiem) */
    transition: opacity 0.5s ease-in-out;
}

/* Background videos must ignore constraints to cover the viewport (Fona video ignorē ierobežojumus pārklāšanai) */
.video-background {
    max-width: none;
}

body {
    margin: 0; padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-top: 0;
    font-size: clamp(14px, 1vw + 10px, 24px);
    min-height: 100vh;
    /* Support for high-contrast/e-ink displays (Atbalsts augsta kontrasta/e-ink displejiem) */
    color-scheme: dark;
}

/* CLS Fix: Ensure the injection targets have height before JS execution 
   (CLS labojums: Nodrošina augstumu mērķa elementiem pirms JS izpildes) */
#header { min-height: 80px; display: block; }
#footer { min-height: 250px; display: block; }

/* Respect Reduced Motion preferences (Ievērot samazinātas kustības preferences) */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
    }
}

/* === NAVIGATION ARCHITECTURE (Navigācijas arhitektūra) ===
   Applied backdrop-filter to maintain text contrast over dynamic high-contrast video backgrounds.
   (Lietots backdrop-filter, lai saglabātu teksta kontrastu virs dinamiskiem video foniem.) */
.navbar {
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: sticky; /* Frozen at the top during scroll (Sastinguši augšā ritināšanas laikā) */
    top: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 1000;
    padding: clamp(10px, 1.5vh, 20px) 0;
    transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, backdrop-filter 0.4s ease;
    border-bottom: 1px solid var(--glass-border);
    min-height: 80px;
    contain: size layout; /* Helps browser layout calculations (Palīdz pārlūka izkārtojuma aprēķiniem) */
}

.navbar.scrolled {
    /* Narrower and more transparent on scroll (Šaurāks un caurspīdīgāks ritinot) */
    padding: 8px 0; 
    background-color: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(20px);
}

/* --- SECTION-BASED NAVBAR THEMES (Sekciju bāzētas navigācijas tēmas) --- 
   Subtle color shifts to enhance immersion without breaking the glass aesthetic.
   (Maigas krāsu pārejas imersijas uzlabošanai, nesabojājot stikla estētiku.) */
.navbar.nav-theme-about { background-color: rgba(0, 30, 60, 0.6); }
.navbar.nav-theme-excel { background-color: rgba(60, 45, 10, 0.6); }
.navbar.nav-theme-lab { background-color: rgba(10, 50, 40, 0.6); }
.navbar.nav-theme-contact { background-color: rgba(45, 10, 10, 0.6); }

/* Scrolled state variants for themes (Tēmu varianti ritināšanas stāvoklī) */
.navbar.scrolled.nav-theme-about { background-color: rgba(0, 30, 60, 0.3); }
.navbar.scrolled.nav-theme-excel { background-color: rgba(60, 45, 10, 0.3); }
.navbar.scrolled.nav-theme-lab { background-color: rgba(10, 50, 40, 0.3); }
.navbar.scrolled.nav-theme-contact { background-color: rgba(45, 10, 10, 0.3); }

/* --- READING PROGRESS INDICATOR (Lasīšanas progresa indikators) --- */
.reading-progress-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1001;
}
.reading-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold));
    box-shadow: 0 0 10px var(--accent-gold);
    transition: width 0.1s ease-out;
}

.navbar-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--fluid-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Scenario Z/Y/X Force: Never wrap header (Nekad nepārlūst galvene) */
    gap: 15px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    font-size: clamp(16px, 4vw, 22px); /* Adaptive logo size (Adaptīvs logo izmērs) */
    color: var(--accent-gold);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    gap: 12px;
    letter-spacing: 1.2px;
    user-select: none;
    transition: color var(--transition-speed) ease;
    outline: none;
    white-space: nowrap; /* Prevents name wrapping (Novērš vārda pārlūšanu) */
    flex-shrink: 1; /* Allows logo area to shrink instead of overlapping menu (Ļauj logo zonai sarauties, nevis pārklāt izvēlni) */
}

.navbar-logo:hover {
    color: #fff;
}

.logo-img {
    height: 42px;
    width: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform var(--transition-speed) ease;
}

.logo-img:hover {
    transform: scale(1.1);
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: var(--navbar-gap);
    margin: 0;
    padding: 0;
    flex-wrap: nowrap; /* Scenario Y Lock (Y scenārija fiksācija) */
}

.navbar-menu li {
    position: relative;
}

.navbar-menu li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    transition: color var(--transition-speed) ease;
    position: relative;
    font-weight: 500;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: clamp(12px, 1vw, 15px);
    white-space: nowrap;
}

/* === SCENARIO-SPECIFIC OVERRIDES (Scenāriju specifiskie labojumi) === */

/* Micro Scenario: Smartwatches (< 280px) */
[data-scenario="watch"] .navbar-logo {
    font-size: 0; /* Hide text, show only logo icon (Slēpj tekstu, rāda tikai ikonu) */
}
[data-scenario="watch"] .hero-subtitle, 
[data-scenario="watch"] .video-background {
    display: none; /* Pulksteņos video un garus tekstus nerādām jaudas taupībai */
}

/* Fix for Small Phones (Mazie telefoni < 360px) */
[data-scenario="phone-small"] .navbar-logo {
    font-size: 11px;
    gap: 4px;
}
[data-scenario="phone-small"] .navbar-logo span {
    letter-spacing: 0.5px;
}
[data-scenario="phone-small"] .logo-img {
    height: 30px;
    width: 30px;
}
[data-scenario="phone-small"] .navbar-container {
    padding: 0 8px !important;
    gap: 5px;
}
[data-scenario="phone-small"] .lang-btn {
    padding: 4px 6px;
    font-size: 9px;
}

/* Fix for Large Displays / Projectors (Projektori un TV) */
[data-scenario^="pc-large"], 
[data-scenario^="projector"], 
[data-scenario^="tv"] {
    --container-max-width: 2200px;
    font-size: 22px;
}

[data-scenario="tv-ultra"] {
    --container-max-width: 3200px;
    font-size: 28px;
}

/* Unified spacing across scenarios (Unificētas atstarpes) */
.container, .page-content, .projects-container, .contact-container {
    max-width: var(--container-max-width) !important;
    padding-left: var(--fluid-padding) !important;
    padding-right: var(--fluid-padding) !important;
}

/* Responsive Grid Scaling (Režģa mērogošana) */
@media (min-width: 1920px) {
    .contact-grid, .projects-grid, .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)) !important;
    }
}

/* --- UNIFIED CONTAINER SYSTEM (Unificēta konteineru sistēma) --- 
   Strict grid boundaries to ensure architectural alignment across all sub-pages.
   (Stingras režģa robežas, lai nodrošinātu arhitektonisku līdzinājumu visās apakšlapās.) */
.container, .page-content, .projects-container, .contact-container {
    max-width: var(--container-max-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--fluid-padding) !important;
    padding-right: var(--fluid-padding) !important;
    width: 100%;
    box-sizing: border-box; /* Ensures padding doesn't add to width (Nodrošina, ka padding nepalielina platumu) */
}

/* --- REFINED LANG SWITCHER (Uzlabots valodu slēdzis) --- */
.lang-switcher { 
    display: flex; 
    gap: 5px; 
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0; /* Prevents switcher from squishing (Novērš slēdža saspiešanu) */
    touch-action: manipulation; /* Optimizes mobile click response (Optimizē klikšķa reakciju mobilajās ierīcēs) */
}
.lang-btn { 
    background: none; border: none; 
    color: var(--text-muted); cursor: pointer; 
    padding: 6px 12px; border-radius: 50px;
    font-size: 11px; transition: all 0.3s ease;
    font-weight: 700; text-transform: uppercase;
    touch-action: manipulation;
}
.lang-btn.active { background: var(--accent-gold); color: #000; }
.lang-btn:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.1); }

/* Accessibility focus states (Pieejamības fokusa stāvokļi) */
.navbar-menu li a:focus-visible, 
.btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 4px;
}

/* === LOADING STATES / PRELOADER (Ielādes stāvokļi) === 
   Prevents FOUC (Flash of Unstyled Content) and ensures all assets are context-ready.
   (Novērš FOUC un nodrošina, ka visi resursi ir gatavi kontekstam.) */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #050505;
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease; /* Removed non-composited visibility transition (Noņemta visibility animācija) */
    pointer-events: all;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-circle {
    width: 50px; height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === UX UTILITIES (UX palīgrīki) === 
   Enhances vertical mobility in long-scrolling layouts.
   (Uzlabo vertikālo mobilitāti garos ritināšanas izkārtojumos.) */
.scroll-to-top {
    position: fixed;
    bottom: clamp(20px, 4vh, 40px); 
    right: clamp(20px, 4vw, 40px);
    width: 45px; height: 45px;
    background: rgba(212, 175, 55, 0.1); /* Subtle gold tint (Smalks zelta tonis) */
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--accent-gold);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    z-index: 100;
    opacity: 0; visibility: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
    touch-action: manipulation;
}

.scroll-to-top.visible { opacity: 1; visibility: visible; }
.scroll-to-top:hover { 
    transform: translateY(-8px); 
    background: var(--accent-gold); 
    color: #000;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

/* === ANIMATION ENGINE (Animāciju dzinējs) === */
.main-wrapper {
    transition: opacity 0.5s ease-in-out;
    /* Hardware acceleration for smoother animations (Aparatūras paātrināšana gludākām animācijām) */
    backface-visibility: hidden;
    perspective: 1000px;
}

/* --- ENHANCED CTA MODULES (Uzlaboti CTA moduļi) --- 
   High-frequency pulse animation to guide user conversion flow. (Augstas frekvences pulsa animācija lietotāja konversijas vadībai.) */
.btn-transform {
    background: linear-gradient(135deg, #bf953f 0%, #fcf6ba 45%, #b38728 70%, #fbf5b7 100%);
    background-size: 200% auto;
    color: #000 !important;
    font-weight: 800 !important;
    padding: clamp(1rem, 2vw, 1.5rem) clamp(2.5rem, 5vw, 4.5rem) !important;
    border: none;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3), 0 0 0 1px rgba(212, 175, 55, 0.5);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: goldPulse 2s infinite, shineGradient 3s linear infinite;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    touch-action: manipulation;
}

.btn-transform:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 50px rgba(212, 175, 55, 0.5);
    filter: brightness(1.1);
}

@keyframes goldPulse { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6); } 70% { box-shadow: 0 0 0 20px rgba(212, 175, 55, 0); } 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); } }
@keyframes shineGradient { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

/* --- LOGIC VISUALIZATION (Loģikas vizualizācija) --- */
.terminal-window {
    background: #000;
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    color: #00ff88;
    min-height: 120px;
    border: 1px solid #333;
    margin-top: 1rem;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.05);
    line-height: 1.5;
    font-size: 0.9rem;
    overflow-y: auto;
}

/* Terminal buttons decoration (Termināļa pogu dekorācija) */
.terminal-window::before {
    content: '● ● ●';
    position: absolute;
    top: 8px;
    left: 12px;
    color: #444;
    font-size: 9px;
    letter-spacing: 2px;
}

.terminal-window::after {
    content: " ";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.typewriter-text {
    color: var(--accent-gold);
    border-right: none;
    position: relative;
    padding-right: 8px;
}

.typewriter-text::after {
    content: "";
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 2px;
    background-color: var(--accent-gold);
    animation: cursor-blink 0.75s infinite;
}

/* --- TERMINAL LOADER (Termināļa ielādētājs) --- */
.terminal-loader {
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 10px;
    font-style: italic;
}

@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.navbar-menu li a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--accent-gold);
    /* Transition optimized with cubic-bezier for a premium "heavy" feel (Pāreja optimizēta premium "smaguma" sajūtai) */
    transition: width 0.4s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.4s ease;
}

.navbar-menu li a:hover {
    color: var(--accent-gold);
}

.navbar-menu li a.active {
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* --- ACTIVE LINK INDICATOR (Aktīvās saites indikators) --- */
.navbar-menu li a.active::after {
    width: 100%;
    box-shadow: 0 0 20px var(--accent-gold), 0 0 5px #fff;
}

.navbar-menu li a:hover::after {
    width: 100%;
}

/* === RESPONSIVE MODIFIERS (Responsīvie modifikatori) === 
   Adaptive layout adjustments for mobile and ultra-wide displays.
   (Adaptīvie izkārtojuma pielāgojumi mobilajiem un ultra-platiem displejiem.) */
.navbar-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    touch-action: manipulation;
}

/* ================= ADAPTIVE LAYOUTS (ADAPTĪVIE IZKĀRTOJUMI) ================= */

/* SCENARIO X: Small Screens < 992px (Mobile/Small Tablets) */
@media (max-width: 991px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-container {
        justify-content: space-between;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .navbar-logo {
        flex: 1; /* Allows logo to take available space but shrink (Ļauj logo pielāgoties) */
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        gap: 15px;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 5, 5, 0.98);
        padding: 20px;
        border-top: 1px solid var(--glass-border);
        backdrop-filter: blur(15px);
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-menu li {
        width: 100%;
    }

    .lang-switcher {
        padding: 2px; /* More compact for mobile (Kompaktāks mobilajā) */
    }
}

/* SCENARIO Y: Medium Screens 992px - 1300px (Tablets/Laptops) */
@media (min-width: 992px) and (max-width: 1300px) {
    :root {
        --navbar-gap: clamp(0.4rem, 1vw, 0.8rem); /* Tighter gaps for mid-range screens (Ciešākas atstarpes vidējiem ekrāniem) */
        --fluid-padding: clamp(10px, 2.5vw, 30px); /* Reduced container padding to gain space (Samazinātas malas atstarpes brīvībai) */
    }
    .navbar-container {
        gap: 10px;
    }
    .navbar-menu li a {
        font-size: clamp(10px, 1.1vw, 13px); /* Fluidly scale down menu text (Plūstoši samazina izvēlnes tekstu) */
        gap: 4px; /* Tighter icon-text gap (Ciešāka ikonas un teksta atstarpe) */
    }
    .navbar-logo {
        font-size: clamp(15px, 1.7vw, 19px); /* Fluidly scale down logo text (Plūstoši samazina logo tekstu) */
        gap: 8px; /* Compact logo layout */
    }
}

/* Large Scale Media: Optimization for 4K TVs and Projectors (Lielformāta mediji: Optimizācija 4K TV un projektoriem) */
@media (min-width: 2500px) {
    :root {
        font-size: 24px; 
    }
    :root {
        --container-max-width: 2200px;
    }
}

/* ================= ACCESSIBILITY ================= */
.navbar-menu li a:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* ================= UTILS ================= */
.hidden {
    display: none !important;
}

/* === VIDEO ARCHITECTURE (Video arhitektūra) === 
   Layered stacking to maintain contrast between dynamic assets and UI text.
   (Slāņots steks, lai saglabātu kontrastu starp dinamiskajiem resursiem un UI tekstu.) */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform; /* Hint for browser hardware acceleration (Mājiens pārlūkam par aparatūras paātrināšanu) */
    background-color: #050505; /* Solid color while loading (Krāsa ielādes laikā) */
    z-index: -2;
    filter: brightness(0.55) contrast(1.1);
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, #000000 98%);
    z-index: -1;
    pointer-events: none;
    animation: ambientPulse 10s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.contact-container h1, .section-title, .hero-title {
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
}

.main-wrapper {
    position: relative;
    z-index: 1;
    padding-bottom: 5rem;
}

/* === CONTACT & FORM MODULES (Kontaktu un formu moduļi) === 
   Implements ergonomic input feedback and interactive mapping logic.
   (Ievieš ergonomisku ievades atgriezenisko saiti un interaktīvu kartēšanas loģiku.) */
.contact-container {
    /* Boost rendering performance for complex layouts (Uzlabot renderēšanas veiktspēju sarežģītiem izkārtojumiem) */
    content-visibility: auto;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--section-padding) clamp(20px, 5vw, 60px);
}

.contact-container h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-align: center;
    margin-bottom: 4rem;
    background: linear-gradient(to right, #fff, var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px;
    font-weight: 700;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Better fit for small phones (Labāk maziem telefoniem) */
    gap: 2.5rem;
    margin-bottom: 5rem;
}

.contact-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact-card:hover {
    transform: translateY(-12px);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.2), 0 0 20px rgba(212, 175, 55, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.contact-icon {
    font-size: 3rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.contact-info h3 {
    font-family: 'Space Grotesk', sans-serif;
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: #fff;
}

.contact-info p, .contact-info a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.05rem;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--accent-gold);
}

.badge-container {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 5rem;
    flex-wrap: wrap;
}

.id-badge {
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid var(--glass-border);
    padding: 1.2rem 2.5rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    backdrop-filter: blur(20px);
}

.id-badge:hover {
    border-color: var(--accent-gold);
    transform: translateY(-8px);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.15);
}

.contact-form-wrapper {
    max-width: 850px;
    margin: 0 auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 4vw, 4rem); /* Fluid form padding (Plūstošas formas atstarpes) */
    border-radius: 40px;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.contact-form h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 3rem;
    text-align: center;
}

.form-group {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
}

.form-group:focus-within label {
    color: var(--accent-blue);
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(0, 198, 255, 0.4);
}

.form-group input, .form-group textarea {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 20px;
    border-radius: 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 15px 35px rgba(0, 198, 255, 0.15), 0 0 0 4px rgba(0, 198, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-4px);
}

/* Shake Animation for Errors (Krratīšanās animācija kļūdām) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.input-error {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #ff416c !important;
    box-shadow: 0 0 15px rgba(255, 65, 108, 0.3) !important;
}

.success-message {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-top: 1.5rem;
    color: #00ff88;
    font-weight: 700;
    text-align: center;
    padding: 0 1rem;
    border-radius: 12px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-message.visible {
    opacity: 1;
    max-height: 100px;
    padding: 1rem;
}

#map {
    height: 450px;
    width: 100%;
    border-radius: 30px;
    margin-bottom: 5rem;
    border: 1px solid var(--glass-border);
    filter: grayscale(1) invert(1) brightness(0.7) contrast(1.2);
    overflow: hidden;
}

/* Testimonials Avatar Style */
.author-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    font-size: 14px;
}
