/* ==========================================================================
   Jgolon.pl - wspolny system stylow
   Paleta przeniesiona z CV: grafit #2F363B, miedz #A96947, krem #F7F5F1.
   ========================================================================== */

:root {
    --bg: #F7F5F1;
    --bg-alt: #EFEAE3;
    --surface: #FFFFFF;
    --border: #E3DDD3;
    --border-strong: #D3CABC;

    --text: #2F3439;
    --text-muted: #556069;

    --accent: #A96947;
    --accent-dark: #8E553A;
    --accent-light: #C98A68;
    --accent-soft: rgba(169, 105, 71, 0.10);

    --dark: #2F363B;
    --dark-2: #23282C;
    --on-dark: #F2EFEA;
    --on-dark-muted: #B6BEC5;

    --font-head: "Poppins", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(47, 52, 57, 0.04), 0 8px 24px rgba(47, 52, 57, 0.06);
    --shadow-lg: 0 2px 4px rgba(47, 52, 57, 0.05), 0 18px 48px rgba(47, 52, 57, 0.12);
    --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-dark); }

::selection { background: var(--accent); color: #fff; }

/* ---------- Pasek postepu przewijania ---------- */

#progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    z-index: 90;
    transition: width 0.1s linear;
}

/* ---------- Nawigacja ---------- */

nav {
    background-color: rgba(247, 245, 241, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 80;
}

nav a {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 0.96rem;
    color: var(--text);
    padding: 9px 20px;
    border-radius: 999px;
    position: relative;
    transition: background-color 0.25s ease, color 0.25s ease;
}

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

nav a.active {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(169, 105, 71, 0.28);
}

/* ---------- Ukladki ---------- */

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
}

.section { padding: 84px 0; }
.section.tight { padding-top: 0; }
.section.alt { background: var(--bg-alt); }

/* naglowek sekcji ze miedzianym znacznikiem, jak w CV */
.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}

.section-head::before {
    content: "";
    width: 5px;
    height: 30px;
    border-radius: 3px;
    background: var(--accent);
    flex: none;
}

.section-head h2 {
    font-family: var(--font-head);
    font-size: 1.32rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.section-head .rule { flex: 1; height: 1px; background: var(--border); }

.eyebrow {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

/* ---------- Tagi, jak pigulki w CV ---------- */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.tags li,
.tag {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tags li:hover, .tag:hover { border-color: var(--accent); color: var(--accent); }

a.tag { cursor: pointer; }
a.tag:hover { transform: translateY(-2px); }

.tags li.is-key,
.tag.is-key {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-weight: 600;
}

/* ---------- Przyciski ---------- */

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.98rem;
    padding: 14px 30px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background-color: var(--accent);
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.btn:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(169, 105, 71, 0.3);
}

/* blysk przechodzacy po przycisku */
.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-18deg);
}

.btn:hover::after { animation: shine 0.75s ease; }

@keyframes shine { to { left: 140%; } }

.btn-ghost {
    background-color: transparent;
    color: var(--accent);
}

.btn-ghost:hover { background-color: var(--accent); color: #fff; }

.btn-light {
    background-color: transparent;
    border-color: rgba(242, 239, 234, 0.45);
    color: var(--on-dark);
}

.btn-light:hover {
    background-color: var(--on-dark);
    border-color: var(--on-dark);
    color: var(--dark);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

.btn-small { font-size: 0.85rem; padding: 10px 20px; }

/* ---------- Stopka ---------- */

footer {
    background-color: var(--dark);
    color: var(--on-dark-muted);
    text-align: center;
    padding: 34px 20px;
    margin-top: 0;
}

footer p { font-size: 0.88rem; margin: 0; }
footer a { color: var(--on-dark); }
footer a:hover { color: var(--accent-light); }

/* ---------- Powrot na gore ---------- */

#scrollToTop {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 48px;
    height: 48px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 70;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    box-shadow: 0 10px 26px rgba(169, 105, 71, 0.35);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease, visibility 0.3s;
}

#scrollToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#scrollToTop:hover { background-color: var(--accent-dark); transform: translateY(-3px); }
#scrollToTop i { color: #fff; }

/* ---------- Modal ---------- */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background-color: rgba(35, 40, 44, 0.82);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    position: relative;
    max-width: min(660px, 92vw);
    max-height: 86vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes popIn { from { opacity: 0; transform: scale(0.94) translateY(12px); } to { opacity: 1; transform: none; } }

.modal-content img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }

.close {
    position: fixed;
    top: 14px;
    right: 28px;
    color: var(--on-dark);
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 110;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close:hover { color: var(--accent-light); transform: rotate(90deg); }

/* ---------- Powiadomienie (kopiowanie danych) ---------- */

#toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translate(-50%, 24px);
    background: var(--dark);
    color: var(--on-dark);
    font-size: 0.9rem;
    padding: 12px 22px;
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    z-index: 120;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Odslanianie przy przewijaniu ---------- */

/* ukrywamy tylko gdy JS wystartowal, inaczej tresc zostaje widoczna */
body.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
    will-change: opacity, transform;
}

body.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    body { font-size: 16px; }
    .wrap { padding: 0 20px; }
    .section { padding: 54px 0; }
    nav { padding: 9px 6px; gap: 2px; }
    nav a { font-size: 0.78rem; padding: 7px 12px; }
    .card { padding: 22px; }
    #scrollToTop { bottom: 18px; right: 16px; width: 44px; height: 44px; }
}

/* ---------- Ograniczona animacja ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    body.js .reveal { opacity: 1; transform: none; transition: none; }
    *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.01s !important; }
}

/* ==========================================================================
   Warstwa immersyjna
   Wszystko ponizej animuje wylacznie transform i opacity, wiec przegladarka
   nie przelicza ukladu strony. Bez JavaScriptu nic z tego nie ukrywa tresci.
   ========================================================================== */

/* ---------- ziarno na calej stronie ---------- */

#grain {
    position: fixed;
    inset: 0;
    z-index: 95;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

/* ---------- przejscie miedzy podstronami ---------- */

/* Powloka ma kolor tla strony, wiec zamiana podstron wyglada jak spokojne
   przenikniecie, a nie jak zaslona wjezdzajaca z dolu. */
#veil {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease-in;
}

#veil.on { opacity: 1; }

/* wychodzenie ze strony: tresc gasnie i lekko unosi sie do gory.
   Selektor jest celowo bardziej szczegolowy niz regula wejscia ponizej,
   zeby czas 0.32s naprawde obowiazywal, a nie byl nadpisany. */
body.js.leaving nav,
body.js.leaving main,
body.js.leaving footer {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
    transition: opacity 0.32s cubic-bezier(0.4, 0, 1, 1),
                transform 0.32s cubic-bezier(0.4, 0, 1, 1);
}

/* wejscie na strone: tresc osiada z dolu, dluzej i miekko */
body.js main {
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

body.js.entering main {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: none;
}

/* pasek u gory przeciaga sie przy zmianie podstrony, tym samym akcentem,
   ktorym oznaczany jest postep czytania */
#progress.sweep {
    width: 100% !important;
    transition: width 0.42s cubic-bezier(0.32, 0, 0.67, 0);
}

/* ---------- odslanianie tekstu slowo po slowie ---------- */

.sp-w {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

.sp-i {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.sp-on .sp-i { transform: none; }

/* ---------- linia w naglowku sekcji rysuje sie przy wejsciu ---------- */

body.js .section-head .rule {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

body.js .section-head.in .rule { transform: scaleX(1); }

/* ---------- przewijajacy sie pas z narzedziami ---------- */

.marquee {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    padding: 18px 0;
    display: flex;
}

.marquee::before, .marquee::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 90px;
    z-index: 2;
    pointer-events: none;
}

.marquee::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }

.marquee ul {
    display: flex;
    align-items: center;
    gap: 46px;
    margin: 0;
    padding: 0 23px;
    list-style: none;
    flex: none;
    animation: slide 34s linear infinite;
}

.marquee:hover ul { animation-play-state: paused; }

.marquee li {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 12px;
}

.marquee li::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.55;
}

@keyframes slide { to { transform: translate3d(-100%, 0, 0); } }

/* ---------- przyciski przyciagane kursorem ---------- */

.btn { will-change: auto; }

@media (max-width: 760px) {
    /* mieszanie warstw na calym ekranie jest najdrozsze na telefonach,
       a ziarna prawie nie widac, wiec tam go nie wlaczamy */
    #grain { display: none; }
    .marquee ul { gap: 30px; animation-duration: 26s; }
    .marquee li { font-size: 0.9rem; }
    .marquee::before, .marquee::after { width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    #grain { display: none; }
    #veil { display: none; }
    body.js.leaving nav, body.js.leaving main, body.js.leaving footer { opacity: 1; transform: none; transition: none; }
    body.js.entering main { opacity: 1; transform: none; }
    .sp-i { transform: none; transition: none; }
    body.js .section-head .rule { transform: none; transition: none; }
    .marquee ul { animation: none; }
}


/* ==========================================================================
   Zaznaczanie i kopiowanie tekstu
   Tresc ma byc swobodnie zaznaczalna, a elementy ozdobne nie moga trafiac
   do schowka. Pas z narzedziami ma zdublowana liste, wiec bez tego kazda
   nazwa kopiowalaby sie dwa razy.
   ========================================================================== */

body {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* elementy ozdobne i sterujace poza zaznaczeniem */
.marquee,
#heroCanvas,
#grain,
#veil,
#progress,
#scrollToTop,
.hero .role .cursor,
.badge .dot,
.contact-row .copy,
.close {
    -webkit-user-select: none;
    user-select: none;
}

/* wygodniejsze zaznaczanie dluzszych akapitow na dotyku */
.bio p,
.aim-box p,
.timeline .duties li,
.pillars li,
.job-card p.desc,
.spis p1,
.spis li {
    -webkit-user-select: text;
    user-select: text;
}

/* czytelne podswietlenie zaznaczenia takze na ciemnych pasmach */
::selection { background: var(--accent); color: #fff; }
::-moz-selection { background: var(--accent); color: #fff; }
