:root {
    --bg: #0b0e14;
    --fg: #e6e6e6;
    --accent: #4da3ff;
    --card: #141820;
    --card-light: #1c2028;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #121621, #0b0e14 60%);
    color: var(--fg);
    font-family: system-ui, sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.navbar {
    background: linear-gradient(180deg, #161a23, #0f1219);
    padding: 0.6rem 1.2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-buttons a {
    margin-left: 0.6rem;
    padding: 0.35rem 0.8rem;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: transform 0.2s, background-color 0.2s;
}

.nav-buttons a:hover {
    transform: translateY(-2px);
    background: #3a8ee0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.site-header {
    text-align: center;
    margin-bottom: 2rem;
}

.top-projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.top-projects > section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.top-projects h2 {
    min-height: 2.4rem;
    margin-bottom: 0.6rem;
}

@media (max-width: 1100px) {
    .top-projects {
        grid-template-columns: 1fr;
    }
}

.project-card {
    background: linear-gradient(180deg, var(--card-light), var(--card));
    padding: 1.2rem;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.45);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.project-card-container,
.more-section, .latest-section, .featured-section, .project-card {
    flex-grow: 1;
    display: flex;
}

.project-card img,
.project-card video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 0.7rem;
    align-self: center;
    max-height: 15rem;
}

.project-card h3 {
    margin: 0.2rem 0;
    font-size: 1.05rem;
}

.project-card p {
    margin: 0.3rem 0 0.5rem;
    font-size: 0.9rem;
    color: #cfd3da;
    line-height: 1.3;
}

.tags {
    margin-bottom: 0.8rem;
}

.tags span {
    display: inline-block;
    background: #222;
    padding: 3px 7px;
    margin: 2px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #ddd;
}

.section-button,
.project-card a {
    margin-top: auto;
    padding: 0.45rem 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.2s, background-color 0.2s;
}

.section-button:hover,
.project-card a:hover {
    transform: translateY(-2px);
    background: #3a8ee0;
}

.more-card {
    justify-content: center;
}

.author-section {
    margin-top: 3rem;
}

.author-card {
    display: flex;
    gap: 2rem;
    background: linear-gradient(180deg, var(--card-light), var(--card));
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    align-items: center;
    align-items: flex-start;
}

@media (max-width: 800px) {
    .author-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .author-left {
        min-width: unset;
        width: 100%;
        align-items: center;
    }

    .author-avatar {
        margin: 0 auto;
        display: block;
    }

    .author-info {
        width: 100%;
    }
}

.author-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.author-info h3 {
    margin: 1rem 0rem;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.author-info p {
    margin: 0.4rem 0;
    color: #cfd3da;
}

.author-row {
    margin: 0.4rem 0;
}

.author-row strong {
    margin-right: 0.3rem;
}

.author-row span {
    display: inline-block;
    background: #222;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* FOOTER */
.site-footer {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 1rem;
    font-size: 0.85rem;
    color: #aaa;
}

.projects-header {
    background: linear-gradient(180deg, var(--card-light), var(--card));
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    text-align: center;
    margin-bottom: 2.5rem;
}

.projects-header h1 {
    margin: 0 0 0.4rem;
}

.projects-header p {
    margin: 0 0 1.2rem;
    color: #cfd3da;
}

.projects-header input {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    border: none;
    background: #0e1118;
    color: var(--fg);
    outline: none;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-section {
    background: linear-gradient(180deg, var(--card-light), var(--card));
    padding: 1.8rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    margin-bottom: 2.5rem;
}

.project-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.videos video {
    width: 100%;
    border-radius: 12px;
    background: #000;
}

.downloads a {
    display: inline-block;
    margin: 0.4rem 0;
    padding: 0.45rem 0.9rem;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform 0.2s, background-color 0.2s;
}

.downloads a:hover {
    transform: translateY(-2px);
    background: #3a8ee0;
}

#project-meta {
    text-align: left;
}

#project-meta .tags {
    display: inline-block;
    background: #222;
    padding: 4px 8px;
    margin: 2px 3px 2px 0;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #ddd;
}

.project-links {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.project-links a {
    text-decoration: none;
}

.projects-header img {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-height: 50vh;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin: 1rem auto;
}

.author-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
}

.author-nick {
    margin-top: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.author-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.author-links-label {
    font-weight: 600;
    color: #cfd3da;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.lightbox.hidden {
    display: none;
}

.lightbox-content {
    background: linear-gradient(180deg, var(--card-light), var(--card));
    padding: 1.5rem;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    text-align: center;
}

.lightbox-content img,
.lightbox-content video {
    width: auto;
    max-width: 100%;
    max-height: 60vh;
    border-radius: 12px;
}

#lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 2rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10,12,16,0.6);
    border: none;
    color: var(--fg);
    font-size: 1.6rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

#lightbox-prev {
    left: 1rem;
}

#lightbox-next {
    right: 1rem;
}

@media (max-width: 700px) {
    .lightbox-nav {
        padding: 0.35rem 0.6rem;
        font-size: 1.2rem;
        border-radius: 8px;
    }
}

.lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.lightbox-content {
    z-index: 1000;
    position: relative;
}

.hidden-text {
    color: rgba(0, 0, 0, 0) !important;
    opacity: 0.3;
    user-select: text;
    font-size: 0.5rem;
}

.hidden-text::selection {
    color: black !important;
    background: red;
}

.media-top {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .media-top {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .media-top {
        grid-template-columns: 1fr;
    }
}

.media-card-container {
    padding: 0;
    display: contents;
}

.media-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-preview:hover {
    object-fit: contain;
    transform: scale(1.03);
}

.pagination-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0 1.5rem;
}

.pagination-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.per-page {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.per-page label {
    font-size: 0.9rem;
    color: #cfd3da;
}

.per-page select {
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: none;
    background: #0e1118;
    color: var(--fg);
    outline: none;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pagination-controls .page-btn,
.pagination-controls .page-number {
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: none;
    background: #222;
    color: #ddd;
    cursor: pointer;
    font-size: 0.85rem;
    min-width: 40px;
    text-align: center;
}

.pagination-controls .page-number.active {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.pagination-controls .page-btn:disabled,
.pagination-controls .page-number:disabled {
    opacity: 0.45;
    cursor: default;
}

.pagination-controls .dots {
    padding: 0 0.4rem;
    color: #cfd3da;
}

@media (max-width: 600px) {
    .pagination-top {
        flex-direction: column;
        align-items: stretch;
    }
    .pagination-controls {
        justify-content: center;
    }
}

.selection-column {
    background: linear-gradient(180deg, var(--card-light), var(--card));
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    min-height: 78px;
}

.selection-column h4 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    color: var(--fg);
    font-weight: 700;
}

.project-filter-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.project-filter-inline button {
    height: 36px;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

#project-filter-input {
    flex: 1;
    border: none;
    color: var(--fg);
    outline: none;
    background: #0f1320;
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
}

.active-project-filters {
    margin-top: 0.4rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.special-tags {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.special-tag {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}

.special-tag .tag-button {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 64px;
}

.special-tag .tag-desc {
    font-size: 0.8rem;
    color: #cfd3da;
}

.tag-button {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tag-button.neutral {
    background: #222;
    color: #ddd;
}
.tag-button.include {
    background: var(--accent);
    color: #fff;
}
.tag-button.exclude {
    background: #a33;
    color: #fff;
}

.special-hint {
    display: block;
    margin-top: 0.5rem;
    color: #aeb6c2;
    font-size: 0.78rem;
}

.selection-panel {
    display: grid;
    grid-template-columns: 3fr 1.4fr;
    grid-template-areas:
        "projects special"
        "tags     special";
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.projects-column { grid-area: projects; }
.tags-column     { grid-area: tags; }
.special-column  { grid-area: special; }

.projects-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#active-project-filters {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 0.4rem;
}

.tags-column h4 {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--card-light), transparent);
    padding-bottom: 0.3rem;
}

.special-column {
    font-size: 0.85rem;
}

.special-tags {
    gap: 0.35rem;
}

.special-tag {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.special-hint {
    border-top: 1px dashed rgba(255,255,255,0.15);
    padding-top: 0.4rem;
}

@media (max-width: 980px) {
    .selection-panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "projects"
            "tags"
            "special";
    }
}

#project-clear-btn {
    background: rgba(255,255,255,0.05);
    color: #cfd3da;
    border: 1px solid rgba(255,255,255,0.12);
}

#project-clear-btn:hover {
    background: rgba(255,80,80,0.12);
    border-color: rgba(255,80,80,0.35);
    color: #ffdede;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

#project-clear-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}

#active-project-filters {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;

    border-top: 1px solid rgba(255,255,255,0.08);
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.tag-filters button,
.active-project-filters button {
    display: inline-block;               /* stary sposób (nie pill z gap) */
    padding: 0.35rem 0.7rem;
    border-radius: 8px;                  /* zaokrąglone prostokąty zamiast 999px */
    border: none;
    background: #222;                     /* ciemne tło jak wcześniej */
    color: #ddd;
    font-size: 0.8rem;
    font-weight: 400;                     /* normalne (nie 600) */
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.tag-filters button:hover,
.active-project-filters button:hover {
    transform: translateY(-2px);
    box-shadow: none; /* usuń mocny cień z nowszych reguł */
}

/* przywrócenie starych stanów include/exclude */
.tag-filters button.include,
.active-project-filters button.include {
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
}

.tag-filters button.exclude,
.active-project-filters button.exclude {
    background: #a33;
    color: #fff;
    border-radius: 8px;
}

#project-filter-select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    border: none;
    background: #0f1320;
    color: var(--fg);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

#project-filter-select:hover {
    background: #161a23;
}

#project-filter-select:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

.project-sort {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.project-sort select {
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    border: none;
    background: #0f1320;
    color: var(--fg);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

#sort-direction {
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    border: none;
    background: #222;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s;
}

#sort-direction:hover {
    transform: translateY(-2px);
    background: #333;
}

#project-default-mode {
    white-space: nowrap;
    min-width: initial;
}
