/* =========================================
   --- ZMIENNE GLOBALNE ---
   ========================================= */
:root {
    /* Tła */
    --bg-body: #040404;
    --bg-header: rgba(4, 4, 4, 0.90);
    --bg-article: #1a1a1a;
    --bg-canvas: #050505;
    --bg-hud: rgba(0, 0, 0, 0.7);
    --bg-modal-overlay: rgba(11, 12, 16, 0.95);
    --bg-modal-content: #111;
    
    /* Typografia - Kolory */
    --text-main: #F5F5F7;
    --text-white: #ffffff;
    --text-muted-light: #ccc;
    --text-muted: #888;
    --text-muted-dark: #666;
    --text-labels: #aaa;
    --text-hud: #a7b2d1;
    
    /* Obramowania i Linie */
    --border-dim: #333;
    --border-light: #444;
    --border-canvas: #555;
    --grid-line: #222;
    
    /* Akcenty i statusy */
    --accent-success: #0f0;
    --accent-cyan: #66fcf1;
    --accent-danger: #ff4d4d;
    
    /* Gradienty */
    --grad-sidebar: linear-gradient(90deg, #454546, #454546);
    --grad-sidebar-active: linear-gradient(90deg, #b6ccd1, #11476e);
    --grad-btn-play: linear-gradient(135deg, #137a21 0%, #cbe7c4 100%);
    --grad-btn-primary: linear-gradient(135deg, #7778a1 0%, #2f25c2 100%);
    
    /* Cienie */
    --shadow-btn: 0 4px 15px rgba(17, 71, 110, 0.4);
    --shadow-canvas: -20px 20px 50px rgba(0,0,0,0.8);
    --shadow-input-focus: 0 0 10px rgba(255, 255, 255, 0.1);
    
    /* Typografia - Fonty */
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
}

/* =========================================
   0. SMART HEADER (Znikający pasek)
   ========================================= */
#smart-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-header);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-dim);
    z-index: 2000;
    transform: translateY(0); 
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#smart-header.hidden {
    transform: translateY(-100%);
}

.header-hover-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 35px; 
    z-index: 1999;
}

.header-hover-zone:hover + #smart-header,
#smart-header:hover {
    transform: translateY(0) !important;
}

/* --- Wygląd elementów wewnątrz paska --- */
#smart-header .nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    max-width: 1000px;
    margin: 0 auto;
}

#smart-header .logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-white);
    letter-spacing: 0.05em;
}

#smart-header .nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    transition: color 0.3s ease;
}

#smart-header .nav-links a:hover {
    color: var(--text-white);
}

/* =========================================
   1. BAZA I RESET (Szkielet drutowy)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.75;
}

section {
    padding: 80px 20px;
    border-bottom: 2px solid var(--border-dim);
}

h1, h2, h3 {
    margin-bottom: 15px;
    color: var(--text-white);
}

/* =========================================
   2. SEKCJA 1: HOOK (Czysty, zwykły tekst)
   ========================================= */
#hook-core {
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 780px;
    margin: 0 auto;
    padding: 90px 20px 20px 20px;
}

#hook-core h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--text-white);
    margin-bottom: 10px;
}

#hook-core h2 {
    font-size: 1rem;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0px;
}

#hook-core h3 {
    font-size: 1.2rem;
    color: var(--text-white);
    margin-top: 25px;
    margin-bottom: 10px;
}

#hook-core p {
    font-size: 1.1rem;
    color: var(--text-muted-light);
    margin-bottom: 15px;
    line-height: 1.7;
}

/* =========================================
   3. SEKCJA 2: ASYMETRYCZNY SCROLL (MAGIA)
   ========================================= */
#deep-dive-tech {
    display: flex;
    align-items: flex-start;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

/* LEWA KOLUMNA - PRZYKLEJONA */
.sticky-sidebar-left {
    width: 40%;
    position: sticky;
    height: 100vh;
    padding-left: 70px;
    top: 110px; 
    padding-right: 80px;
}

.sticky-sidebar-left h2:first-child {
    margin-top: 0;
}

/* --- Efekty ScrollSpy --- */
.sticky-sidebar-left h2 {
    margin-bottom: 24px;
    line-height: 1.2;
    background: var(--grad-sidebar); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease; 
}

.sticky-sidebar-left h2.active {
    background: var(--grad-sidebar-active);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* PRAWA KOLUMNA - PRZEWIJANA */
.scrolling-content-right {
    width: 60%;
    padding-left: 40px;
    border-left: 1px solid var(--border-light);
}

.scrolling-content-right article {
    margin-bottom: 22vh;
    padding: 30px;
    background: var(--bg-article);
    border: 1px solid var(--border-dim);
}

.scrolling-content-right article:last-child {
    margin-bottom: 115px; 
}

.scrolling-content-right article h3 {
    margin-top: 45px;
}

.scrolling-content-right article h3:first-of-type {
    margin-top: 0;
}

.scrolling-content-right article p {
    margin-bottom: 22px; 
}

.scrolling-content-right article p:last-of-type {
    margin-bottom: 0;
}

.case-study-body h3 {
    margin-top: 40px;
}

.case-study-body h3:first-of-type {
    margin-top: 0;
}

.feature-list {
    margin-top: 25px;
}

.feature-list li {
    margin-bottom: 20px;
}



/* =========================================
   2.1. MICRO STAR / DEEP DIVE
   ========================================= */
details.tech-spoiler {
    margin: 20px 0;
}

details.tech-spoiler summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-white); 
    margin-bottom: 10px;
}

.spoiler-content {
    color: var(--text-main); 
}


/* =========================================
	3: PINNED SCROLL & 2.5D SIMULATION
   ========================================= */

#simulation-track {
    height: 235vh; 
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.sticky-viewport {
    position: sticky;
    top: 2vh;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 1000px; 
}

.canvas-2-5d-container {
    width: 750px;
    aspect-ratio: 5 / 4; 
    height: auto;
    max-width: 90vw;
    border: 2px solid var(--border-canvas);
    background-color: var(--bg-canvas); 
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 21px 21px; 
    background-position: center center; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    box-shadow: var(--shadow-canvas);
}

.telemetry-hud {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    color: var(--accent-success); 
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.telemetry-hud.visible {
    opacity: 1;
    pointer-events: auto;
}

.action-panel {
    margin-top: 140px;
    opacity: 0; 
    transform: translateY(30px); 
    transition: opacity 0.5s ease, transform 0.5s ease; 
    pointer-events: none; 
}

.action-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; 
}

#play-simulation-btn {
    display: inline-block;
    padding: 16px 42px;
    background: var(--grad-btn-play);
    color: var(--text-white); 
    border: none; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: 4px; 
    box-shadow: var(--shadow-btn); 
    transition: all 0.4s ease;
    cursor: pointer;
}

#play-simulation-btn:hover {
    background: var(--grad-btn-play);
    color: var(--text-white);
    transform: translateY(-3px) scale(1.02); 
}

/* =========================================
   4: THE DEAL
   ========================================= */

#contact {
    padding: 220px 20px; 
    text-align: center;
    border-bottom: none; 
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center; 
}

.cta-container h2 {
    font-size: 2.75rem;
    margin-top: 35px;    
    margin-bottom: 10px;
    color: var(--text-white);
}

.cta-container p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px; 
}

.btn-primary {
    display: inline-block;
    padding: 16px 42px;
    background: var(--grad-btn-primary);
    color: var(--text-white); 
    border: none; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: 4px; 
    box-shadow: var(--shadow-btn); 
    transition: all 0.4s ease;
}

.btn-primary:hover {
    background: var(--grad-btn-primary);
    color: var(--text-white);
    transform: translateY(-3px) scale(1.02); 
}

/* =========================================
   5. FOOTER (Stopka)
   ========================================= */
footer {
    padding: 70px 30px;
    background-color: var(--bg-body);
    font-size: 0.85rem;
    color: var(--text-muted-dark); 
    text-align: center;
}

footer .container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

footer p {
    margin: 0;
    line-height: 1.4;
}

.footer-links {
    color: var(--border-light); 
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin: 0 5px; 
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-white); 
}

/* =========================================
   6. MODALE (Wyskakujące okienka)
   ========================================= */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--bg-modal-overlay);
    backdrop-filter: blur(5px);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
	opacity: 1;
}

.modal-content {
    background-color: var(--bg-modal-content);
    margin: 12vh auto;
    padding: 40px;
    border: 1px solid var(--border-dim);
    width: 90%;
    max-width: 800px;
    position: relative;
	transform: translateY(20px);
	transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: var(--text-muted);
    position: absolute;
    right: 30px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
}

.close-modal:hover {
    color: var(--text-white);
}

.modal-header h2 {
    color: var(--text-white);
}

.modal-body h3 {
    color: var(--text-white);
    margin-top: 20px;
    margin-bottom: 10px;
}

/* =========================================
   7. FORMULARZ KONTAKTOWY 
   ========================================= */

#modal-contact p {
    color: var(--text-muted);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

#contactForm .form-group {
    margin-bottom: 20px;
    text-align: left;
}

#contactForm label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-labels);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#contactForm input, 
#contactForm textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-body); 
    border: 1px solid var(--border-dim); 
    color: var(--text-white); 
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 2px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contactForm input:focus, 
#contactForm textarea:focus {
    outline: none;
    border-color: var(--text-white);
    box-shadow: var(--shadow-input-focus);
}

.full-width {
    width: 100%;
    text-align: center;
    margin-top: 10px;
    cursor: pointer;
}

.antispam-hidden {
    position: absolute;
    opacity: 0;
    z-index: -1;
    height: 0;
    width: 0;
    overflow: hidden;
    left: -9999px;
}

#statusMessage {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted-dark);
    margin-top: 15px;
    text-align: center;
    line-height: 1.4;
}

.form-disclaimer a {
    color: var(--text-labels);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.form-disclaimer a:hover {
    color: var(--text-white);
}

/* =========================================
   8. HUD TELEMETRII (Wizualizacja JS)
   ========================================= */
.hud-box {
    font-family: var(--font-mono); 
    font-size: 0.85rem; 
    color: var(--text-hud); 
    background: #040404;
    padding: 10px; 
    border-left: 2px solid var(--accent-cyan); 
}

.hud-title {
    color: var(--text-white); 
    font-weight: bold;
}

.hud-value-vel {
    color: var(--accent-cyan); 
}

.hud-value-yaw {
    color: var(--text-white); 
}

.hud-value-input {
    color: var(--accent-danger); 
    font-weight: bold;
}

/* =========================================
   9. SYMULACJA 3D (Zmienne Wizualne dla Canvas)
   ========================================= */
#sim-overlay-container {
    opacity: 0;
    transition: opacity 0.5s ease;

    /* Lokalne zmienne specyficzne dla Canvas, korzystające z globalnych akcentów */
    --traj-real-color: rgba(102, 252, 241, 0.9);
    --traj-real-width: 3;

    --agent-color: var(--accent-danger);
    --agent-stroke-color: var(--text-white);
    --agent-stroke-width: 1.5;
    --agent-radius: 6;
}

#sim-overlay-container.visible {
    opacity: 1;
}

/* =========================================
   10. WYKRES TELEMETRII 2D (Lewy Panel)
   ========================================= */
#graph-hud-container {
    /* Pozycjonowanie usunięte z CSS - teraz sterujesz nim w HTML (atrybut style) */
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* Klasa dodawana dynamicznie z JS przy przewijaniu */
#graph-hud-container.visible {
    opacity: 1;
    pointer-events: auto;
}

.graph-box {
    padding-bottom: 15px;
}

.graph-label {
    font-size: 0.7rem;
    margin-top: 15px;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.label-ups {
    color: var(--accent-cyan);
}

.label-yaw {
    color: var(--text-labels);
}

/* NAPRAWA KOLORU OSI: Zmiana na --border-light (#444) */
#ups-graph-canvas,
#yaw-graph-canvas {
    border-bottom: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
}


/* =========================================
   ***** WERSJA MOBILNA (Naprawa SEO i ukrycie 3D) *****
   ========================================= */

.mobile-banner {
    display: none;
}

@media (max-width: 768px) {
    /* 1. UKRYWAMY TYLKO ZŁOŻONE ELEMENTY (Zostawiamy tekst widoczny dla Google) */
    #simulation-track,
    .sticky-sidebar-left {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* 2. ROZSZERZAMY KOLUMNĘ Z TEKSTEM NA PEŁNĄ SZEROKOŚĆ EKRANU */
    .scrolling-content-right {
        width: 100% !important;
        padding-left: 0 !important;
        border-left: none !important;
    }
    
    /* 3. BANNER INFORMACYJNY (Wyświetla się na dole po tekście) */
    .mobile-banner {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        min-height: 40vh !important;
        width: 100% !important;
        padding: 40px 20px !important;
        margin: 0 auto !important;
        border-top: 1px solid var(--border-dim) !important;
    }

    .mobile-banner h2 {
        color: var(--accent-cyan) !important;
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }

    .mobile-banner p {
        color: var(--text-muted) !important;
        font-size: 1rem !important;
        margin-bottom: 15px !important;
    }

    .mobile-banner .btn-primary {
        margin-top: 30px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: inline-block !important;
        text-align: center !important;
    }
}