/* =============================================================================
   Portfolio — Aleksander Kopydłowski
   Concept v2 — "Aurora Prism"
   Motyw: głęboki atrament + szampańskie złoto + chłodny fiolet.
   Wspólny dla wszystkich podstron (Home / About / Projects).

   Kolory zmienisz w bloku :root poniżej. Odpowiednik palety sceny 3D
   znajduje się w src/hero3d.ts (stała PALETTE).
   ============================================================================= */

:root {
    /* --- tła --- */
    --ink: #08080b;
    --ink-2: #0c0c11;
    --ink-3: #12121a;

    /* --- powierzchnie i linie --- */
    --surface: rgba(255, 255, 255, 0.042);
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.075);
    --line-2: rgba(255, 255, 255, 0.14);

    /* --- tekst --- */
    --fg: #f3f0ea;
    --fg-2: #a7a29a;
    --fg-3: #6c6861;

    /* --- akcenty --- */
    --gold: #c9a96a;
    --gold-hi: #ecd6a4;
    --gold-dim: rgba(201, 169, 106, 0.14);
    --violet: #6d5cf0;
    --violet-dim: rgba(109, 92, 240, 0.16);

    --grad-gold: linear-gradient(105deg, var(--gold-hi), var(--gold) 46%, #b08a4d);
    --grad-mix: linear-gradient(120deg, var(--gold-hi), var(--gold) 40%, var(--violet));

    /* --- kształt i ruch --- */
    --r-sm: 10px;
    --r: 16px;
    --r-lg: 24px;
    --r-xl: 34px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
    --dur: 0.7s;

    --maxw: 1200px;
    --gut: clamp(20px, 5vw, 64px);
    --nav-h: 78px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--ink);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

::selection { background: var(--gold-dim); color: var(--gold-hi); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- typografia ---------------------------------------------------------- */
.serif {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.08;
}

.eyebrow,
.card__label,
.nav__links a,
.brand-word,
.tag,
.stack__group h4,
.hero__scroll,
.skill__level,
.lang-switch,
.mini-card__more,
.project__index,
.mini-card__idx,
.marquee,
.stat__num,
.timeline__date {
    font-family: "Space Grotesk", "Inter", sans-serif;
}

.eyebrow,
.card__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 500;
}

.eyebrow::before,
.card__label::before {
    content: "";
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.section-title {
    font-size: clamp(2rem, 4.4vw, 3.2rem);
}

/* =============================================================================
   TŁO — warstwy
   ============================================================================= */
.bg-aurora {
    position: fixed;
    inset: -20%;
    z-index: -4;
    pointer-events: none;
    background:
        radial-gradient(36% 34% at 18% 14%, rgba(201, 169, 106, 0.13), transparent 70%),
        radial-gradient(40% 38% at 84% 26%, rgba(109, 92, 240, 0.12), transparent 72%),
        radial-gradient(46% 42% at 72% 82%, rgba(201, 169, 106, 0.07), transparent 74%);
    filter: blur(24px);
    animation: aurora 26s var(--ease-io) infinite alternate;
}

@keyframes aurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-2.5%, 2%, 0) scale(1.07); }
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 74px 74px;
    mask-image: radial-gradient(80% 60% at 50% 35%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(80% 60% at 50% 35%, #000 20%, transparent 78%);
}

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

#dust {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* --- płótna scen 3D ------------------------------------------------------- */
#hero3d,
#about3d,
#projects3d {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1.8s var(--ease), transform 2.2s var(--ease);
}

#hero3d.is-ready {
    opacity: 1;
    transform: scale(1);
}

/* konstelacja na "O mnie" jest tylko tłem pod treścią — mocno przygaszona */
#about3d.is-ready,
#projects3d.is-ready {
    opacity: 0.5;
    transform: scale(1);
}

/* awaryjnie: brak WebGL — zostaje sama poświata z .bg-aurora */
.no-webgl #hero3d,
.no-webgl #about3d,
.no-webgl #projects3d { display: none; }

/* =============================================================================
   NAWIGACJA
   ============================================================================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 var(--gut);
    transition: height 0.5s var(--ease), background 0.5s var(--ease),
                border-color 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
    border-bottom: 1px solid transparent;
}

.is-scrolled .nav {
    height: 62px;
    background: rgba(8, 8, 11, 0.72);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom-color: var(--line);
}

.nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
}

.monogram-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 9px;
    transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}

.nav__brand:hover .monogram-img {
    transform: rotate(-8deg) scale(1.08);
    filter: drop-shadow(0 0 12px var(--gold-dim));
}

.brand-word {
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--fg-2);
}

.nav__links {
    display: flex;
    gap: 32px;
}

.nav__links a {
    position: relative;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--fg-2);
    padding: 6px 0;
    transition: color 0.4s var(--ease);
}

.nav__links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--grad-gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s var(--ease);
}

.nav__links a:hover,
.nav__links a.is-active { color: var(--fg); }

.nav__links a:hover::after,
.nav__links a.is-active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switch {
    display: flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.lang-switch button {
    padding: 5px 12px;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--fg-3);
    border-radius: 999px;
    transition: color 0.35s var(--ease), background 0.35s var(--ease);
}

.lang-switch button.is-active {
    color: var(--ink);
    background: var(--grad-gold);
    font-weight: 600;
}

.nav__contact {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    font-size: 13px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--fg);
    background: var(--surface);
    transition: border-color 0.4s var(--ease), background 0.4s var(--ease),
                box-shadow 0.4s var(--ease);
    will-change: transform;
}

.nav__contact:hover {
    border-color: var(--gold);
    background: var(--gold-dim);
    box-shadow: 0 8px 30px -12px rgba(201, 169, 106, 0.6);
}

.nav__contact svg { transition: transform 0.45s var(--ease); }
.nav__contact:hover svg { transform: translateX(4px); }

.nav__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.nav__burger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--fg);
    border-radius: 2px;
    transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
}

.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =============================================================================
   PRZYCISKI
   ============================================================================= */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 999px;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease),
                border-color 0.5s var(--ease), color 0.4s var(--ease);
    will-change: transform;
}

.btn svg { transition: transform 0.45s var(--ease); }
.btn:hover svg { transform: translateX(5px); }

.btn--primary {
    color: var(--ink);
    background: var(--grad-gold);
    font-weight: 600;
    box-shadow: 0 14px 40px -18px rgba(201, 169, 106, 0.85);
}

/* połysk przesuwający się po przycisku */
.btn--primary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.55) 50%, transparent 75%);
    transform: translateX(-120%);
    transition: transform 0.9s var(--ease);
}

.btn--primary:hover::after { transform: translateX(120%); }

.btn--primary:hover {
    box-shadow: 0 20px 55px -18px rgba(201, 169, 106, 0.95);
}

.btn--ghost {
    color: var(--fg);
    border: 1px solid var(--line-2);
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn--ghost:hover {
    border-color: var(--gold);
    color: var(--gold-hi);
}

/* =============================================================================
   HERO (landing)
   ============================================================================= */
.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-content: center;
    padding: calc(var(--nav-h) + 40px) var(--gut) 90px;
    max-width: var(--maxw);
    margin: 0 auto;
    z-index: 1;
}

/* czytelność tekstu na tle sceny 3D */
.hero::before {
    content: "";
    position: absolute;
    left: calc(var(--gut) * -0.5);
    top: 8%;
    width: min(760px, 92%);
    height: 84%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(60% 55% at 30% 50%, rgba(8, 8, 11, 0.88), transparent 72%);
}

.hero__eyebrow { margin-bottom: 26px; }

.hero__name {
    font-size: clamp(3rem, 7.6vw, 5.9rem);
    letter-spacing: -0.03em;
    margin-bottom: 26px;
    transition: transform 0.5s var(--ease);
    transform-style: preserve-3d;
}

.hero__name em {
    font-style: italic;
    font-weight: 500;
    background: var(--grad-mix);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Maskowane wejście linii tytułu. overflow:hidden obcinał ogon kursywy
   w "Kopydłowski" (Playfair wychodzi glifem poza szerokość znaku), dlatego
   dokładamy zapas z prawej i cofamy go marginesem, żeby układ się nie ruszył. */
.hero__name .ln {
    display: block;
    overflow: hidden;
    /* Maska obcinala glify wychodzace poza ciasny wiersz (line-height 1.08):
       z prawej ogon kursywy, u gory kropke nad "i" w "Kopydlowski".
       Zapas dokladamy paddingiem i cofamy marginesem, zeby uklad zostal bez zmian. */
    padding-top: 0.18em;
    margin-top: -0.18em;
    padding-right: 0.16em;
    margin-right: -0.16em;
    padding-bottom: 0.06em;
}

.hero__name .ln > span {
    display: block;
    transform: translateY(105%);
    transition: transform 1.15s var(--ease);
}

.hero__name .ln.is-visible > span { transform: translateY(0); }

.hero__role {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    color: var(--fg);
    margin-bottom: 20px;
}

.hero__role .sep { color: var(--gold); }

.hero__tagline {
    max-width: 54ch;
    color: var(--fg-2);
    font-size: clamp(0.98rem, 1.5vw, 1.08rem);
    font-weight: 300;
    margin-bottom: 40px;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 56px;
}

.hero__scroll {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 10.5px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--fg-3);
}

.hero__scroll .bar {
    position: relative;
    width: 54px;
    height: 1px;
    background: var(--line-2);
    overflow: hidden;
}

.hero__scroll .bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--grad-gold);
    transform-origin: left;
    animation: scrollbar 2.6s var(--ease-io) infinite;
}

@keyframes scrollbar {
    0%        { transform: translateX(-100%); }
    55%, 100% { transform: translateX(100%); }
}

/* =============================================================================
   REVEAL (wspólne)
   ============================================================================= */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* linie tytułu hero mają własną animację — nie przesuwamy ich dwa razy */
.hero__name .ln[data-reveal] { opacity: 1; transform: none; }

/* =============================================================================
   UKŁAD SEKCJI
   ============================================================================= */
.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gut);
}

.home-feature {
    position: relative;
    z-index: 1;
    padding: clamp(80px, 12vh, 150px) 0;
    background: linear-gradient(180deg, transparent, var(--ink-2) 22%, var(--ink-2) 78%, transparent);
}

.home-feature__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 26px;
    margin-bottom: 56px;
}

/* --- pasek przewijanych technologii -------------------------------------- */
.marquee {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 26px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
    display: flex;
    width: max-content;
    gap: 56px;
    animation: marquee 38s linear infinite;
}

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

.marquee__track span {
    display: inline-flex;
    align-items: center;
    gap: 56px;
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-3);
    white-space: nowrap;
}

.marquee__track span::after {
    content: "◆";
    font-size: 7px;
    color: var(--gold);
}

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --- statystyki ----------------------------------------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.stat {
    padding: 32px 28px;
    background: var(--ink-2);
    transition: background 0.5s var(--ease);
}

.stat:hover { background: var(--ink-3); }

.stat__num {
    display: block;
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 6px;
}

.stat__label {
    font-size: 12.5px;
    color: var(--fg-2);
    line-height: 1.5;
}

/* =============================================================================
   KARTY — wspólna warstwa "szkła" + spotlight
   ============================================================================= */
.card,
.mini-card {
    position: relative;
    padding: clamp(26px, 3.4vw, 38px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    transition: border-color 0.6s var(--ease), transform 0.6s var(--ease),
                background 0.6s var(--ease);
}

/* poświata podążająca za kursorem (--mx/--my ustawia script.js) */
.card::before,
.mini-card::before,
.project__media::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s var(--ease);
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
                rgba(201, 169, 106, 0.11), transparent 70%);
}

.card:hover::before,
.mini-card:hover::before,
.project__media:hover::before { opacity: 1; }

.card:hover,
.mini-card:hover {
    border-color: var(--line-2);
    background: var(--surface-2);
    transform: translateY(-3px);
}

.card__label { margin-bottom: 20px; }

.card h2 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    margin-bottom: 16px;
}

.card h2 em {
    font-style: italic;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card p { color: var(--fg-2); font-weight: 300; }

/* --- mini-karty projektów na landingu ------------------------------------ */
.mini-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 20px;
}

.mini-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
}

.mini-card__idx {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 18px;
}

.mini-card__title {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.mini-card__desc {
    color: var(--fg-2);
    font-size: 14.5px;
    font-weight: 300;
    margin-bottom: 24px;
}

.mini-card__more {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    font-size: 11.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    transition: gap 0.45s var(--ease);
}

.mini-card__more:hover { gap: 15px; }

/* =============================================================================
   PASMO CTA (landing)
   ============================================================================= */
.cta-band {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: clamp(70px, 10vh, 118px) var(--gut);
}

.cta-band h2 {
    font-size: clamp(2.1rem, 5.4vw, 4rem);
    margin-bottom: 20px;
}

.cta-band h2 em {
    font-style: italic;
    background: var(--grad-mix);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cta-band p {
    max-width: 48ch;
    margin: 0 auto 36px;
    color: var(--fg-2);
    font-weight: 300;
}

/* =============================================================================
   O MNIE
   ============================================================================= */
.about {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: clamp(24px, 3.5vw, 46px);
    align-items: start;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: calc(var(--nav-h) + 60px) var(--gut) 110px;
}

.about__aside {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.about__photo {
    position: relative;
    border-radius: var(--r);
    overflow: hidden;
    aspect-ratio: 4 / 5;
}

.about__photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(8, 8, 11, 0.7));
}

.about__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.35) contrast(1.04);
    transition: transform 1.1s var(--ease), filter 0.9s var(--ease);
}

.about__aside:hover .about__photo img {
    transform: scale(1.05);
    filter: grayscale(0) contrast(1.06);
}

.about__id h1 {
    font-size: 1.55rem;
    margin-bottom: 6px;
}

.about__id .role {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
}

.about__id .bio {
    font-size: 14px;
    font-weight: 300;
    color: var(--fg-2);
    margin-bottom: 18px;
}

.about__socials {
    display: flex;
    gap: 10px;
}

.about__socials a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--fg-2);
    transition: color 0.4s var(--ease), border-color 0.4s var(--ease),
                transform 0.4s var(--ease), background 0.4s var(--ease);
}

.about__socials a svg { width: 16px; height: 16px; }

.about__socials a:hover {
    color: var(--gold-hi);
    border-color: var(--gold);
    background: var(--gold-dim);
    transform: translateY(-3px);
}

.about__contact { width: 100%; }

.about__main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 20px;
}

.about-quote {
    margin-top: 24px;
    padding: 20px 24px;
    border-left: 2px solid var(--gold);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: linear-gradient(90deg, var(--gold-dim), transparent);
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--fg);
}

.about-quote cite {
    display: block;
    margin-top: 8px;
    font-family: "Inter", sans-serif;
    font-style: normal;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--fg-3);
}

/* --- oś czasu ------------------------------------------------------------- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.timeline__item {
    position: relative;
    padding-left: 22px;
}

.timeline__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-dim);
}

.timeline__item::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 20px;
    bottom: -22px;
    width: 1px;
    background: linear-gradient(180deg, var(--line-2), transparent);
}

.timeline__item:last-child::after { display: none; }

.timeline__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.timeline__role { font-weight: 500; font-size: 15px; }

.timeline__date {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--gold);
    white-space: nowrap;
}

.timeline__org {
    display: block;
    font-size: 13.5px;
    font-weight: 300;
    color: var(--fg-2);
    margin-top: 3px;
}

/* --- umiejętności --------------------------------------------------------- */
.skill { margin-bottom: 20px; }
.skill:last-child { margin-bottom: 0; }

.skill__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 9px;
    font-size: 14px;
}

.skill__level {
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-3);
}

.skill__bar {
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.skill__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--grad-gold);
    box-shadow: 0 0 14px -2px rgba(201, 169, 106, 0.7);
    transition: width 1.5s var(--ease);
}

/* --- zainteresowania ------------------------------------------------------ */
.hobbies {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 16px;
}

.hobby {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: rgba(255, 255, 255, 0.018);
    transition: border-color 0.5s var(--ease), transform 0.5s var(--ease);
}

.hobby:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}

.hobby__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.hobby__title { font-weight: 500; font-size: 15px; }

.hobby__icon {
    font-size: 17px;
    opacity: 0.75;
    transition: transform 0.55s var(--ease);
}

.hobby:hover .hobby__icon { transform: scale(1.2) rotate(-8deg); }

.hobby p { font-size: 13.5px; }

/* --- stack / tagi --------------------------------------------------------- */
.stack__group { margin-bottom: 24px; }
.stack__group:last-child { margin-bottom: 0; }

.stack__group h4 {
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-3);
    margin-bottom: 12px;
}

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

.tag {
    padding: 6px 14px;
    font-size: 12px;
    letter-spacing: 0.04em;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--fg-2);
    background: rgba(255, 255, 255, 0.02);
    transition: color 0.4s var(--ease), border-color 0.4s var(--ease),
                background 0.4s var(--ease), transform 0.4s var(--ease);
}

.tag:hover {
    color: var(--gold-hi);
    border-color: var(--gold);
    background: var(--gold-dim);
    transform: translateY(-2px);
}

/* =============================================================================
   PROJEKTY
   ============================================================================= */
.projects {
    position: relative;
    z-index: 1;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: calc(var(--nav-h) + 60px) var(--gut) 110px;
}

.projects__head {
    max-width: 62ch;
    margin-bottom: clamp(56px, 9vh, 96px);
}

.projects__head h1 {
    font-size: clamp(2.6rem, 7vw, 5rem);
    margin: 16px 0 18px;
}

.projects__head p { color: var(--fg-2); font-weight: 300; }

.projects__subhead {
    max-width: 62ch;
    margin: clamp(60px, 9vh, 100px) 0 48px;
    padding-top: 48px;
    border-top: 1px solid var(--line);
}

.projects__subhead h2 {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    margin: 14px 0 14px;
}

.projects__subhead p { color: var(--fg-2); font-weight: 300; }

.project {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    margin-bottom: clamp(64px, 10vh, 120px);
}

.project:nth-child(even) .project__media { order: 2; }

.project__media {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--ink-3);
    aspect-ratio: 16 / 10;
    transition: transform 0.6s var(--ease), border-color 0.6s var(--ease),
                box-shadow 0.6s var(--ease);
    will-change: transform;
}

.project__media:hover {
    border-color: var(--line-2);
    box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.9);
}

.project__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
}

.project__media:hover img { transform: scale(1.045); }

.media-ph {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    height: 100%;
    color: var(--fg-3);
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.014) 0 12px, transparent 12px 24px),
        var(--ink-3);
}

.media-ph svg { width: 40px; height: 40px; }

.media-ph span {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.project__index {
    display: block;
    font-size: 11px;
    letter-spacing: 0.24em;
    color: var(--gold);
    margin-bottom: 14px;
}

.project__title {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    margin-bottom: 16px;
}

.project__desc {
    color: var(--fg-2);
    font-weight: 300;
    margin-bottom: 16px;
}

.project__suitable {
    font-size: 14px;
    color: var(--fg-2);
    font-weight: 300;
    margin-bottom: 20px;
}

.project__suitable strong { color: var(--fg); font-weight: 500; }

.project__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}

.project__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.project__status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px dashed var(--line-2);
    border-radius: 999px;
    color: var(--fg-3);
}

/* =============================================================================
   STOPKA
   ============================================================================= */
.footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 36px var(--gut);
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--fg-3);
}

.footer__socials {
    display: flex;
    gap: 26px;
}

.footer__socials a {
    position: relative;
    transition: color 0.4s var(--ease);
}

.footer__socials a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.45s var(--ease);
}

.footer__socials a:hover { color: var(--gold-hi); }

.footer__socials a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* =============================================================================
   MODAL KONTAKTOWY
   ============================================================================= */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 6, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal__card {
    position: relative;
    width: min(560px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid var(--line-2);
    border-radius: var(--r-xl);
    background: linear-gradient(160deg, var(--ink-3), var(--ink-2));
    box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.95);
    transform: translateY(22px) scale(0.97);
    transition: transform 0.65s var(--ease);
}

.modal.is-open .modal__card { transform: none; }

.modal__close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 26px;
    line-height: 1;
    color: var(--fg-3);
    transition: color 0.35s var(--ease), transform 0.35s var(--ease);
}

.modal__close:hover { color: var(--gold); transform: rotate(90deg); }

.modal__card h2 {
    font-size: clamp(1.6rem, 3.2vw, 2.1rem);
    margin-bottom: 10px;
}

.modal__sub {
    color: var(--fg-2);
    font-size: 14.5px;
    font-weight: 300;
    margin-bottom: 26px;
}

/* --- formularz ------------------------------------------------------------ */
.cform {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cform__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cform__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cform__field > span {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg-3);
}

.cform__field input,
.cform__field textarea {
    padding: 13px 16px;
    font-size: 14.5px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.025);
    resize: vertical;
    transition: border-color 0.4s var(--ease), background 0.4s var(--ease),
                box-shadow 0.4s var(--ease);
}

.cform__field input:focus,
.cform__field textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

.cform__submit {
    margin-top: 6px;
    align-self: flex-start;
}

.cform__submit[disabled] {
    opacity: 0.55;
    pointer-events: none;
}

.cform__status {
    min-height: 20px;
    font-size: 13.5px;
}

.cform__status.ok { color: #7fd1a2; }
.cform__status.err { color: #e08a8a; }

/* =============================================================================
   ELEMENTY GLOBALNE (dodawane przez script.js)
   ============================================================================= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 300;
    pointer-events: none;
}

.scroll-progress span {
    display: block;
    height: 100%;
    background: var(--grad-gold);
    transform: scaleX(0);
    transform-origin: left;
}

.to-top {
    position: fixed;
    right: clamp(16px, 3vw, 34px);
    bottom: clamp(16px, 3vw, 34px);
    z-index: 90;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    color: var(--fg-2);
    background: rgba(12, 12, 17, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
                color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.to-top.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.to-top:hover {
    color: var(--gold-hi);
    border-color: var(--gold);
}

.to-top svg { width: 17px; height: 17px; }

/* =============================================================================
   RESPONSYWNOŚĆ
   ============================================================================= */
@media (min-width: 1024px) {
    /* Tekst hero dostaje wlasna kolumne, zeby nigdy nie wszedl pod panele 3D
       stojace po prawej (ich pozycje ustawia src/hero3d.ts). */
    .hero { grid-template-columns: minmax(0, 640px); }
}

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

    .about__aside {
        position: static;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .about__photo {
        width: 170px;
        flex: none;
        aspect-ratio: 1;
    }

    .about__id { flex: 1 1 240px; }
}

@media (max-width: 860px) {
    .nav__links {
        position: fixed;
        inset: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        background: rgba(8, 8, 11, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
    }

    .nav__links.is-open {
        opacity: 1;
        visibility: visible;
    }

    .nav__links a { font-size: 22px; letter-spacing: 0.04em; }

    .nav__burger { display: flex; position: relative; z-index: 2; }
    .nav__contact { display: none; }
    .brand-word { display: none; }

    /* na wąskich ekranach scena 3D robi za tło — przygaszamy ją pod tekstem */
    /* na mobile zostaje sama warstwa cząstek (panele wyłącza hero3d.ts) */
    #hero3d.is-ready { opacity: 0.75; }
    #about3d.is-ready,
    #projects3d.is-ready { opacity: 0.3; }

    .hero { text-align: center; justify-items: center; }
    .hero::before { left: 0; width: 100%; }
    .hero__role, .hero__cta { justify-content: center; }
    .hero__tagline { margin-inline: auto; }

    .project:nth-child(even) .project__media { order: 0; }
}

@media (max-width: 560px) {
    /* separator „/" zawisałby na końcu linii przy zawijaniu roli */
    .hero__role { flex-direction: column; gap: 6px; }
    .hero__role .sep { display: none; }

    .cform__row { grid-template-columns: 1fr; }
    .footer { justify-content: center; text-align: center; }
    .home-feature__head { flex-direction: column; align-items: flex-start; }

    /* Ponizej 1024 px karta "O mnie" ustawia sie w rzad (zdjecie 170 px + tekst).
       Na najwezszych telefonach to sie nie miescilo i strona przewijala sie
       w poziomie -- tutaj wracamy do ukladu pionowego. */
    .about__aside { flex-direction: column; align-items: stretch; }
    .about__photo { width: 100%; aspect-ratio: 4 / 5; }
}

/* =============================================================================
   OGRANICZONY RUCH
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    [data-reveal] { opacity: 1; transform: none; }
    .hero__name .ln > span { transform: none; }
    .marquee__track { animation: none; }
}
