/* ==========================================================================
   karpinskikamil.pl — CV / portfolio
   Ciemny motyw na zmiennych CSS. Bez zależności zewnętrznych poza fontami.
   ========================================================================== */

:root {
    --bg:           #0b0d10;
    --bg-elev:      #10141a;
    --surface:      #13181f;
    --surface-2:    #191f28;
    --border:       #232b36;
    --border-soft:  #1b222c;

    --text:         #e8edf3;
    --muted:        #93a0ae;
    --dim:          #6b7887;

    --accent:       #e0a458;
    --accent-hi:    #f0bd7c;
    --accent-soft:  rgba(224, 164, 88, .12);
    --accent-line:  rgba(224, 164, 88, .35);

    --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Kontener na całą szerokość okna. Gdybyś chciał go jednak ograniczyć,
       wystarczy wpisać tu konkretną wartość, np. 100rem. */
    --shell:        none;
    --shell-pad:    clamp(20px, 3.5vw, 72px);
    --radius:       14px;
    --radius-sm:    8px;

    --nav-h:        64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Ciepła poświata za sekcją hero — czysto dekoracyjna. */
body::before {
    content: "";
    position: fixed;
    inset: -20% 0 auto 0;
    height: 60vh;
    background:
        radial-gradient(60% 55% at 18% 0%, rgba(224, 164, 88, .10), transparent 70%),
        radial-gradient(45% 50% at 82% 8%, rgba(120, 150, 200, .07), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin: 0;
}

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

blockquote, figure { margin: 0; }

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

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

/* --- Skip link ---------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
}
.skip-link:focus {
    left: 12px;
    top: 12px;
    padding: 10px 18px;
    background: var(--accent);
    color: #14100a;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* --- Layout ------------------------------------------------------------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--shell-pad);
}

.page { position: relative; z-index: 1; }

.section { padding-block: 72px; }
.section + .section { padding-top: 0; }

.section__head { margin-bottom: 32px; }

.eyebrow {
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.eyebrow::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-line), transparent);
}

.section__title {
    font-size: clamp(1.6rem, 3.4vw, 2.1rem);
}

.section__desc {
    color: var(--muted);
    margin-top: 10px;
    max-width: 54ch;
}

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

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: rgba(11, 13, 16, .72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s, background .25s;
}
.nav.is-stuck {
    border-bottom-color: var(--border-soft);
    background: rgba(11, 13, 16, .88);
}

.nav__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.nav__brand {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.03em;
    font-size: 1.05rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-right: auto;
}
.nav__mark {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: linear-gradient(140deg, var(--accent), #b9713a);
    color: #14100a;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 0;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav__link {
    display: block;
    padding: 7px 11px;
    font-size: .875rem;
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color .18s, background .18s;
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link.is-active { color: var(--accent); }

.nav__tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang {
    display: flex;
    align-items: center;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}
.lang__opt {
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--dim);
    border-radius: 999px;
    transition: color .18s, background .18s;
}
.lang__opt:hover { color: var(--text); }
.lang__opt.is-active {
    background: var(--accent);
    color: #14100a;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    font-family: var(--font-display);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .18s, background .18s, border-color .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--accent);
    color: #14100a;
}
.btn--primary:hover { background: var(--accent-hi); }

.btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent-line); color: var(--accent); }

.btn--sm { padding: 7px 14px; font-size: .8rem; }

.btn .ico { width: 16px; height: 16px; flex: none; }

/* --- Menu mobilne ------------------------------------------------------- */

.nav__toggle {
    display: none;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    place-items: center;
}

.nav__drawer {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    display: none;
    padding: 14px 20px 20px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    z-index: 49;
}
.nav__drawer.is-open { display: block; }
.nav__drawer .shell { padding-inline: 0; }
.nav__drawer .nav__link {
    padding: 11px 12px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
}
.nav__drawer-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
/* Przełącznik w szufladzie jest widoczny także tam, gdzie ten w navie znika. */
.lang--drawer { display: flex !important; }

/* --- Hero --------------------------------------------------------------- */

.hero { padding-block: 64px 56px; }

.hero__grid {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 32px;
}

.hero__avatar {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-line);
    padding: 5px;
    background: var(--surface);
    margin-top: 6px;
}

.hero__name {
    font-size: clamp(2.1rem, 6vw, 3.2rem);
    letter-spacing: -.035em;
}

.hero__role {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2.4vw, 1.15rem);
    color: var(--accent);
    margin-top: 6px;
}

.hero__lede {
    color: var(--muted);
    margin-top: 16px;
    max-width: 60ch;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: .8rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.chip .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

/* --- Umiejętności ------------------------------------------------------- */

/* Wiersze zamiast kart: etykieta kategorii po lewej, technologie po prawej. */
.skills { display: grid; }

.skill-row {
    display: grid;
    grid-template-columns: minmax(150px, 210px) 1fr;
    align-items: start;
    gap: 28px;
    padding-block: 20px;
    border-top: 1px solid var(--border-soft);
    transition: border-color .2s;
}
.skill-row:last-child { border-bottom: 1px solid var(--border-soft); }
.skill-row:hover { border-top-color: var(--accent-line); }

.skill-row__label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 3px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    line-height: 1.4;
}
.skill-row__label .ico {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex: none;
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
    padding: 3px 10px;
    font-size: .78rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    white-space: nowrap;
}

/* --- Oś czasu ----------------------------------------------------------- */

.timeline { display: grid; gap: 4px; }

.tl-item {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 24px;
    padding-bottom: 30px;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-period {
    font-family: var(--font-display);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    padding-top: 2px;
}
.tl-period .tl-now { color: var(--accent); }

.tl-body {
    position: relative;
    padding-left: 26px;
    border-left: 1px solid var(--border);
}
.tl-item:last-child .tl-body { border-left-color: transparent; }
.tl-body::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(224, 164, 88, .15);
}

.tl-role { font-size: 1.05rem; }
.tl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: .875rem;
    color: var(--muted);
}
.tl-company { color: var(--accent); font-weight: 500; }
.tl-sep { color: var(--dim); }

.tl-bullets { margin-top: 12px; display: grid; gap: 7px; max-width: 88ch; }
.tl-bullets li,
.project__bullets li {
    position: relative;
    padding-left: 20px;
    color: var(--muted);
    font-size: .92rem;
}
.tl-bullets li::before,
.project__bullets li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: .66em;
    width: 5px;
    height: 1.5px;
    background: var(--accent);
}

.badge-todo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #f0bd7c;
    background: var(--accent-soft);
    border: 1px dashed var(--accent-line);
    border-radius: 999px;
}

/* --- Projekty ----------------------------------------------------------- */

.projects { display: grid; gap: 16px; }

/* Projekty autorskie idą jeden pod drugim, na pełną szerokość. */
.projects__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}


.project {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .2s;
}
.project:hover { border-color: #303a48; }

.project--featured {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    border-color: var(--accent-line);
    background: linear-gradient(180deg, var(--surface), var(--bg-elev));
}

.project__media {
    position: relative;
    background: var(--surface-2);
    border-right: 1px solid var(--border);
    overflow: hidden;
}
.project__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left top;
    transition: transform .5s ease;
}
.project--featured:hover .project__media img { transform: scale(1.03); }

/* Karta pozioma: lewy pasek z nazwą i stackiem, po prawej opis. */
.project--row {
    display: grid;
    grid-template-columns: minmax(200px, 240px) 1fr;
}

.project__rail {
    padding: 26px;
    border-right: 1px solid var(--border);
    background: linear-gradient(160deg, var(--surface-2), transparent 70%);
}
.project__rail .project__name { margin-bottom: 10px; }
.project__rail .project__type { display: inline-block; }


.project__body { padding: 26px; display: flex; flex-direction: column; }

.project__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.project__name { font-size: 1.15rem; }

.project__type {
    padding: 2px 9px;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-radius: 999px;
}
.project__type--commercial { color: #14100a; background: var(--accent); }
.project__type--project    { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.project__type--product    { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }

.project__summary { color: var(--muted); font-size: .93rem; margin-top: 8px; max-width: 88ch; }
.project__bullets { margin-top: 14px; display: grid; gap: 6px; max-width: 88ch; }

.project__foot {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.project__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-size: .875rem;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    transition: gap .18s;
}
.project__link:hover { gap: 11px; text-decoration: underline; }

.project__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    color: var(--accent);
    margin-bottom: 14px;
}
.project__icon .ico { width: 19px; height: 19px; }

/* --- Referencje --------------------------------------------------------- */

.quote {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 28px;
    margin: 0;
}
.quote__mark {
    font-family: var(--font-display);
    font-size: 2.4rem;
    line-height: 1;
    color: var(--accent-line);
    margin-bottom: 6px;
}
.quote__text { display: grid; gap: 14px; color: var(--muted); max-width: 92ch; }
.quote__cite {
    display: block;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
    font-style: normal;
    font-size: .875rem;
}
.quote__author { font-family: var(--font-display); color: var(--text); font-weight: 600; }
.quote__where  { color: var(--dim); }

/* --- Zainteresowania ---------------------------------------------------- */

.interests { display: flex; flex-wrap: wrap; gap: 9px; }

/* --- Kontakt / stopka --------------------------------------------------- */

.contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: clamp(32px, 5vw, 72px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}

.contact__lede { color: var(--muted); margin-top: 12px; max-width: 46ch; }

.contact__services-lead {
    margin-top: 26px;
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dim);
}

.contact__services {
    margin-top: 12px;
    display: grid;
    gap: 9px;
    max-width: 62ch;
}
.contact__services li {
    position: relative;
    padding-left: 22px;
    color: var(--muted);
    font-size: .92rem;
}
.contact__services li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .55em;
    width: 7px;
    height: 7px;
    border: 1px solid var(--accent);
    border-radius: 2px;
    transform: rotate(45deg);
}

/* --- Kanały kontaktu --- */

.contact__channels { display: grid; align-content: start; gap: 10px; }

.contact__status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 4px;
    font-size: .85rem;
    color: var(--accent);
}
.contact__status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    flex: none;
}

.channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: border-color .2s, background .2s;
}
.channel--link:hover { border-color: var(--accent-line); background: var(--surface-2); }

.channel__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
}
.channel__icon .ico { width: 17px; height: 17px; }

.channel__body { display: grid; gap: 1px; min-width: 0; }

.channel__label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--dim);
}
.channel__value {
    font-size: .9rem;
    color: var(--text);
    text-decoration: none;
    overflow-wrap: anywhere;
}
a.channel__value:hover { color: var(--accent); }

.channel__go {
    margin-left: auto;
    color: var(--dim);
    display: grid;
    place-items: center;
    transition: color .2s, transform .2s;
}
.channel__go .ico { width: 16px; height: 16px; }
.channel--link:hover .channel__go { color: var(--accent); transform: translate(2px, -2px); }

.channel__copy {
    margin-left: auto;
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
.channel__copy:hover { color: var(--accent); border-color: var(--accent-line); }
.channel__copy .ico { width: 15px; height: 15px; }
.channel__copy-done { display: none; }
.channel__copy.is-copied { color: var(--accent); border-color: var(--accent-line); }
.channel__copy.is-copied .channel__copy-idle { display: none; }
.channel__copy.is-copied .channel__copy-done { display: grid; }

.contact__cta { margin-top: 6px; justify-content: center; }

/* Tekst wyłącznie dla czytników ekranu. */
.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;
}

.footer {
    margin-top: 56px;
    padding-block: 26px 40px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: .82rem;
    color: var(--dim);
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* --- Animacja pojawiania ------------------------------------------------ */

[data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s ease;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

.no-js [data-reveal] { opacity: 1; transform: none; }

/* --- Breakpointy -------------------------------------------------------- */

@media (max-width: 900px) {
    .project--featured { grid-template-columns: 1fr; }

    .project--row { grid-template-columns: 1fr; }
    .project__rail {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding-bottom: 20px;
    }
    .project--row .project__body { padding-top: 20px; }
    .project__media { border-right: 0; border-bottom: 1px solid var(--border); aspect-ratio: 16 / 10; }
}

@media (max-width: 760px) {
    .nav__links { display: none; }
    .nav__toggle { display: grid; }
    .nav__desktop-cv { display: none; }

    .section { padding-block: 56px; }

    .hero { padding-block: 40px 44px; }
    .hero__grid { grid-template-columns: 1fr; gap: 22px; }
    .hero__avatar { width: 104px; height: 104px; }

    .skill-row { grid-template-columns: 1fr; gap: 12px; padding-block: 18px; }
    .skill-row__label { padding-top: 0; }

    .tl-item { grid-template-columns: 1fr; gap: 8px; }
    .tl-period { padding-left: 26px; }

    .project__body { padding: 20px; }

    .contact { grid-template-columns: 1fr; gap: 32px; padding: 30px 22px; }
}

@media (max-width: 420px) {
    .lang { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
}

/* --- Wydruk / eksport do PDF -------------------------------------------- */

@media print {
    /* Szerokość strony A4 mieści się poniżej breakpointów 900px i 760px,
       więc układy wielokolumnowe trzeba tu odtworzyć jawnie. */

    @page {
        size: A4;
        margin: 12mm 12mm 13mm;
    }

    :root {
        --bg: #fff;
        --bg-elev: #fff;
        --surface: #fff;
        --surface-2: #f4f4f5;
        --border: #d4d4d8;
        --border-soft: #e4e4e7;
        --text: #18181b;
        --muted: #3f3f46;
        --dim: #71717a;
        --accent: #8a5a1f;
        --accent-line: #c8a97e;
        --accent-soft: #faf5ec;

        --shell-pad: 0;
    }

    body {
        background: #fff;
        font-size: 9.4pt;
        line-height: 1.42;
    }
    body::before { display: none; }

    /* Sekcje poniżej pierwszego ekranu nigdy nie dostają klasy .is-visible
       (IntersectionObserver nie odpala się przy renderowaniu do druku),
       więc odsłaniamy je bezwarunkowo. */
    [data-reveal] { opacity: 1 !important; transform: none !important; }

    /* Elementy bezużyteczne na papierze. */
    .nav, .nav__drawer, .skip-link, .sr-only,
    .hero__cta, .contact__cta, .channel__copy,
    .project__media, .project__icon, .quote__mark,
    .footer { display: none !important; }

    /* --- Rytm strony --- */

    /* Odstęp między sekcjami daje na ekranie dolny padding, a `.section + .section`
       zeruje górny. Ta reguła ma wyższą specyficzność niż samo `.section`, więc
       trzeba ją tutaj nadpisać jawnie — inaczej nagłówki sklejają się z tekstem
       poprzedniej sekcji. */
    .section,
    .section + .section { padding-block: 22pt 0; break-inside: auto; }
    .section__head { margin-bottom: 8pt; }
    .section__desc { margin-top: 4pt; }

    /* Nagłówek nigdy nie zostaje sam na dole strony. */
    h1, h2, h3, .eyebrow, .section__head, .contact__services-lead {
        break-after: avoid;
        page-break-after: avoid;
    }

    p, li { orphans: 2; widows: 2; }

    .eyebrow { font-size: .62rem; margin-bottom: 4pt; }
    .section__title { font-size: 15pt; }

    /* --- Nagłówek CV --- */

    .hero { padding-block: 0 6pt; }
    .hero__grid { grid-template-columns: auto 1fr; gap: 14pt; align-items: center; }
    .hero__avatar { width: 74px; height: 74px; padding: 3px; margin-top: 0; }
    .hero__name { font-size: 22pt; }
    .hero__role { font-size: 11pt; margin-top: 2pt; }
    .hero__lede { margin-top: 6pt; max-width: none; }
    .chips { margin-top: 8pt; gap: 5pt; }
    .chip { padding: 2pt 7pt; font-size: .72rem; }

    /* --- Umiejętności --- */

    .skill-row {
        grid-template-columns: 130px 1fr;
        gap: 14pt;
        padding-block: 7pt;
        break-inside: avoid;
    }
    .skill-row__label { padding-top: 1pt; font-size: .66rem; letter-spacing: .1em; }
    .skill-row__label .ico { width: 12px; height: 12px; }
    .tags { gap: 4pt; }
    .tag { padding: 1.5pt 7pt; font-size: .72rem; }

    /* --- Doświadczenie --- */

    .tl-item {
        grid-template-columns: 88px 1fr;
        gap: 14pt;
        padding-bottom: 10pt;
        break-inside: avoid;
    }
    .tl-period { padding-top: 0; padding-left: 0; font-size: .78rem; }
    .tl-body { padding-left: 14pt; }
    .tl-role { font-size: 10.5pt; }
    .tl-bullets { margin-top: 5pt; gap: 3pt; max-width: none; }
    .tl-bullets li { font-size: .84rem; }
    .badge-todo { display: none; }

    /* Chrome błędnie dzieli kontenery `grid` między stronami: wysokości wierszy
       liczy dla układu nierozdzielonego, więc element następujący po podzielonym
       jest rysowany na wierzchu jego dalszej części. Na papierze przechodzimy
       na zwykły przepływ blokowy, który fragmentuje się poprawnie. Odstępy
       z `gap` trzeba wtedy odtworzyć marginesami. */
    .projects,
    .projects__grid,
    .skills,
    .timeline,
    .quote__text,
    .tl-bullets,
    .project__bullets,
    .contact__services,
    .contact__channels { display: block; }

    .quote__text > p + p { margin-top: 6pt; }
    .tl-bullets li + li,
    .project__bullets li + li,
    .contact__services li + li { margin-top: 3pt; }

    /* --- Projekty: karty spłaszczone do formy dokumentu --- */

    .project {
        display: block;
        background: none;
        border: 0;
        border-radius: 0;
        padding: 0;
        margin: 0;
        overflow: visible;
        /* Karta może się podzielić — inaczej na dole strony zostaje pusty pas.
           Miejsce podziału kontrolują reguły niżej: nazwa projektu i opis nie
           odrywają się od punktów, a pojedynczy punkt nie zostaje sam. */
        break-inside: auto;
    }
    .project + .project,
    .projects__grid > .project {
        border-top: 1px solid var(--border-soft);
        padding-top: 8pt;
        margin-top: 8pt;
    }

    .project__rail {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 7pt;
        padding: 0;
        border: 0;
        background: none;
    }
    .project__rail .project__name { margin-bottom: 0; }
    /* Nagłówek projektu zawsze zostaje razem z tym, co po nim następuje. */
    .project__rail,
    .project__head,
    .project__summary {
        break-after: avoid;
        page-break-after: avoid;
    }
    .project__body { display: block; padding: 0; }

    .project__head { margin-bottom: 0; gap: 7pt; }
    .project__name { font-size: 11pt; }
    .project__type { padding: 1.5pt 6pt; font-size: .6rem; }

    .project__summary { margin-top: 3pt; max-width: none; font-size: .88rem; }
    .project__bullets { margin-top: 5pt; gap: 3pt; max-width: none; }
    .project__bullets li { font-size: .84rem; break-inside: avoid; }
    /* Pierwszy punkt trzyma się drugiego, ostatni poprzedniego — dzięki temu
       na łamaniu nigdy nie zostaje samotny wiersz listy. */
    .project__bullets li:first-child { break-after: avoid; page-break-after: avoid; }
    .project__bullets li:last-child  { break-before: avoid; page-break-before: avoid; }

    .project__foot {
        margin-top: 5pt;
        padding-top: 0;
        break-before: avoid;
        page-break-before: avoid;
    }
    .project__link { font-size: .8rem; }
    .project__link::after {
        content: " — " attr(href);
        color: var(--dim);
        font-size: .92em;
    }
    .project__link .ico { display: none; }

    /* --- Referencje --- */

    .quote {
        background: none;
        border: 0;
        border-left: 2pt solid var(--accent-line);
        border-radius: 0;
        padding: 0 0 0 12pt;
        break-inside: auto;
    }
    .quote__text { gap: 6pt; max-width: none; font-size: .86rem; }
    .quote__cite {
        margin-top: 8pt;
        padding-top: 6pt;
        font-size: .8rem;
        break-before: avoid;
        page-break-before: avoid;
    }

    /* --- Zainteresowania --- */

    .interests { gap: 5pt; break-inside: avoid; page-break-inside: avoid; }

    /* --- Kontakt --- */

    .contact {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20pt;
        background: none;
        border: 0;
        border-radius: 0;
        padding: 0;
        break-inside: avoid;
    }
    .contact__lede { max-width: none; }
    .contact__services-lead { margin-top: 10pt; font-size: .62rem; }
    .contact__services { margin-top: 5pt; gap: 3pt; max-width: none; }
    .contact__services li { font-size: .84rem; }

    .contact__channels { gap: 0; }
    .contact__status { margin-bottom: 6pt; font-size: .84rem; }

    .channel {
        padding: 4pt 0;
        background: none;
        border: 0;
        border-bottom: 1px solid var(--border-soft);
        border-radius: 0;
        gap: 9pt;
        break-inside: avoid;
    }
    .channel:last-of-type { border-bottom: 0; }
    .channel__icon {
        width: 20px;
        height: 20px;
        border-radius: 5px;
        background: none;
        border: 1px solid var(--border);
    }
    .channel__icon .ico { width: 12px; height: 12px; }
    .channel__label { font-size: .6rem; }
    .channel__value { font-size: .84rem; }
    .channel__go { display: none; }
}
