/* ============================================================
   RESET I PODSTAWY
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 18px;
}

@font-face {
    font-family: 'Saira Semi Condensed';
    src: url('../fonts/SairaSemiCondensed-Medium.ttf') format('truetype');
    font-weight: 500;          /* Medium */
    font-style: normal;
    font-display: swap;        /* Szybsze ładowanie strony (używa systemowej zanim pobierze własną) */
}

body {
    font-family: 'Saira Semi Condensed', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #000000;
    min-height: 100vh;
    overflow-x: hidden;

    /* Tło – gradient lub obraz */
    background: var(--body-bg);
    /* background-image: var(--body-bg-image); */
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

/* Jeśli tło jest obrazem, gradient musi ustąpić */
body[data-bg="image"] {
    background: none;
}

/* ============================================================
   GÓRNA BELKA TYTUŁOWA
   ============================================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    background-color: var(--header-bg-color);
    background-image: var(--header-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    /* Cień – belka "unosi się" nad resztą */
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Overlay na header dla lepszej czytelności tekstu na zdjęciu */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.35) 100%
    );
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
    padding: 20px 40px;
    max-width: 1920px;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: flex-start;      /* logo wyrównane do góry */
    justify-content: space-between;
    gap: 30px;

    /* Tło PNG – wypełnia, nie zniekształca */
    background-image: var(--header-content-bg);
    background-size: cover;            /* wypełnia cały kontener, zachowuje proporcje */
    background-position: var(--header-content-bg-position);
    background-repeat: no-repeat;
}

/* Nakładka kontrolująca przezroczystość tła PNG */
.header-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--header-content-bg);
    background-size: cover;
    background-position: var(--header-content-bg-position);
    background-repeat: no-repeat;
    opacity: var(--header-content-bg-opacity);
    z-index: -1;
    pointer-events: none;
}

.header-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--header-text-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.header-subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--header-text-color);
    opacity: 0.85;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* --- LOGO (lewa strona) --- */
.header-logo {
    flex: 0 0 auto;               /* nie rozciąga się */
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;          /* zachowuje proporcje SVG */
    display: block;
}

/* Nałożenie cienia na logo i grafikę z nazwą */
.header-logo img,
.header-name img {
    /* Parametry: przesunięcie-X, przesunięcie-Y, rozmycie, kolor cienia */
    filter: drop-shadow(0px 6px 6px rgba(0, 0, 0, 0.4));
    
    /* Płynne przejście, jeśli chcesz animować cień na hover */
    transition: filter 0.3s ease;
}

/* Opcjonalnie: efekt po najechaniu myszką (np. rozświetlenie lub większy cień) */
.header-logo img:hover {
    filter: drop-shadow(0px 8px 8px rgba(0, 0, 0, 0.5));
}

/* --- ŚRODEK: nazwa + tagline --- */
.header-center {
    flex: 1 1 auto;               /* wypełnia dostępną przestrzeń */
    display: flex;
    flex-direction: column;
    align-items: center;          /* wyśrodkowanie w poziomie */
    justify-content: center;
    gap: 20px;
    min-width: 0;                 /* pozwala się kurczyć poniżej rozmiaru content */
    padding-top: 10px;             /* lekko obniża względem logo */
}

.header-name {
    width: 500px;
    max-width: 100%;              /* responsywność – nie wyjdzie poza kontener */
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-name img {
    width: 100%;
    height: 100%;
    object-fit: contain;          /* zachowuje proporcje SVG */
    display: block;
}

.header-tagline {
    width: 100%;
    max-width: 700px;
    min-height: 40px;             /* rezerwuje miejsce nawet gdy pusty */
    text-align: center;
    color: var(--header-text-color, #ffffff);
    font-size: 1.5rem;
    line-height: 1.2;
    opacity: 0.8;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

/* --- SPACER (prawa strona) – równoważy logo, żeby środek był idealnie na środku --- */
.header-spacer {
    flex: 0 0 auto;
    width: 200px;                 /* taka sama szerokość jak logo */
    height: 200px;
}

/* ============================================================
   PASEK PRZYCISKÓW (NAV)
   ============================================================ */

.nav-bar {
    position: fixed;
    /* Zachodzi na header do połowy wysokości kafelka
       Kafelek ma ~70px, więc offset = header_height - 35px.
       Robimy to przez calc() z CSS variable */
    top: calc(var(--header-height) - 35px);
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    pointer-events: none; /* przepuszcza kliknięcia na header poza przyciskami */
}

.nav-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1890px;
    width: 100%;
    pointer-events: auto; /* przywracamy interakcję na samych przyciskach */
}

/* ============================================================
   KAFELKI – STYL SZKLANY (GLASSMORPHISM)
   ============================================================ */

.nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 80px;
    width: 150px;
    height: 90px;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--btn-text);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;

    /* Efekt szkła */
    background: var(--btn-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--btn-border);
    box-shadow: var(--btn-shadow);

    /* Animacja unoszenia */
    transition:
        transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease;

    position: relative;
    overflow: hidden;
}

/* Szklany odblask */
.nav-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

/* Hover – kafelek się unosi */
.nav-tile:hover {
    transform: translateY(-6px);
    background: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
    box-shadow: var(--btn-shadow-hover);
}

/* Aktywny kafelek */
.nav-tile.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 30px rgba(0, 200, 235, 0.3), 0 0 15px rgba(0, 200, 235, 0.2);
}

.tile-icon {
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;   /* stała szerokość */
    height: 32px;  /* stała wysokość */
}

/* Styl dla ikonek będących plikami (PNG/SVG jako img) */
.tile-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* zachowuje proporcje */
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* Styl dla bezpośredniego kodu SVG (Inline) */
.tile-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor; /* SVG przyjmuje kolor tekstu przycisku! */
    transition: fill 0.2s ease;
}

/* Animacja ikony na hover (delikatne powiększenie) */
.nav-tile:hover .tile-icon-img,
.nav-tile:hover .tile-icon svg {
    transform: scale(1.15);
}

/* Na hover – zmiana koloru przez filtr */
.nav-tile:hover .tile-icon-img {
    /* Ten filtr zamienia czarny/biały obrazek na #38BDF8 */
    filter: brightness(0) saturate(100%) invert(65%) sepia(75%) saturate(1200%) hue-rotate(165deg) brightness(98%) contrast(97%);
}

.tile-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* ============================================================
   GŁÓWNA PRZESTRZEŃ TREŚCI
   ============================================================ */

.content-area {
    /* Offset: header + połowa kafelka + trochę paddingu */
    margin-top: calc(var(--header-height) + 55px);
    min-height: calc(100vh - var(--header-height) - 55px);
    padding: 10px 20px 60px;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    /* Płynne przejście przy zmianie offsetu (np. resize) */
    transition: margin-top 0.3s ease;
} 

.content-inner {
    color: #000000;
    background: rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 40px 50px;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

/* ============================================================
   ANIMACJA ŁADOWANIA TREŚCI
   ============================================================ */

/* Fade-out */
.content-inner.fade-out {
    animation: contentFadeOut 0.3s ease forwards;
}

/* Fade-in */
.content-inner.fade-in {
    animation: contentFadeIn 0.45s ease forwards;
}

@keyframes contentFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   SPINNER ŁADOWANIA
   ============================================================ */

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   TYPOGRAFIA TREŚCI (dla ładowanych stron)
   ============================================================ */

.page-section {
    color: #000000;
    line-height: 1.7;
}

.page-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000000;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
    padding-bottom: 10px;
}

.page-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 25px 0 12px;
    color: #000000;
}

.page-section p {
    margin-bottom: 15px;
    font-size: 1rem;
    opacity: 0.9;
}

.page-section ul, .page-section ol {
    margin: 10px 0 20px 25px;
}

.page-section li {
    margin-bottom: 6px;
}

.page-section a {
    color: #000000;
    text-decoration: underline;
    text-decoration-color: rgba(138, 180, 248, 0.3);
    transition: color 0.2s, text-decoration-color 0.2s;
}

.page-section a:hover {
    color: #000000;
    text-decoration-color: rgba(174, 203, 250, 0.7);
}

/* Karty / grid w portfolio itp. */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card h4 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: #000000;
}

.card p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============================================================
   STOPKA
   ============================================================ */

.site-footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
    max-width: 1920px;
    margin: 0 auto;
}

/* ============================================================
   UKRYWANIE DANYCH WRAŻLIWYCH
   ============================================================ */

/* Kontener danych kontaktowych */
.reveal-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: opacity 0.15s ease;
}

/* Szklany przycisk "Pokaż" */
.btn-reveal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #38BDF8; /* Twój kolor akcentu */
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.btn-reveal:hover {
    background: rgba(56, 189, 248, 0.09);
    border-color: #38BDF8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Wygląd danych po odkryciu */
.revealed-link {
    color: #38BDF8;
    text-decoration: none;
    font-weight: 500;
    animation: fadeInContact 0.3s ease;
}

.revealed-link:hover {
    text-decoration: underline;
}

@keyframes fadeInContact {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSYWNOŚĆ
   ============================================================ */

/* Tablety */
@media (max-width: 1024px) {
    .header-logo,
    .header-spacer {
        width: 100px;
        height: 100px;
    }

    .header-name {
        width: 380px;
        height: 40px;
    }

    .header-center {
        padding-top: 15px;
        gap: 12px;
    }

    .header-title {
        font-size: 1.2rem;
    }

    .nav-tile {
        min-width: 100px;
        height: 72px;
        padding: 6px 14px;
    }

    .tile-icon {
        font-size: 1.2rem;
    }

    .tile-label {
        font-size: 0.72rem;
    }

    .content-inner {
        padding: 30px 30px;
    }
}

/* Telefony */
@media (max-width: 768px) {
    :root {
        /* Na mobile zmniejszamy header */
    }

    .site-header {
        height: calc(var(--header-height) * 0.65);
    }

    .nav-bar {
        top: calc(var(--header-height) * 0.65 - 28px);
    }

    .header-content {
        padding: 15px 20px;
        gap: 15px;
    }

    .header-logo {
        width: 70px;
        height: 70px;
    }

    .header-spacer {
        display: none;            /* na małych ekranach ukrywamy spacer */
    }

    .header-name {
        width: 280px;
        height: 35px;
    }

    .header-tagline {
        font-size: 0.85rem;
        min-height: 30px;
    }

    .header-center {
        padding-top: 5px;
        gap: 8px;
    }

    .header-title {
        font-size: 1.6rem;
    }

    .header-subtitle {
        font-size: 0.95rem;
    }

    .nav-tile {
        min-width: 70px;
        height: 66px;
        padding: 5px 10px;
        border-radius: 12px;
        gap: 2px;
    }

    .nav-buttons {
        gap: 8px;
    }

    .tile-icon {
        font-size: 1.1rem;
    }

    .tile-label {
        font-size: 0.65rem;
    }

    .content-area {
        margin-top: calc(var(--header-height) * 0.65 + 50px);
        padding: 15px 10px 40px;
    }

    .content-inner {
        padding: 25px 18px;
        border-radius: 14px;
    }

    .page-section h2 {
        font-size: 1.5rem;
    }
}

/* Bardzo małe ekrany */
@media (max-width: 480px) {
    .site-header {
        height: calc(var(--header-height) * 0.5);
    }

    .nav-bar {
        top: calc(var(--header-height) * 0.5 - 25px);
        padding: 0 8px;
    }

    .header-title {
        font-size: 1.1rem;
    }

    .header-subtitle {
        font-size: 0.7rem;
        display: none; /* Ukrywamy na bardzo małych ekranach */
    }

    .header-logo {
        width: 50px;
        height: 50px;
    }

    .header-name {
        width: 200px;
        height: 30px;
    }

    .header-tagline {
        display: none;            /* ukrywamy tagline na bardzo małych */
    }

    .nav-tile {
        min-width: 52px;
        height: 50px;
        padding: 4px 7px;
        border-radius: 10px;
    }

    .nav-buttons {
        gap: 6px;
    }

    .tile-label {
        font-size: 0.58rem;
    }

    .content-area {
        margin-top: calc(var(--header-height) * 0.5 + 45px);
        padding: 10px 6px 30px;
    }

    .content-inner {
        padding: 18px 14px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
  .site-header,
  .nav-bar,
  .nav-buttons {
    position: static; /* Belka przewija się razem ze stroną zamiast zasłaniać treść */
  }
  .content-area {
    /* Offset: header + połowa kafelka + trochę paddingu */
    margin-top: 0;
    min-height: 0;
  }
}