/* ===================================
   NEXA SYSTEM - ZOPTYMALIZOWANY CSS
   =================================== */

/* --- 1. ZMIENNE & RESET --- */
:root {
    --bg: #F4F4F4; 
    --ink: #050505; 
    --line: #1A1A1A;
    --accent: #0044FF; 
    --font-head: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-head);
    overflow-x: hidden;
}

/* --- 2. KLASY GLOBALNE & UTILITIES --- */
.grid-container {
    max-width: 1600px; 
    margin: 0 auto;
    border-left: 1px solid var(--line); 
    border-right: 1px solid var(--line);
    background: var(--bg);
}

.mono { 
    font-family: var(--font-mono); 
    text-transform: uppercase; 
    font-size: 0.8rem; 
    letter-spacing: 0.5px; 
}

.hover-invert { transition: 0.2s; }
.hover-invert:hover { 
    background: var(--line); 
    color: var(--bg); 
    border-color: var(--bg); 
}
.hover-invert:hover span, 
.hover-invert:hover .mono { color: var(--bg); }
.hover-invert-bg:hover { background: var(--bg); color: var(--line); }

.full-width { width: 100%; }

/* --- 3. CURSOR & PRELOADER --- */
.cursor {
    width: 15px; 
    height: 15px; 
    background: var(--accent);
    position: fixed; 
    pointer-events: none; 
    z-index: 9999;
    border-radius: 0; 
    transform: translate(-50%, -50%); 
    mix-blend-mode: exclusion;
}

.preloader {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: var(--ink); 
    color: var(--bg);
    display: flex; 
    align-items: flex-end; 
    padding: 50px;
    z-index: 10000;
}

.blink { animation: blink 1s infinite; color: #00FF00; }
.blink-dot { color: #00FF00; font-size: 1.2rem; line-height: 0; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- 4. NAWIGACJA & MENU --- */
.nav-area {
    display: flex; 
    height: 70px; 
    border-bottom: 1px solid var(--line);
    position: sticky; 
    top: 0; 
    background: var(--bg); 
    z-index: 100;
    justify-content: space-between;
}

.logo {
    flex: 0 0 200px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.5rem; 
    font-weight: 700; 
    border-right: 1px solid var(--line);
}
.reg { font-size: 0.8rem; vertical-align: top; margin-left: 5px; opacity: 0.6; }

.nav-menu { flex: 1; display: flex; }
.nav-menu a {
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    text-decoration: none; 
    color: var(--ink); 
    border-right: 1px solid var(--line);
    font-size: 0.85rem; 
    font-weight: 500;
}

.nav-cta {
    flex: 0 0 250px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background: var(--ink); 
    color: var(--bg); 
    cursor: pointer; 
    text-decoration: none;
}

.hamburger {
    display: none;
    flex: 0 0 70px; 
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-right: 1px solid var(--line);
    z-index: 1001; 
}
.hamburger .bar {
    width: 25px; height: 2px; background-color: var(--ink); transition: all 0.3s ease-in-out;
}
.hamburger.active { background: var(--ink); border-color: var(--ink); }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); background-color: var(--bg); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background-color: var(--bg); }

.mobile-menu-overlay {
    position: fixed; top: 70px; left: 0; width: 100%; height: calc(100vh - 70px);
    background: var(--bg); z-index: 99; transform: translateX(100%); 
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    border-left: 1px solid var(--line); display: flex; flex-direction: column;
}
.mobile-menu-overlay.active { transform: translateX(0); }
.mobile-links { display: flex; flex-direction: column; height: 100%; }
.sys-status { padding: 20px; border-bottom: 1px solid var(--line); color: var(--line); opacity: 0.5; font-size: 0.7rem; }
.mobile-links a {
    padding: 30px; border-bottom: 1px solid var(--line); text-decoration: none;
    color: var(--ink); font-size: 1.2rem; font-weight: 700; transition: 0.2s;
}
.mobile-links a:hover { background: var(--ink); color: var(--bg); padding-left: 40px; }
.mobile-footer { margin-top: auto; padding: 20px; font-size: 0.7rem; color: var(--line); opacity: 0.5; border-top: 1px solid var(--line); }

/* --- 5. HERO SECTION --- */
.hero-area { height: 80vh; position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2072&auto=format&fit=crop') center/cover;
    filter: grayscale(100%) contrast(120%) brightness(0.6);
}
.hero-overlay {
    position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; 
    justify-content: space-between; padding: 40px; color: var(--bg);
}
.hero-title { font-size: 7vw; line-height: 0.85; letter-spacing: -2px; text-transform: uppercase; }
.hero-status { border-top: 1px solid rgba(255,255,255,0.3); padding-top: 20px; display: flex; gap: 40px; opacity: 0.8; }

/* --- 6. SCOPE BAR --- */
.scope-bar { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--bg); }
.scope-item {
    padding: 20px 25px; border-right: 1px solid var(--line); display: flex; flex-direction: column;
    justify-content: center; gap: 8px; transition: background 0.2s, color 0.2s; min-height: 100px; 
}
.scope-item:last-child { border-right: none; }
.label-tiny { font-size: 0.65rem; color: var(--line); opacity: 0.6; letter-spacing: 1px; }
.scope-val { font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; text-transform: uppercase; line-height: 1.1; color: var(--ink); }
.active-status { color: var(--ink); display: flex; align-items: center; gap: 8px; }

.scope-item:hover { background: var(--ink); }
.scope-item:hover .label-tiny, .scope-item:hover .scope-val, .scope-item:hover .active-status { color: var(--bg); opacity: 1; }

/* --- 7. SEKJE GLOBALNE (HEADERS) --- */
.section-header { padding: 15px 40px; border-bottom: 1px solid var(--line); background: #eee; }

/* --- 8. KALKULATOR RYZYKA --- */
.calc-section { border-bottom: 1px solid var(--line); }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 400px; }
.calc-inputs { border-right: 1px solid var(--line); padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.check-box {
    display: flex; align-items: center; gap: 20px; cursor: pointer; padding: 20px;
    border: 1px solid var(--line); transition: 0.2s;
}
.check-box input { display: none; }
.checkmark { width: 20px; height: 20px; border: 2px solid var(--line); display: inline-block; position: relative; }
.check-box input:checked + .checkmark { background: var(--line); }
.check-box input:checked + .checkmark::after {
    content: 'X'; color: var(--bg); position: absolute; top: 50%; left: 50%; 
    transform: translate(-50%, -50%); font-family: monospace; font-size: 14px;
}
.calc-output { padding: 40px; display: flex; flex-direction: column; justify-content: center; background: var(--ink); color: var(--bg); }
.risk-level { font-size: 3rem; font-weight: 700; margin: 20px 0; }
.risk-bar { width: 100%; height: 10px; background: #333; margin-bottom: 20px; }
.risk-bar .fill { height: 100%; width: 0%; background: #00FF00; transition: 0.5s; }
.msg { opacity: 0.6; }

/* --- 9. PHOTO BREAK --- */
.photo-break { height: 400px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.photo-break img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(140%); }
.photo-caption { position: absolute; bottom: 20px; right: 20px; background: var(--ink); color: var(--bg); padding: 5px 10px; font-size: 0.7rem; }

/* --- 10. STRUKTURA ZESPOŁU --- */
.structure-section { border-bottom: 1px solid var(--line); }
.sys-description { padding: 40px; border-bottom: 1px solid var(--line); background: #fcfcfc; }
.iso-row { display: grid; grid-template-columns: 1.5fr 2fr 1.5fr; border-bottom: 1px solid var(--line); min-height: 120px; }
.iso-row:last-child { border-bottom: none; }
.iso-role { padding: 40px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.iso-role h3 { font-size: 1.5rem; text-transform: uppercase; margin-bottom: 10px; }
.iso-tasks { padding: 40px; border-right: 1px solid var(--line); display: flex; align-items: center; }
.iso-tasks ul { list-style: none; }
.iso-tasks li { margin-bottom: 5px; }
.iso-status { padding: 30px; display: flex; align-items: center; justify-content: center; background: #f4f4f4; border-left: 1px solid var(--line); }
.status-content { text-align: right; display: flex; flex-direction: column; gap: 5px; }
.label-small { font-size: 0.65rem; opacity: 0.5; display: block; }
.status-main { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; color: var(--ink); letter-spacing: -1px; }
.status-sub { font-size: 0.75rem; color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

/* --- 11. HISTORIA WERSJI (LOG) --- */
.log-section { border-bottom: 1px solid var(--line); }
.timeline-container { padding: 60px 40px; border-left: 1px solid var(--line); margin-left: 40px; }
.log-entry { position: relative; padding-left: 40px; margin-bottom: 60px; }
.log-entry:last-child { margin-bottom: 0; }
.log-entry::before {
    content: ''; position: absolute; left: -5px; top: 5px;
    width: 10px; height: 10px; background: var(--bg); border: 1px solid var(--line);
}
.log-entry.active::before { background: #00FF00; }
.log-date { color: var(--ink); margin-bottom: 10px; opacity: 0.7; }
.log-content h4 { font-size: 1.5rem; margin-bottom: 10px; text-transform: uppercase; }

/* --- 12. MIGRACJA (PROCEDURA) --- */
.migration-section { border-bottom: 1px solid var(--line); }
.migration-grid { display: flex; align-items: stretch; }
.mig-step { flex: 1; padding: 40px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.mig-arrow { width: 60px; display: flex; align-items: center; justify-content: center; font-size: 2rem; border-right: 1px solid var(--line); background: #eee; }
.step-id { display: block; margin-bottom: 20px; color: var(--accent); }
.mig-step h3 { font-size: 1.8rem; margin-bottom: 15px; }

/* --- 13. PRECYZJA & TECH STACK --- */
.precision-section { border-bottom: 1px solid var(--line); }
.precision-grid { display: grid; grid-template-columns: 1fr 1fr; }
.precision-text { padding: 80px; display: flex; flex-direction: column; justify-content: center; }
.precision-text h2 { font-size: 5rem; line-height: 0.9; margin-bottom: 40px; }
.precision-img { border-left: 1px solid var(--line); }
.precision-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); display: block; }

.tech-stack-section { border-bottom: 1px solid var(--line); padding-bottom: 40px; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; padding: 40px; text-align: center; color: #888; }
.tech-item { border: 1px solid #ddd; padding: 20px; }

/* --- 14. KONTAKT & STOPKA --- */
.contact-section { border-bottom: 1px solid var(--line); }
.contact-container { display: grid; grid-template-columns: 1fr 1fr; }
.contact-info { padding: 60px 40px; border-right: 1px solid var(--line); }
.info-block { margin-bottom: 40px; }
.info-block p { font-size: 1.5rem; font-weight: 700; }

.contact-form-wrapper { padding: 60px 40px; background: #fafafa; }
.sys-form .form-group { margin-bottom: 30px; display: flex; flex-direction: column; }
.sys-form label { margin-bottom: 10px; opacity: 0.6; font-size: 0.8rem; }
.sys-form input, .sys-form textarea {
    padding: 15px; border: 1px solid var(--line); background: var(--bg);
    font-family: var(--font-mono); outline: none;
}
.btn-sys { background: var(--ink); color: var(--bg); border: none; padding: 20px; cursor: pointer; font-size: 1rem; transition: 0.3s; }
.btn-sys:hover { background: var(--accent); }

.sys-footer { padding: 40px; display: flex; justify-content: space-between; background: #eee; }
.footer-block { display: flex; flex-direction: column; gap: 5px; }
.right { text-align: right; }

/* ===================================
   MEDIA QUERIES - RESPONSIVE DESIGN
   =================================== */

/* Tablet & Smaller Desktops (Max 1100px) */
@media (max-width: 1100px) {
    /* Typografia & Spacing */
    .hero-title { font-size: 3.5rem; word-wrap: break-word; }
    .hero-overlay { padding: 20px; }
    .hero-status { flex-direction: column; gap: 10px; font-size: 0.75rem; }
    
    .section-header, .calc-inputs, .calc-output, .iso-role, .iso-tasks, 
    .mig-step, .precision-text, .contact-info, .contact-form-wrapper { padding: 25px; }
    
    .photo-break, .precision-img { height: 250px; min-height: 250px; }

    /* Układy Grid -> Flex (1 kolumna) */
    .calc-grid, .contact-container, .precision-grid, .migration-grid { display: flex; flex-direction: column; }
    
    .calc-inputs, .contact-info, .precision-text, .mig-step { border-right: none; border-bottom: 1px solid var(--line); }
    .calc-output, .contact-form-wrapper, .precision-img, .mig-step:last-child { border-bottom: none; }
    
    .mig-arrow { display: none; }
    .mig-step { min-height: auto; }

    /* Struktura Zespołu (ISO) */
    .iso-row { display: flex; flex-direction: column; height: auto; border-bottom: 4px solid var(--line); }
    .iso-row:last-child { border-bottom: none; }
    .iso-role, .iso-tasks, .iso-status { border-right: none; border-bottom: 1px solid var(--line); padding: 25px; justify-content: flex-start; }
    .iso-status { background: #f0f0f0; border-bottom: none; }

    /* Logi Systemowe (Timeline) */
    .timeline-container { margin-left: 0; padding: 40px 20px; border-left: none; }
    .log-entry { padding-left: 20px; border-left: 1px solid var(--line); margin-left: 10px; }
    .log-entry::before { left: -5.5px; }
}

/* Mobile & Tablets (Max 900px) */
@media (max-width: 900px) {
    .hero-title { font-size: 12vw; }
    
    /* Navigation */
    .hamburger { display: flex; }
    .nav-menu, .nav-cta { display: none; }
    .logo { flex: 1; border-right: none; justify-content: flex-start; padding-left: 20px; }
    
    /* Scope Bar */
    .scope-bar { grid-template-columns: 1fr 1fr; }
    .scope-item { padding: 15px; min-height: 90px; border-bottom: 1px solid var(--line); }
    .scope-item:nth-child(odd) { border-right: 1px solid var(--line); }
    .scope-item:nth-child(even) { border-right: none; }
    .scope-item:nth-child(3), .scope-item:nth-child(4) { border-bottom: none; }
    .scope-val { font-size: 0.8rem; }
    
    /* Wyrównanie Statusu ISO */
    .status-content { text-align: left; }
    .status-sub { justify-content: flex-start; }
    
    /* Stopka */
    .sys-footer { flex-direction: column; gap: 20px; }
    .right { text-align: left; }
}

/* Małe telefony (Max 500px) */
@media (max-width: 500px) {
    .hero-title { font-size: 2.5rem; }
    .logo { flex: 0 0 140px; font-size: 1.2rem; }
    
    .scope-bar { grid-template-columns: 1fr; }
    .scope-item:nth-child(odd) { border-right: none; }
    
    .sys-footer { gap: 30px; text-align: left; }
}