@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Roboto:wght@300;400&display=swap');

@property --border-angle {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0turn;
}

/* Klatki kluczowe animacji obrotu */
@keyframes neon-spin {
  0% { --border-angle: 0turn; }
  100% { --border-angle: 1turn; }
}

html.hero-is-fullscreen,
html.hero-is-fullscreen body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

html.hero-is-fullscreen #wpadminbar,
html.hero-is-fullscreen #masthead,
html.hero-is-fullscreen .site-header {
    display: none !important;
}

.teh-hero-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    transition: height 1s ease-in-out, width 2s ease-in-out, margin 1s ease-in-out, border-radius 1s ease-in-out;
   background: transparent !important;
    animation: teh_gradient_animation 5s ease infinite; 
}

/* --- WIDEO W TLE --- */
.teh-hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Wideo idealnie wypełni kadr bez spłaszczania */
    z-index: 0;
    pointer-events: none;
}

/* --- NAKŁADKA Z GRADIENTEM MULTIPLY --- */
.teh-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    
    /* Tu przenieśliśmy Twój animowany gradient */
    background: linear-gradient(270deg, #1a2a4b, #1d2b3a, #131d35, #1d2b3a); 
    background-size: 300% 300%;
    animation: teh_gradient_animation 5s ease infinite; 
    
    /* Magia mieszania kolorów z wideo */
    mix-blend-mode: multiply; 
    opacity: 1; 
}

@keyframes teh_gradient_animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.teh-hero-section.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 102vh !important;
    width: 102% !important;
    max-width: 102% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 99998;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    cursor: none;
}

.teh-hero-section.is-settled {
    height: 65vh !important;
    min-height: 450px !important;
    margin: 60px auto !important;
    border-radius: 12px !important;
}

.teh-hero-section #code-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    font-family: 'Courier New', Courier, monospace; font-size: 16px;
    white-space: pre; overflow: hidden; padding: 20px; box-sizing: border-box;
    z-index: 1; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease-out;
    z-index: 2;
}
.teh-hero-section #code-background.is-hidden { opacity: 0; }

.teh-hero-section .hero-content {
    position: relative; z-index: 2; padding: 40px;
    opacity: 0; transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
    width: auto;
    z-index: 3;
}
.teh-hero-section .hero-content.is-visible { opacity: 1 !important; transform: translateY(0) !important; }

.teh-hero-section .hero-content h1 {
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    margin: 0 0 25px 0;
    font-family: 'Fira Code', 'Roboto Mono', 'Courier New', Courier, monospace;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    text-align: justify;
    text-align-last: center;
}

.teh-hero-section .hero-content p {
    margin: 0;
    font-size: 1.3em; 
    font-family: 'Roboto', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: bold;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
    rotate: -3deg;
}
.teh-hero-section .hero-content p .pixel-text {
    font-family: 'Press Start 2P', cursive;
    font-size: .8em; 
    vertical-align: middle;
    margin-right: 0.2em;
    margin-left: 0.5em;
}
.teh-hero-section .hero-content p.aligned-text {
    display: flex;
    align-items: center;
    justify-content: flex-end; 
}

.teh-blinking-square {
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #ffffff;
    margin-bottom: -10px;
    animation: teh_square_blink 1s step-end infinite;
}

@keyframes teh_square_blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Styl dla opóźnionego podtytułu --- */
#hero-subtitle {
    transition: opacity 0.8s ease-in;
}

#hero-subtitle.is-visible {
    opacity: 1 !important;
}

/* --- SEKCJA USŁUG (SERVICES BAR) --- */
/* --- SEKCJA USŁUG (SERVICES BAR) - NOWE BOXY CIEMNE --- */
.teh-services-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center; /* Wyśrodkowanie boxów */
    align-items: stretch; /* Aby boxy miały tę samą wysokość */
    gap: 20px; /* Równy odstęp między kartami */
    padding: 30px 40px;
    z-index: 4;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
    box-sizing: border-box;
}

.teh-services-bar.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.teh-service-item {
    /* Tło i konstrukcja boxa */
    background: rgba(18, 24, 38, 0.7); 
    border: 1px solid rgba(255, 255, 255, 0.3); 
    border-radius: 8px; 
    padding: 15px 25px;
    flex: 1; 
    
    /* Typografia (Stylizowana na nagłówki ze screena) */
    font-family: 'lato', cursive;
    font-size: clamp(1.1rem, 1.5vw, 0.85rem);
    color: #ffffff !important;
    text-align: center; 
    line-height: 1.6;
    
    /* Efekt szkła pasujący do reszty */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    cursor: pointer;
}


/* Efekt Hover - interakcja przy najechaniu */
.teh-service-item:hover {
    border-color: rgba(255, 120, 50, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* --- Responsywność dla urządzeń mobilnych --- */
@media (max-width: 768px) {
    .teh-services-bar {
        flex-direction: column; /* Układa boxy jeden pod drugim */
        padding: 15px 20px;
        gap: 15px;
        position: relative; /* Zdejmuje absolute na mobile, by nie nachodziło na tekst */
    }
    
    .teh-service-item {
        width: 100%;
        text-align: center; /* Na telefonach ładniej wygląda wyśrodkowane */
    }
}

/* --- Style responsywne dla urządzeń mobilnych --- */
@media (max-width: 768px) {

    .teh-hero-section {
        flex-direction: column;
        justify-content: center;
        height: auto !important; /* Pozwala sekcji swobodnie urosnąć w dół */
        min-height: 75vh !important; /* Zapewnia, że boxy nie zostaną obcięte */
        padding-top: 10px;
    }

    .teh-hero-section.is-settled {
        height: auto !important;
        min-height: 75vh !important;
    }

    .teh-blinking-square {
        width: 3px; height: 3px;
    }

    .teh-hero-section .hero-content h1 {
        font-size: clamp(2.1rem, 9vw, 3.53rem);
        text-align: center;
        margin-bottom: 20px;
    }

    .teh-hero-section .hero-content p {
        font-size: 0.8em;
        letter-spacing: 2px; 
    }

    .teh-hero-section .hero-content {
        padding: 20px;
        margin-bottom: 30px; /* Robi solidny odstęp między tekstem a boxami na dole */
    }

    .teh-hero-section .hero-content p.aligned-text {
        justify-content: center;
        margin-right: 0;
        white-space: nowrap;
    }
    
    /* 2. UKŁAD BOXÓW NA DOLE (Siatka 2x2) */
    .teh-services-bar {
        position: relative; 
        bottom: auto; /* Zdejmuje sztywne przypięcie do samego dołu z desktopu */
        flex-direction: row; 
        flex-wrap: wrap; /* Pozwala boxom zawijać się do nowego rzędu */
        width: 100%;
        padding: 0 20px;
        gap: 12px;
    }
    
    .teh-service-item {
        flex: 1 1 45%; /* Tworzy równą siatkę 2x2 */
        font-size: 0.8rem; /* Delikatnie zmniejszony font, by długie słowa się mieściły */
        padding: 15px 12px;
        word-break: break-word; /* Zabezpiecza przed wyjeżdżaniem tekstu z ramek */
    }
}

/* --- Style dla animowanych nagłówków --- */
h1[data-original-text],
h2[data-original-text],
h3[data-original-text],
h4[data-original-text] {
    min-height: 1em;
}

/* --- STYL DLA EFEKTU GLITCH NA NAGŁÓWKACH (WERSJA WZMOCNIONA) --- */
.teh-hero-section h1,
.glitch-hover.uagb-heading-text,
.glitch-hover {
    position: relative !important;
}

.glitch-hover.uagb-heading-text::before,
.glitch-hover.uagb-heading-text::after,
.glitch-hover::before,
.glitch-hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.glitch-hover.uagb-heading-text::before,
.glitch-hover::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    mix-blend-mode: screen; 
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-hover.uagb-heading-text::after,
.glitch-hover::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    mix-blend-mode: screen;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch-hover.is-glitching::before,
.glitch-hover.is-glitching::after {
    opacity: 1;
}

/* --- glow rim --- */

.glow-rim {
    position: relative;
  box-shadow: 0 11px 20px rgba(0, 0, 0, 0.4);
}

/* --- RIM LIGHT (Światło krawędziowe) --- */
.glow-rim::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit; 
  pointer-events: none;
  padding: 1.5px; 
  z-index: 5;
  
  /* KLUCZOWA ZMIANA: Gradient stożkowy (conic-gradient) napędzany zmienną */
  background: conic-gradient(
    from var(--border-angle),
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.05) 60%,
    rgba(255, 255, 255, 0.7) 80%,
    rgba(80, 40, 0, 1) 100%
  );
  
  /* Odpalenie animacji: 4 sekundy, stałe tempo, w nieskończoność */
  animation: neon-spin 4s linear infinite;
  
  /* Maski wycinające środek pozostają bez zmian */
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Wewnętrzny blask dla dodatkowej grubości szkła */
.glow-rim::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit; 
  
  pointer-events: none;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* --- KEYFRAMES DLA ANIMACJI GLITCH --- */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(15% 0 86% 0); transform: translateX(-5px); }
    10% { clip-path: inset(48% 0 50% 0); transform: translateX(3px); }
    20% { clip-path: inset(9% 0 10% 0); transform: translateX(-8px); }
    30% { clip-path: inset(84% 0 1% 0); transform: translateX(5px); }
    40% { clip-path: inset(55% 0 45% 0); transform: translateX(-3px); }
    50% { clip-path: inset(10% 0 50% 0); transform: translateX(8px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translateX(-1px); }
    70% { clip-path: inset(33% 0 33% 0); transform: translateX(4px); }
    80% { clip-path: inset(60% 0 15% 0); transform: translateX(-6px); }
    90% { clip-path: inset(90% 0 1% 0); transform: translateX(1px); }
    100% { clip-path: inset(5% 0 70% 0); transform: translateX(-4px); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(78% 0 2% 0); transform: translateY(2px); }
    10% { clip-path: inset(40% 0 10% 0); transform: translateY(-5px); }
    20% { clip-path: inset(80% 0 5% 0); transform: translateY(5px); }
    30% { clip-path: inset(25% 0 50% 0); transform: translateY(3px); }
    40% { clip-path: inset(5% 0 90% 0); transform: translateY(-7px); }
    50% { clip-path: inset(95% 0 2% 0); transform: translateY(1px); }
    60% { clip-path: inset(30% 0 60% 0); transform: translateY(-4px); }
    70% { clip-path: inset(70% 0 10% 0); transform: translateY(8px); }
    80% { clip-path: inset(15% 0 75% 0); transform: translateY(-2px); }
    90% { clip-path: inset(65% 0 5% 0); transform: translateY(6px); }
    100% { clip-path: inset(45% 0 46% 0); transform: translateY(-3px); }
}