:root {
    --bg: #1e1e1e;
    --fg: #ffffff;
    --fg-muted: rgba(255, 255, 255, 0.78);
    --fg-subtle: rgba(255, 255, 255, 0.52);
    --fg-faint: rgba(255, 255, 255, 0.64);
    --panel-bg: rgba(18, 18, 18, 0.92);
    --panel-border: rgba(255, 255, 255, 0.08);
    --tag-border: rgba(255, 255, 255, 0.2);
    --divider: rgba(255, 255, 255, 0.2);
    --accent: #f2b544;
    --accent-ink: #1e1e1e;
}

:root.light {
    --bg: #e9e9e9;
    --fg: #1f1f1f;
    --fg-muted: rgba(30, 30, 30, 0.88);
    --fg-subtle: rgba(30, 30, 30, 0.66);
    --fg-faint: rgba(30, 30, 30, 0.74);
    --panel-bg: rgba(255, 255, 255, 0.92);
    --panel-border: rgba(0, 0, 0, 0.12);
    --tag-border: rgba(0, 0, 0, 0.26);
    --divider: rgba(0, 0, 0, 0.2);
    --accent: #c98a1a;
    --accent-ink: #ffffff;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: default;
    background: var(--bg);
    transition: background 0.6s ease;
}

.hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
    transition: background 0.6s ease;
}

/* Base image */
.image-base {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-left: 8vw;
}

.image-base picture { display: contents; }
.image-base img {
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    filter: grayscale(100%) brightness(1.05) contrast(1.10);
}

/* UI on top */
.ui-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    padding: clamp(28px, 4vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ui-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.ui-bottom {
    display: flex;
    align-items: flex-end;
    pointer-events: auto;
    margin: 0 calc(-1 * clamp(28px, 4vw, 56px)) calc(-1 * clamp(28px, 4vw, 56px));
    padding: 40px clamp(28px, 4vw, 56px) clamp(16px, 1.8vw, 24px);
    background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--bg) 88%, transparent) 50%, var(--bg) 100%);
}
:root.light .ui-bottom {
    background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, color-mix(in srgb, var(--bg) 92%, transparent) 100%);
}

.name-block { pointer-events: auto; }

.name-block .line {
    display: block;
    margin: 0;
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 500;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--fg);
    transition: color 0.6s ease;
}

.nick-inline {
    font-style: italic;
    opacity: 0.55;
    letter-spacing: 0.02em;
}

.nav-link {
    pointer-events: auto;
    font-family: 'Jost', 'Futura', sans-serif;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--fg);
    position: relative;
    padding-bottom: 3px;
    transition: color 0.6s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover::after { width: 100%; }

.nav-links {
    display: flex;
    gap: clamp(20px, 2.5vw, 36px);
    align-items: center;
    pointer-events: auto;
}


/* ── Theme toggle ── */
.theme-toggle {
    pointer-events: auto;
    background: none;
    border: none;
    color: var(--fg);
    cursor: pointer;
    width: 20px;
    height: 20px;
    padding: 0;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, color 0.6s ease, transform 0.3s ease;
}

.theme-toggle:hover { opacity: 1; transform: translateY(-2px); }

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

:root.light .theme-toggle .icon-sun { display: none; }
:root.light .theme-toggle .icon-moon { display: block; }

.theme-toggle {
    opacity: 0;
    animation: text-in 0.8s ease-out 0.3s both;
}

/* Entrance animations */
.hero { animation: hero-in 1s ease-out forwards; }
@keyframes hero-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.name-block .line {
    opacity: 0;
    animation: text-in 0.8s ease-out both;
}
.name-block .line:nth-child(1) { animation-delay: 0.3s; }

.nav-link {
    opacity: 0;
    animation: text-in 0.8s ease-out 0.3s both;
}


@keyframes text-in {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ── About panel ── */
.about-panel {
    position: absolute;
    top: 51%;
    left: 75%;
    transform: translate(-50%, -50%) scale(0.97);
    width: 52vw;
    max-width: 680px;
    max-height: calc(100vh - 300px);
    z-index: 30;
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    overflow-y: auto;
    padding: clamp(36px, 4vw, 56px);
    pointer-events: none;
    opacity: 0;
    filter: blur(12px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
}

.about-panel.open {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.about-close {
    position: absolute;
    top: clamp(28px, 4vw, 56px);
    right: clamp(28px, 4vw, 56px);
    background: none;
    border: none;
    color: var(--fg);
    font-family: 'Jost', 'Futura', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.about-close:hover { opacity: 1; }

.about-panel h2 {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    letter-spacing: -0.01em;
    color: var(--fg);
    margin-bottom: 32px;
}

.about-panel .about-role {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    margin-bottom: 28px;
}

.about-panel p {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.7;
    color: var(--fg-muted);
    margin-bottom: 20px;
}

.about-panel .about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}

.about-panel .about-tag {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-faint);
    border: 1px solid var(--tag-border);
    padding: 6px 14px;
    border-radius: 2px;
}

.about-panel .about-divider {
    width: 32px;
    height: 1px;
    background: var(--divider);
    margin: 28px 0;
}

/* ── Contact panel ── */
.contact-panel {
    position: absolute;
    top: 51%;
    left: 75%;
    transform: translate(-50%, -50%) scale(0.97);
    z-index: 30;
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: clamp(44px, 5vw, 68px) clamp(48px, 5vw, 72px);
    pointer-events: none;
    opacity: 0;
    filter: blur(12px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
    text-align: center;
}

.contact-panel.open {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.contact-panel .contact-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 24px;
    color: var(--fg-subtle);
}

.contact-panel h2 {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    letter-spacing: -0.01em;
    color: var(--fg);
    margin-bottom: 20px;
}

.contact-panel .contact-subtitle {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    color: var(--fg-subtle);
    letter-spacing: 0.04em;
    margin-bottom: 24px;
}

.contact-cta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.contact-cta {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-faint);
    border: 1px solid var(--tag-border);
    padding: 8px 18px;
    border-radius: 2px;
}

.contact-divider {
    width: 32px;
    height: 1px;
    background: var(--divider);
    margin: 28px auto;
}

.contact-panel .contact-email {
    font-family: 'Jost', 'Futura', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    letter-spacing: 0.06em;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
    animation: email-pulse 4s ease-in-out infinite;
}

@keyframes email-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.contact-panel .contact-email:hover {
    color: var(--fg);
}

.contact-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--fg);
    font-family: 'Jost', 'Futura', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.contact-close:hover { opacity: 1; }



/* ══════════════ Mobile — strona główna ══════════════ */
@media (max-width: 900px) {
    .ui-top { align-items: center; position: relative; }
    .name-block .line { font-size: clamp(1.35rem, 6vw, 2rem); }
    .theme-toggle { width: 20px; height: 20px; }
    .image-base { padding-left: 0; justify-content: flex-start; align-items: flex-end; }
    .image-base img { height: 74%; margin-left: -6vw; }
    .ui-overlay { padding-bottom: 0; }
    .about-panel, .contact-panel {
        top: auto; left: 16px; right: 16px; bottom: 16px;
        width: auto; max-width: none; max-height: calc(100vh - 32px);
        transform: translate(0, 12px) scale(0.98);
        padding: 32px 24px 28px;
    }
    .about-panel.open, .contact-panel.open { transform: translate(0, 0) scale(1); }
    .about-close, .contact-close { top: 16px; right: 18px; }
    .about-panel h2 { margin-bottom: 14px; font-size: 1.3rem; }
    .about-panel .about-role { margin-bottom: 16px; }
    .about-panel p { font-size: 0.9rem; line-height: 1.55; margin-bottom: 12px; }
    .about-panel .about-divider { margin: 16px 0; }
    .about-panel .about-tags { margin-top: 18px; }
    .contact-panel { text-align: left; }
    .contact-cta-list { justify-content: flex-start; }
    .contact-divider { margin: 24px 0; }
    .contact-panel .contact-icon { margin: 0 0 16px; }
}
@media (max-width: 900px) and (max-height: 700px) {
    .image-base img { height: 66%; }
}

/* ── Menu mobilne (hamburger) ── */
.menu-toggle { display: none; background: none; border: none; color: var(--fg); cursor: pointer; width: 28px; height: 28px; padding: 0; align-items: center; justify-content: center; transition: transform 0.3s ease, color 0.6s ease; }
.menu-toggle svg { width: 24px; height: 24px; fill: currentColor; }
.nav-menu { display: contents; }
@media (max-width: 900px) {
    .menu-toggle { display: flex; opacity: 0; animation: text-in 0.8s ease-out 0.3s both; }
    .nav-links { flex-wrap: nowrap; gap: 16px; }
    .nav-menu {
        display: flex; flex-direction: column; gap: 0;
        position: absolute; left: 16px; right: 16px; top: calc(100% + 12px); z-index: 60;
        background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 16px;
        backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
        padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98); pointer-events: none;
        transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), visibility 0.35s;
    }
    .nav-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
    .nav-menu .nav-link { display: block; padding: 16px 24px; font-size: 0.78rem; letter-spacing: 0.18em; opacity: 1; animation: none; border-bottom: 1px solid var(--divider); }
    .nav-menu .nav-link:last-child { border-bottom: 0; }
    .nav-menu .nav-link::after { display: none; }
    .nav-menu .nav-link.current { color: var(--accent); }
}
.ui-top { position: relative; }
@media (max-width: 900px) { .ui-overlay { pointer-events: none; } .ui-top { pointer-events: auto; } }

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

/* ── Stopka: jedna linia, przy ciasno kolumna (social → polityki → copyright) ── */
.site-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; width: 100%; font-family: 'Jost', 'Futura', sans-serif; }
.site-foot .copy { font-weight: 300; font-size: 0.65rem; letter-spacing: 0.08em; color: var(--fg-subtle); white-space: nowrap; }
.site-foot .footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-foot .footer-links a { font-weight: 400; font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-subtle); text-decoration: none; transition: color 0.3s; }
.site-foot .footer-links a:hover { color: var(--fg); }
.site-foot .footer-links a[hidden] { display: none; }
.site-foot .socials { display: flex; gap: clamp(16px, 2vw, 28px); align-items: center; margin-left: auto; }
.site-foot .socials a { display: flex; color: var(--fg); transition: transform 0.3s ease, color 0.6s ease; }
.site-foot .socials a:hover { transform: translateY(-2px); }
.site-foot .socials a svg { height: clamp(20px, 2.2vw, 26px); width: auto; fill: currentColor; }
@media (max-width: 760px) {
    .site-foot { flex-direction: column; align-items: flex-end; gap: 14px; text-align: right; }
    .site-foot .socials { order: 1; margin-left: 0; }
    .site-foot .footer-links { order: 2; justify-content: flex-end; }
    .site-foot .copy { order: 3; white-space: normal; font-size: 0.6rem; }
}
.site-foot { opacity: 0; animation: text-in 0.8s ease-out 0.6s both; }
.about-panel p a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--divider); transition: border-color 0.3s; }
.about-panel p a:hover { border-color: var(--fg); }

@media (hover: none), (prefers-reduced-motion: reduce) { .contact-panel .contact-email, .cta .email { animation: none; opacity: 1; } }
