:root {
    --bg: #1a1824;
    --surface: #252232;
    --text: #f8f9fa;
    --text-muted: #a0aec0;
    --text-tertiary: #718096;
    --border: #4a4a58;
    --accent: #9b59b6;
    --accent-soft: #7d4ba7;
    --accent-cool: #5a67d8;
    --accent-glow: rgba(155, 89, 182, 0.22);
    /* --accent-cool-glow: rgba(90, 103, 216, 0.14); */
    --radius: 12px;
    --container: min(1200px, 92vw);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 120% 70% at 50% -15%, var(--accent-glow) 0%, transparent 55%),
        radial-gradient(ellipse 90% 55% at 100% 25%, var(--accent-cool-glow) 0%, transparent 48%),
        radial-gradient(ellipse 70% 50% at 0% 90%, rgba(62, 62, 74, 0.45) 0%, transparent 52%);
}

code.inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9375em;
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    white-space: nowrap;
}

.display {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.container {
    width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(26, 24, 36, 0.9);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.site-header .inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header a.logo {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
}

.nav-menu-btn {
    display: none;
}

.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-backdrop.is-active {
    display: block;
}

body.site-nav-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .nav-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-family: inherit;
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--text);
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 10px 16px;
        cursor: pointer;
        transition: color 0.2s, border-color 0.2s, background 0.2s;
    }

    .nav-menu-btn:hover {
        color: var(--accent);
        border-color: var(--accent);
    }

    .site-header .inner {
        flex-wrap: wrap;
        row-gap: 0;
    }
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
}

.nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--accent);
}

.nav a[aria-current="page"] {
    color: var(--text);
}

.nav-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.nav-group > a {
    white-space: nowrap;
}

.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
    margin-left: 2px;
    border-left: 2px solid var(--border);
}

.nav-sub a {
    font-size: 0.8125rem;
    font-weight: 500;
}

@media (min-width: 900px) {
    .nav-group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
    }

    .nav-sub {
        position: absolute;
        left: 0;
        top: calc(100% + 8px);
        display: none;
        flex-direction: column;
        gap: 8px;
        min-width: 220px;
        padding: 14px 16px;
        margin: 0;
        border-left: none;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow:
            0 16px 48px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(155, 89, 182, 0.12);
    }

    /* Keeps hover when moving pointer from “Portfolio” into the menu */
    .nav-sub::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 12px;
    }

    .nav-sub a {
        font-size: 0.875rem;
    }

    .nav-group:hover .nav-sub,
    .nav-group:focus-within .nav-sub {
        display: flex;
    }
}

@media (max-width: 700px) {
    .site-header .nav {
        display: none;
        flex-basis: 100%;
        order: 3;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 14px;
        padding-top: 16px;
        margin-top: 12px;
        border-top: 1px solid var(--border);
    }

    .site-header--nav-open .nav {
        display: flex;
    }

    .site-header .nav-group {
        align-items: stretch;
    }

    .site-header .nav-sub {
        display: flex;
    }

    .site-header .header-right .nav {
        order: 10;
    }
}

/* Optional: toolbar wrapper (e.g. test page with theme toggle) */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

/* Inner pages */
.page-main {
    min-height: 50vh;
}

.page-main > .section:first-child {
    padding-top: clamp(40px, 8vw, 72px);
}

/* Hero */
.hero {
    padding: clamp(48px, 22vw, 360px) 0 clamp(64px, 10vw, 283px);
    background-image: url('images/general/2026_Krzysztof_profilowe-03-hero.jpg');
    background-position: 60% 40%;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(26, 24, 36, 0.9) 0%, rgba(26, 24, 36, 0.5) 50%, transparent 100%);
    z-index: 1;
}

.hero > * {
    position: relative;
    z-index: 2;
}

.hero-grid {
    display: block;
    max-width: 60%;
}

.hero h1 {
    font-size: clamp(2.25rem, 5.5vw, 3.75rem);
    margin-bottom: 20px;
}

.hero-name-accent {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
    text-decoration-color: var(--accent);
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 36ch;
    margin-bottom: 16px;
}

.hero-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
    padding-top: 12px;
    transition: color 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn-text:hover {
    color: #e9d5f5;
    border-bottom-color: #c084fc;
    opacity: 1;
}

.hero-image-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    max-height: 520px;
    background: linear-gradient(145deg, #e4e4e7 0%, #d4d4d8 50%, #a1a1aa 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Section titles (Mr March–style repeated weight) */
.section-head {
    margin-bottom: clamp(32px, 6vw, 56px);
}

.section-head .eyebrow {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.section {
    padding: clamp(56px, 10vw, 100px) 0;
}

.section.alt {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* About */
.about-text {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 52ch;
    padding-bottom: 1rem;
}

.about-text--intro {
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.about-subhead {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.25;
    max-width: 52ch;
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 0.65rem;
}

.about-page .about-subhead:first-of-type {
    margin-top: clamp(1.25rem, 3vw, 1.75rem);
}

.about-subhead--minor {
    font-size: clamp(1rem, 2vw, 1.125rem);
    margin-top: 1.25rem;
}

.about-page ul.case-study-list {
    list-style: disc;
    margin: 0 0 1rem;
    padding-left: 1.25em;
    max-width: 52ch;
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    color: var(--text-muted);
    line-height: 1.35;
}

.about-page ul.case-study-list li {
    margin-bottom: 5px;
}

.about-page ul.case-study-list li:last-child {
    margin-bottom: 0;
}

.case-study-hero {
    margin: clamp(1.5rem, 3vw, 2rem) 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(0,0,0,0.08));
}

.case-study-hero__img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
}

.case-study-hero__img--square {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 50% 100%;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(14, 12, 22, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1.5rem;
}

.lightbox--open {
    display: flex;
    animation: lightbox-fade-in 0.2s ease;
}

.lightbox__inner {
    position: relative;
    max-width: min(90vw, 1200px);
    max-height: 90vh;
    animation: lightbox-scale-in 0.2s ease;
}

.lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.65),
        0 0 60px rgba(90, 103, 216, 0.12);
}

.lightbox__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #e5e5e5;
    color: #0a0a0a;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    transition: background 0.15s;
}

.lightbox__close:hover {
    background: #fafafa;
}

@keyframes lightbox-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lightbox-scale-in {
    from { transform: scale(0.94); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.case-study-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: center;
}

.case-study-hero--inline {
    margin: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.case-study-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(0.75rem, 2vw, 1.25rem);
    margin: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.case-study-gallery__item {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(0,0,0,0.08));
}

.case-study-gallery > .case-study-gallery__item,
:not(.case-study-gallery) > .case-study-gallery__item {
    margin: clamp(1.5rem, 3vw, 2rem) 0;
}

.case-study-gallery > .case-study-gallery__item {
    margin: 0;
}

.case-study-gallery__item .case-study-hero__img {
    height: 240px;
    object-fit: contain;
    background: var(--surface);
}

.case-study-hero--full {
    margin: clamp(2rem, 5vw, 4rem) 0;
    border-radius: 1;
}

.case-study-caption {
    margin: 12px 24px 12px 24px;
    font-family: Menlo, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-tertiary);
}

@media (max-width: 640px) {
    .case-study-split {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }
    
    /* For sections where image comes first, reverse order on mobile */
    .case-study-split figure.case-study-hero {
        order: 2;
    }
    
    .case-study-split > div:not(figure) {
        order: 1;
    }
}

.about-page--experience > .about-text--intro {
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.about-page .job .job-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.about-page .job .company-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f8f9fa;
}

.about-page .job .job-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.about-page .job .job-meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 1rem;
    max-width: 52ch;
}

.about-page .job .job-meta > .about-subhead {
    margin-top: 0;
    margin-bottom: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

.about-page .job .job-meta > .job-eyeline {
    padding-bottom: 0;
    margin-bottom: 0;
    color: var(--text);
    font-size: clamp(1.125rem, 2.2vw, 1.35rem);
}

/* Role title: same display face as section / subheads, without using a heading element */
.about-page .job .job-meta > .job-eyeline strong {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text);
}

.about-page .job .job-meta > p.job-eyeline-dates {
    font-size: clamp(0.875rem, 1.35vw, 1rem);
    line-height: 1.5;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
    padding: 0;
}

.about-page .job .case-study-list {
    margin-bottom: 0;
}

/* Experience */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(6, 1);
    grid-auto-rows: max-content;
    gap: 32px;
}

@media (min-width: 768px) {
    .experience-grid {
        gap: 40px;
    }
}

/* Home (index): three jobs in one horizontal row on wide screens */
.experience-grid--home {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(1, 1fr);
}

@media (min-width: 768px) {
    .experience-grid--home {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Apply experience page logo styling to home page */
.experience-grid--home .job .company-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f8f9fa;
}

.job {
    height: fit-content;
    padding-top: 24px;
    /* border-top: 1px solid var(--border); */
}

.job-company,
.job-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.job-company {
    margin-bottom: 6px;
}

.job-title {
    margin-bottom: 6px;
}

.job-dates {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.job-line {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

ul.job-line {
    list-style: disc;
    margin: 0;
    padding-left: 1.25em;
}

ul.job-line li {
    margin-bottom: 0.35em;
}

ul.job-line li:last-child {
    margin-bottom: 0;
}

.job-line-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 0.5rem;
}

/* Responsive design for company logos */
@media (max-width: 768px) {
    .about-page .job .job-header {
        gap: 0.85rem;
    }
    
    
}

/* Case studies */
.cards {
    display: grid;
    gap: 28px;
}

@media (min-width: 768px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    #case-studies .cards {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(1, 1fr);
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s, transform 0.25s;
}

.card:hover {
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.45),
        0 0 36px var(--accent-glow);
    transform: translateY(-2px);
}

.card-visual {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #2d2a38, #4a4a58);
}

.card-visual.a {
    background-color: #2d2640;
    background-image: url('images/portfolio-1/hero.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.card-visual.b {
    background-color: #4a1d4a;
    background-image: url('images/portfolio-2/hero.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.card-visual.c {
    background-color: #1e3a5f;
    background-image: url('images/portfolio-3/hero.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.card-visual.d { background: linear-gradient(135deg, #3b0764, #9b59b6); }
.card-visual.e { background: linear-gradient(135deg, #1c3d52, #5a67d8); }
.card-visual.f { background: linear-gradient(135deg, #5c2d4a, #c084fc); }
.card-visual.g { background: linear-gradient(135deg, #3d2a55, #7d4ba7); }
.card-visual.h { background: linear-gradient(135deg, #2a3048, #6366f1); }

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.card-tag-row {
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.card-tag-row .card-tag {
    margin-bottom: 0;
}

.card h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    line-height: 1.2;
}

.card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 20px;
}

.card-link {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    align-self: flex-start;
    border-bottom: 1px solid var(--accent);
    transition: color 0.2s, border-color 0.2s, opacity 0.2s;
}

.card-link:hover {
    color: #e9d5f5;
    border-bottom-color: #c084fc;
    opacity: 1;
}

/* Contact */
.contact-section {
   padding: clamp(72px, 12vw, 120px) 0;
}

.contact-section h2 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.contact-section .lead {
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 40ch;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
}

.contact-links a {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-bottom: 2px solid var(--border);
    padding-bottom: 4px;
    transition: border-color 0.2s, color 0.2s;
}

.contact-links a:hover {
    color: #e9d5f5;
    border-color: var(--accent);
}

.site-footer {
    padding: 24px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.site-footer a {
    color: inherit;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 48px);
}

.login-shell {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-header {
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.login-welcome {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    letter-spacing: -0.02em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.login-brand {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
}

.login-lead {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.login-error {
    font-size: 0.875rem;
    color: #f87171;
    margin-bottom: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    text-align: left;
}

.login-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-input {
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input::placeholder {
    color: var(--text-tertiary);
}

.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-submit {
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 20px;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.login-submit:hover {
    color: #e9d5f5;
    border-color: #c084fc;
    background: rgba(155, 89, 182, 0.12);
}
