/* =========================================
   OBSAH:
   1.  Proměnné a Reset
   2.  Layout (Container, Header, Footer)
   3.  Elementy a Komponenty (Tlačítka, Formuláře)
   4.  Sekce: Hero
   5.  Sekce: Služby
   6.  Sekce: Projekty (Grid)
   7.  Podstránka: Detail Projektu
   8.  Podstránka: Kontakt (+ Formulář)
   9.  Podstránka: 404 Error & Thank You
   10. Responsivita & Mobilní Menu
   ========================================= */


/* =========================================
   1. PROMĚNNÉ A ZÁKLADNÍ NASTAVENÍ
   ========================================= */
:root {
    --bg: #ffffff;
    --text: #111111;
    --accent: #1EFF00; /* Neonová zelená */
    --border: #e5e5e5;
    --dark-bg: #0a0a0a;
    --dark-text: #ffffff;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }

/* Pomocná třída pro skrytí elementů na desktopu */
.mobile-break { display: none; }

/* --- NOVÉ: VLASTNÍ BARVA OZNAČOVÁNÍ TEXTU --- */
::selection {
    background-color: var(--accent); /* Neonové pozadí */
    color: #000000; /* Černý text (pro maximální čitelnost na zelené) */
}

::-moz-selection { /* Podpora pro Firefox */
    background-color: var(--accent);
    color: #000000;
}

/* --- OCHRANA OBRÁZKŮ (CSS část) --- */
img {
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

a img {
    pointer-events: auto; 
}


/* =========================================
   2. HLAVNÍ KONTEJNER A HEADER
   ========================================= */
.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 150px;
}

/* Header */
header {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 3000;
    border-bottom: 1px solid var(--border);
    width: 100%;
    padding: 0 max(100px, calc((100% - 1600px) / 2 + 150px));     
    transition: all 0.3s ease;
}

.logo {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    color: var(--text);
    z-index: 3001;
}
.logo .accent { color: var(--accent); }

.desktop-nav ul { display: flex; gap: 40px; }

.nav-link { 
    font-family: 'Manrope', sans-serif;
    font-weight: 700; 
    font-size: 0.9rem; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.nav-link::after, .nav-link.active::after {
    content: ''; position: absolute; width: 0; height: 3px; bottom: -6px; left: 0; background: var(--accent); transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Obal pro pravou část headeru (Tlačítko + Hamburger) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hamburger skrytý na PC */
.hamburger { display: none; }


/* =========================================
   3. KOMPONENTY (TLAČÍTKA, FORMULÁŘE)
   ========================================= */

/* --- SPOLEČNÝ ZÁKLAD PRO VŠECHNA TLAČÍTKA --- */
.btn, .btn-header, .btn-footer, .btn-submit, .btn-outline, .btn-mobile-white {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 16px 36px;
    font-family: 'Manrope', sans-serif; 
    font-weight: 800; 
    font-size: 0.95rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    border-radius: 6px; 
    cursor: pointer; 
    border: none;
    white-space: nowrap;
    
    /* Klíčové pro animaci pozadí */
    background-size: 200% 100%; 
    background-position: 100% 0;
    transition: background-position 0.4s var(--ease-out), color 0.4s var(--ease-out), box-shadow 0.4s ease; 
}

/* 1. Tlačítko v Headeru (Zelená -> Černá) */
.btn-header { 
    background-image: linear-gradient(to right, #000000 50%, var(--accent) 50%);
    color: #000000;
    box-shadow: 0 4px 15px rgba(30, 255, 0, 0.3); 
    padding: 14px 30px;
}
.btn-header:hover { 
    background-position: 0 0; 
    color: #ffffff; 
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); 
}

/* 2. Tlačítko ve Footeru (Bílá -> Zelená) */
.btn-footer { 
    background-image: linear-gradient(to right, #ffffff 50%, var(--accent) 50%); 
    color: var(--text); 
    box-shadow: 0 4px 15px rgba(30, 255, 0, 0.3);
}
.btn-footer:hover { 
    background-position: 0 0; 
    color: var(--text); 
}

/* 3. Tlačítko pro odeslání formuláře (Zelená -> Černá) */
.btn-submit {
    width: 100%; height: 60px; font-size: 1.1rem; letter-spacing: 1px;
    background-image: linear-gradient(to right, var(--accent) 50%, var(--text) 50%);
    color: #ffffff; 
    box-shadow: none;
}
.btn-submit:hover {
    background-position: 0 0; 
    color: var(--text); 
    box-shadow: 0 10px 30px rgba(30, 255, 0, 0.3);
}

/* 4. Outline tlačítko (Průhledné) */
.btn-outline {
    background: transparent; border: 2px solid var(--text); color: var(--text); 
    position: relative; overflow: hidden; z-index: 1; background-image: none;
}
.btn-outline::before { 
    content: ''; position: absolute; top: 0; left: 0; width: 0; height: 100%; 
    background: var(--text); z-index: -1; transition: width 0.3s ease; 
}
.btn-outline:hover { color: #fff; border-color: var(--text); }
.btn-outline:hover::before { width: 100%; }

/* 5. Tlačítko "Navštívit web" (Detail projektu) */
.btn-visit {
    background-color: #111; color: #fff !important; border: 1px solid #111;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 
    background-image: none;
}
.btn-visit svg { width: 20px; height: 20px; transition: transform 0.3s ease; }
.btn-visit:hover {
    background-color: var(--accent); border-color: var(--accent); color: #111 !important; 
    box-shadow: 0 10px 30px rgba(30, 255, 0, 0.2);
}
.btn-visit:hover svg { transform: translate(3px, -3px); }

/* 6. Tlačítko v Mobilním menu (Bílá -> Zelená) */
.btn-mobile-white {
    width: 100%; height: 60px;
    background-image: linear-gradient(to right, #ffffff 50%, var(--accent) 50%);
    background-size: 200% 100%;
    background-position: 0 0; 
    color: #000000; 
}
.btn-mobile-white:hover {
    background-position: 100% 0;
    color: #000; 
    box-shadow: 0 10px 30px rgba(30, 255, 0, 0.2);
}

/* --- Formuláře --- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-group { margin-bottom: 25px; }
.form-group label { display: block; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 0.8rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; color: #999; }

/* FIX: Přidáno resize: none pro textarea */
.contact-form input, .contact-form textarea { 
    width: 100%; padding: 18px; border: 1px solid #eee; border-radius: 6px; background: #fafafa; 
    font-family: inherit; font-size: 1rem; color: var(--text); transition: all 0.3s ease; outline: none;
    
    /* TOTO ZAJISTÍ, ŽE SE POLE NEDÁ ROZTAHOVAT */
    resize: none; 
    overflow-y: auto; /* Pokud je text dlouhý, objeví se posuvník */
}

.contact-form input:focus, .contact-form textarea:focus { background: #fff; border-color: var(--text); box-shadow: 0 0 0 4px rgba(137, 255, 0, 0.2); }
.form-note { margin-top: 20px; font-size: 0.75rem; color: #aaa; text-align: center; }


/* =========================================
   4. SEKCE: HERO
   ========================================= */
.hero {
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    position: relative;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;     
    padding-top: 60px; 
}
.hero::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.4) 100%); z-index: 0;
}
.hero-glow {
    position: absolute; width: 600px; height: 600px; background: var(--accent); filter: blur(150px); opacity: 0.15; z-index: 0; border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; width: 100%; }

.hero h1 { font-size: 5.5rem; font-weight: 800; line-height: 1.4; letter-spacing: -2px; margin-bottom: 30px; }
.hero p { font-size: 1.3rem; color: #555; max-width: 700px; margin: 40px auto; font-weight: 300; }

.typewriter-highlight { background: var(--accent); padding: 0 15px; display: inline-block; transform: skewX(-8deg); font-family: 'Manrope', sans-serif; font-weight: 800; border-radius: 4px; }
.cursor { display: inline-block; width: 4px; height: 0.9em; background-color: var(--text); margin-left: 5px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.scroll-wrapper { margin-top: 60px; display: flex; flex-direction: column; align-items: center; gap: 15px; opacity: 0.6; }
.scroll-text { font-family: 'Manrope', sans-serif; font-size: 0.8rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg); }
.scroll-line { width: 2px; height: 60px; background-color: #e5e5e5; position: relative; overflow: hidden; }
.scroll-line::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #111; animation: dropLine 2s infinite cubic-bezier(0.77, 0, 0.175, 1); }
@keyframes dropLine { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }


/* =========================================
   5. SEKCE: SLUŽBY
   ========================================= */
.services-section { 
    padding-top: 120px;
    padding-bottom: 40px;
}
.section-header { margin-bottom: 60px; max-width: 600px; }
.section-title { font-size: 3rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 20px; }

.services-container {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; width: 100%;
}
.service-panel {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 40px;
    height: 100%; display: flex; flex-direction: column; justify-content: flex-start;
    transition: all 0.3s ease; position: relative; overflow: hidden;
}
.service-panel:hover { transform: translateY(-10px); border-color: var(--accent); box-shadow: 0 20px 40px rgba(0,0,0,0.05); }

/* Aktivní stav (JS Mobile) */
.service-panel.mobile-active { border-color: var(--accent); box-shadow: 0 10px 30px rgba(30, 255, 0, 0.1); transform: scale(1.02); z-index: 2; }
.service-panel.mobile-active .panel-num, .service-panel.mobile-active .panel-icon { color: var(--accent); }

.panel-num { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.2rem; color: #e0e0e0; transition: color 0.3s; }
.panel-icon {
    font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 3rem; color: var(--text);
    height: 80px; display: flex; align-items: center; margin: 20px 0 20px 0; position: relative; transition: color 0.3s, transform 0.3s;
}
.panel-title { 
    font-size: 1.5rem; font-weight: 800; margin-bottom: 15px; color: var(--text); min-height: 60px; display: flex; align-items: flex-start;
}
.panel-desc { font-family: 'Manrope', sans-serif; font-size: 0.95rem; line-height: 1.6; color: #666; flex-grow: 0; }

.service-panel:hover .panel-num, .service-panel:hover .panel-icon { color: var(--accent); }
.service-panel:hover .panel-icon { transform: scale(1.1); }


/* =========================================
   6. SEKCE: PROJEKTY (GRID)
   ========================================= */
.projects-section { padding: 40px 0 80px 0; background: transparent; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 40px; }

.project-card { position: relative; border-radius: 12px; overflow: hidden; cursor: pointer; height: 450px; background: #fff; }
.project-image { width: 100%; height: 100%; background-color: #ddd; background-size: cover; background-position: center; transition: transform 0.8s var(--ease-out); }
.project-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); opacity: 0; transition: opacity 0.4s; display: flex; flex-direction: column; justify-content: flex-end; padding: 40px;
}
.project-title { color: #fff; font-size: 2rem; font-weight: 800; transform: translateY(20px); transition: transform 0.4s; }
.project-category { color: var(--accent); font-family: 'Manrope', sans-serif; font-weight: 700; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 10px; display: block; opacity: 0; transition: opacity 0.4s 0.1s; }
.click-hint { color: #fff; font-family: 'Manrope', sans-serif; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-top: 20px; opacity: 0; transition: opacity 0.4s 0.2s; display: flex; align-items: center; gap: 10px; }
.click-hint::before { content: '+'; color: var(--accent); font-size: 1.2rem; }

.project-card:hover .project-image { transform: scale(1.05); }
.project-card:hover .project-overlay { opacity: 1; }
.project-card:hover .project-title { transform: translateY(0); }
.project-card:hover .project-category { opacity: 1; }
.project-card:hover .click-hint { opacity: 0.7; }


/* =========================================
   7. PODSTRÁNKA: DETAIL PROJEKTU
   ========================================= */
.project-detail-grid {
    display: grid; grid-template-columns: 1.5fr 1fr; gap: 80px; padding-top: 60px; padding-bottom: 100px;
}
.project-gallery { display: flex; flex-direction: column; gap: 30px; }
.project-gallery img { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); }

.project-info { position: sticky; top: 130px; align-self: start; height: auto; }
.project-meta { margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--border); }
.meta-item { margin-bottom: 15px; }
.meta-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #999; font-weight: 700; display: block; margin-bottom: 5px; }
.meta-value { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.project-desc-text { font-size: 1.1rem; line-height: 1.8; color: #555; margin-bottom: 40px; }

.back-link {
    display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: #999; margin-bottom: 40px; transition: color 0.3s;
}
.back-link:hover { color: var(--text); }
.back-link::before { content: '←'; font-size: 1.2rem; transition: transform 0.3s; }
.back-link:hover::before { transform: translateX(-5px); }


/* =========================================
   8. PODSTRÁNKA: KONTAKT
   ========================================= */
.page-header { padding-top: 80px; padding-bottom: 60px; text-align: left; }
.page-title { font-size: 4rem; font-weight: 800; margin-bottom: 20px; line-height: 1.1; }
.page-subtitle { color: #666; font-size: 1.2rem; max-width: 600px; }

.contact-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; width: 100%; margin-bottom: 80px; }
.contact-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 40px; display: flex; flex-direction: column; transition: all 0.3s ease; }
.contact-card:hover { border-color: var(--text); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

.card-role { color: var(--accent); font-family: 'Manrope', sans-serif; font-weight: 800; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; margin-bottom: 15px; display: block; }
.card-name { font-size: 2rem; font-weight: 800; margin-bottom: 20px; line-height: 1.2; }
.focus-list { margin-bottom: 30px; border-top: 1px solid #f0f0f0; padding-top: 20px; }
.focus-list li { font-size: 0.95rem; color: #555; margin-bottom: 8px; padding-left: 15px; position: relative; }
.focus-list li::before { content: '•'; position: absolute; left: 0; color: var(--accent); font-weight: bold; }
.contact-details { margin-top: auto; }
.contact-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.1rem; }
.contact-row a:hover { text-decoration: underline; color: var(--accent); }

.billing-section { background: #fafafa; padding: 80px 0; border-top: 1px solid var(--border); width: 100%; }
.billing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center; }
.billing-item h4 { margin-bottom: 15px; font-weight: 800; font-size: 1.1rem; }
.billing-item p { color: #666; font-size: 0.95rem; line-height: 1.7; }

/* --- POPTÁVKOVÁ SEKCE (Modern Light) --- */
.form-section-modern {
    background-color: #fafafa; 
    padding: 80px 60px;
    border-radius: 24px;
    margin-bottom: 100px;
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* Grid pro rozdělení */
.form-modern-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; 
    gap: 80px;
    align-items: center;
}

/* Text vlevo */
.form-text-side h2 {
    font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 25px; letter-spacing: -1px;
}
.form-text-side p {
    font-size: 1.15rem; color: #666; line-height: 1.7; max-width: 450px;
}
.accent-line {
    width: 60px; height: 4px; background-color: var(--accent); margin-bottom: 25px; border-radius: 4px;
}

/* Karta vpravo */
.form-card-side {
    background: #ffffff; padding: 50px; border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.05); border: 1px solid var(--border);
}

.form-card-side input, .form-card-side textarea, .form-card-side select {
    font-size: 1.05rem; padding: 20px; background: #fcfcfc;
}
.form-card-side input:focus, .form-card-side textarea:focus {
    background: #fff;
}

/* Oprava scrollování pro formulář */
#formular { scroll-margin-top: 130px; }


/* =========================================
   10. FOOTER
   ========================================= */
footer { background-color: var(--dark-bg); color: var(--dark-text); padding: 120px 0 60px 0; border-top: 6px solid var(--accent); width: 100%; }
.footer-wrapper { max-width: 1300px; margin: 0 auto; padding: 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 80px; margin-bottom: 100px; }
.footer-cta { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.footer-cta h2 { font-size: 4.5rem; line-height: 1.1; font-weight: 800; margin-bottom: 30px; letter-spacing: -2px; }
.footer-cta p { font-family: 'Manrope', sans-serif; font-size: 1.2rem; color: #888; margin-bottom: 50px; max-width: 500px; }
.footer-links { display: flex; gap: 80px; justify-content: flex-end; }
.footer-links h4 { color: #fff; margin-bottom: 25px; font-family: 'Manrope', sans-serif; font-weight: 800; }
.footer-links ul { margin-bottom: 40px; }
.footer-links li { margin-bottom: 15px; }
.copyright { border-top: 1px solid #222; padding-top: 40px; text-align: center; color: #555; font-size: 0.9rem; }


/* =========================================
   11. PODSTRÁNKA: 404 ERROR & THANK YOU
   ========================================= */
.error-section {
    min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px; position: relative;
}
.error-section::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,1) 100%); z-index: 0;
}
.error-content { position: relative; z-index: 1; max-width: 1600px; }
.error-code { font-size: 10rem; font-weight: 800; line-height: 1; letter-spacing: -5px; margin-bottom: 20px; color: var(--text); }
.error-code .accent { color: var(--accent); display: inline-block; }
.error-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 15px; }
.error-desc { font-size: 1.1rem; color: #666; margin-bottom: 40px; }

/* --- NOVÉ: ÚPRAVA IKONY ÚSPĚCHU (THANK YOU PAGE) --- */
.success-icon-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px auto;
    box-shadow: 0 0 30px rgba(30, 255, 0, 0.2);
    animation: pulseGlow 2s infinite;
}

.success-icon-wrapper svg {
    width: 40px;
    height: 40px;
    color: var(--accent);
    transform: translate(-2px, 2px); /* Optické vyrovnání */
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(30, 255, 0, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(30, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 255, 0, 0); }
}


/* =========================================
   12. RESPONSIVITA & MOBILNÍ MENU
   ========================================= */
.mobile-nav, 
.mobile-menu-overlay {
    display: none;
}

/* --- Tablet / Menší Laptop (1024px) --- */
@media (max-width: 1024px) {
    .container, header { padding-left: 30px !important; padding-right: 30px !important; }
    .hero h1 { font-size: 4rem; }
    .footer-grid { gap: 40px; }
    .services-container { grid-template-columns: repeat(2, 1fr); }
    .modal-title { font-size: 2.5rem; }
    .project-modal-content { grid-template-columns: 1fr; }
    
    /* --- Úpravy formuláře pro TABLET --- */
    .form-section-modern { padding: 60px 40px; }
    
    /* Změna na jeden sloupec (text nahoře, formulář dole) */
    .form-modern-grid { 
        grid-template-columns: 1fr; 
        gap: 50px; 
    }
    
    /* Vycentrování textu */
    .form-text-side { 
        text-align: center; 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
    }
    
    .form-text-side p { max-width: 600px; }
    
    /* Vycentrování zelené čárky */
    .accent-line { margin: 0 auto 25px auto; }

    /* Omezení šířky formuláře, ať není na tabletu roztažený od kraje ke kraji */
    .form-card-side {
        max-width: 650px; /* Ideální šířka pro tablet */
        width: 100%;
        margin: 0 auto; /* Vycentrování karty */
    }
}

/* --- Tablet na výšku / Větší mobil (900px) --- */
@media (max-width: 900px) {
    /* Skryjeme desktop navigaci */
    .desktop-nav { display: none; }
    
    /* Zobrazíme hamburger */
    .hamburger {
        display: block; position: relative; width: 30px; height: 20px;
        background: transparent; border: none; cursor: pointer; padding: 0; z-index: 3002;
    }
    
    .hamburger span {
        display: block; position: absolute; height: 2px; width: 100%;
        background-color: var(--text); /* Výchozí černá */
        border-radius: 2px; left: 0; transition: all 0.3s ease-in-out; transform-origin: center;
    }
    
    .hamburger span:nth-child(1) { top: 0; }
    .hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
    .hamburger span:nth-child(3) { bottom: 0; }

    /* --- HAMBURGER AKTIVNÍ (Křížek) --- */
    /* Barva křížku musí být BÍLÁ, aby byla vidět na tmavém menu */
    .hamburger.active span:nth-child(1) {
        top: 50%; transform: translateY(-50%) rotate(45deg); background-color: var(--text);
    }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) {
        bottom: 50%; transform: translateY(50%) rotate(-45deg); background-color: var(--text);
    }

    /* --- SIDE DRAWER MENU (Vysouvací panel) --- */
    .mobile-nav {
        display: block; position: fixed; top: 90px; height: calc(100vh - 90px);
        right: 0; width: 320px; max-width: 85%;
        background-color: var(--dark-bg); color: #fff; z-index: 2000;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.4s step-end;
        padding: 40px 30px; border-left: 1px solid #222;
        box-shadow: none; visibility: hidden; /* V základu neviditelné */
    }

    .mobile-nav.active { 
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        visibility: visible;
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s step-start;
    }

    /* Overlay pod menu */
    .mobile-menu-overlay {
        display: block; position: fixed; top: 90px; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
        z-index: 1999; opacity: 0; visibility: hidden; transition: all 0.3s ease;
    }
    .mobile-menu-overlay.active { opacity: 1; visibility: visible; }

    /* Obsah menu */
    .mobile-nav-content { display: flex; flex-direction: column; height: 100%; }
    .mobile-links { list-style: none; margin-bottom: 40px; }
    .mobile-links li { margin-bottom: 20px; opacity: 0; transform: translateY(20px); transition: all 0.4s ease; border-bottom: 1px solid #222; padding-bottom: 15px; }
    
    .mobile-nav.active .mobile-links li:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
    .mobile-nav.active .mobile-links li:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
    .mobile-nav.active .mobile-links li:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
    .mobile-nav.active .mobile-links li:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

    .mobile-links a { 
        font-size: 1.5rem; font-weight: 700; color: #fff; text-decoration: none; display: block; 
        transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .mobile-links a:hover { color: var(--accent); padding-left: 15px; } 

    .mobile-cta p { color: #888; font-size: 0.9rem; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
    .mobile-social { margin-top: auto; display: flex; gap: 20px; }
    .mobile-social a { color: #888; font-weight: 700; font-size: 1.2rem; }
    .mobile-social a:hover { color: var(--accent); }

    /* Layout Responsive */
    .page-title { font-size: 3rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 60px; }
    .footer-cta { align-items: center; }
    .footer-links { justify-content: center !important; flex-wrap: wrap; gap: 40px !important; }
    .contact-cards-grid { grid-template-columns: 1fr; }
    .billing-grid { grid-template-columns: 1fr; gap: 40px; }
    .error-code { font-size: 6rem; letter-spacing: -2px; }
    .error-title { font-size: 1.8rem; }
    .error-section { min-height: 60vh; padding: 60px 20px; }

    /* Detail Projektu Responsive */
    .project-detail-grid { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
    .project-info { order: 1; position: static; border-bottom: 1px solid var(--border); padding-bottom: 40px; margin-bottom: 40px; }
    .project-gallery { order: 2; }
    .project-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* --- Mobil (do 600px) --- */
@media (max-width: 600px) {
    .container, header, .footer-wrapper, .services-section { 
        padding-left: 20px !important; 
        padding-right: 20px !important; 
    }
    .page-header { padding-top: 110px; padding-bottom: 40px; }
    
    header { height: 80px; }
    .logo { font-size: 1.4rem; }
    .btn-header { padding: 10px 16px; font-size: 0.8rem; }

    .hero { min-height: 75vh; padding-top: 40px; }
    .hero h1 { font-size: 2.5rem; line-height: 1.3; letter-spacing: -1px; }
    .typewriter-highlight { display: table; margin: 5px auto 0; white-space: nowrap; font-size: 0.9em; }
    .mobile-break { display: block; } 
    .hero p { font-size: 1.1rem; }
    .hero-glow { width: 300px; height: 300px; filter: blur(100px); }

    .services-container { grid-template-columns: 1fr; gap: 20px; padding: 0 !important; }
    .service-panel { padding: 30px; }
    
    .project-card { height: 350px; }
    .project-overlay { opacity: 1; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
    .project-title { transform: translateY(0); font-size: 1.6rem; }
    .project-category { opacity: 1; }
    .click-hint { opacity: 0.7; }

    footer { padding: 60px 0 30px; }
    .footer-cta h2 { font-size: 2.8rem; }
    .footer-cta p { font-size: 1rem; }
    .footer-links { gap: 30px !important; }

    .page-title { font-size: 2.5rem; }
    .contact-card { padding: 30px; }
    .billing-section { padding: 60px 0; }

    .form-section-modern { 
        padding: 40px 15px; /* Menší vnější okraj šedého boxu */
        border-radius: 16px; 
    }
    
    .form-modern-grid {
        display: flex;
        flex-direction: column; /* Pod sebe */
        gap: 30px;
    }

    .form-text-side { 
        text-align: left; /* Zarovnání doleva je na mobilu čitelnější */
    }
    
    .form-text-side h2 { font-size: 2rem; }

    .form-card-side { 
        padding: 25px 15px; /* Menší vnitřní okraj bílé karty */
        width: 100%;
    }

    /* Zajistí, že inputy nebudou přetékat */
    .form-card-side input, 
    .form-card-side textarea {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box; /* Klíčové pro správnou šířku */
    }

    .form-row { 
        grid-template-columns: 1fr; /* Jméno a Email pod sebe */
        gap: 0; 
    }

    .btn-submit {
        white-space: normal; /* Povolí zalomení textu na dva řádky */
        height: auto; /* Výška se přizpůsobí textu */
        min-height: 60px; /* Ale nebude menší než 60px (pro prst) */
        padding: 15px 10px; /* Menší boční padding */
        font-size: 0.95rem; /* Trochu menší písmo */
        line-height: 1.3; /* Řádkování pro případ zalomení */
    }

    /* Oprava pozice menu a overlay na malém mobilu */
    .mobile-nav, .mobile-menu-overlay { top: 80px; height: calc(100vh - 80px); }
    
    /* Scroll margin menší */
    #formular { scroll-margin-top: 90px; }
}

/* --- Malé telefony (do 380px) --- */
@media (max-width: 380px) {
    .hero h1 { font-size: 2.4rem; }
    .scroll-wrapper { display: none; }
    .btn { width: 100%; }
}
