@font-face {
    font-family: "Rubik Brand";
    src: url("/assets/fonts/rubik-700.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    --black: #090909;
    --red: #f00000;
    --red-dark: #c90000;
    --white: #fff;
    --warm: #f4f2ee;
    --muted: #6d6b67;
    --line: #d4d0c8;
    --max: 1180px;
    --wide: 1440px;
    --header: 82px;
    --space: clamp(3.75rem, 6vw, 6rem);
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 1.5rem); }
html, body { max-width: 100%; overflow-x: clip; }
body { margin: 0; color: var(--black); background: var(--warm); font-family: var(--font); font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
body.nav-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
::selection { color: var(--white); background: var(--red); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 750; line-height: 1.04; letter-spacing: -.035em; }
h1 { font-size: clamp(2.7rem, 5.2vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.7rem); }
p { max-width: 72ch; overflow-wrap: anywhere; }
.hero__copy, .competency-hero__inner > *, .page-hero__inner > * { min-width: 0; }

.skip-link { position: fixed; z-index: 2000; top: .75rem; left: .75rem; padding: .75rem 1rem; color: var(--white); background: var(--red); transform: translateY(-160%); transition: transform .2s; }
.skip-link:focus { transform: translateY(0); }
.section-shell { width: min(calc(100% - 3rem), var(--max)); margin-inline: auto; }
.eyebrow { margin-bottom: 1rem; color: var(--red); font-size: .73rem; font-weight: 800; letter-spacing: .17em; line-height: 1.3; text-transform: uppercase; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.button { display: inline-flex; min-height: 3.25rem; padding: .75rem 1.25rem; align-items: center; justify-content: center; border: 1px solid transparent; font-size: .83rem; font-weight: 800; letter-spacing: .04em; line-height: 1.2; text-decoration: none; text-transform: uppercase; transition: color .2s, background .2s, border-color .2s, transform .2s; }
.button:hover { transform: translateY(-2px); }
.button--primary { color: var(--white); background: var(--red); }
.button--primary:hover { background: var(--red-dark); }
.button--outline { color: var(--white); border-color: #777; }
.button--outline:hover { border-color: var(--white); background: #202020; }
.button--dark { color: var(--white); background: var(--black); }
.button--dark:hover { background: var(--red); }
.external-link { display: inline-flex; width: fit-content; gap: .55rem; align-items: center; color: inherit; font-size: .85rem; font-weight: 800; letter-spacing: .025em; text-decoration: none; }
.external-link:hover { color: var(--red); }

/* Header */
.site-header { position: relative; z-index: 1000; height: var(--header); color: var(--white); background: var(--black); border-bottom: 1px solid #282828; }
.header-inner { display: flex; width: min(calc(100% - 3rem), var(--wide)); height: 100%; margin-inline: auto; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: flex; flex: 0 0 auto; align-items: center; padding: .4rem 0; }
.brand img { width: 220px; height: auto; }
.primary-nav > ul { display: flex; margin: 0; padding: 0; align-items: center; gap: .2rem; list-style: none; }
.primary-nav > ul > li { position: relative; }
.primary-nav a { display: flex; min-height: 44px; padding: .75rem .9rem; align-items: center; color: #d7d7d7; font-size: .84rem; font-weight: 700; text-decoration: none; }
.primary-nav > ul > li > a::after { position: absolute; right: .9rem; bottom: .38rem; left: .9rem; height: 2px; background: var(--red); content: ""; transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.primary-nav > ul > li:hover > a::after, .primary-nav > ul > li.is-active > a::after { transform: scaleX(1); }
.primary-nav a:hover { color: var(--white); }
.nav-toggle { display: none; min-width: 48px; min-height: 48px; padding: 0; align-items: center; gap: .75rem; color: var(--white); background: transparent; border: 0; cursor: pointer; }
.nav-toggle__label { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-toggle__icon { position: relative; display: block; width: 23px; height: 15px; }
.nav-toggle__icon i { position: absolute; left: 0; display: block; width: 23px; height: 2px; background: currentColor; transition: top .2s, transform .2s; }
.nav-toggle__icon i:first-child { top: 2px; }
.nav-toggle__icon i:last-child { top: 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon i:first-child { top: 7px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon i:last-child { top: 7px; transform: rotate(-45deg); }

/* Breadcrumbs */
.breadcrumbs { color: #a9a9a9; background: var(--black); border-top: 1px solid #202020; }
.breadcrumbs ol { display: flex; width: min(calc(100% - 3rem), var(--max)); margin: 0 auto; padding: .72rem 0; flex-wrap: wrap; align-items: center; gap: .5rem; list-style: none; font-size: .74rem; }
.breadcrumbs li:not(:last-child)::after { margin-left: .5rem; color: #555; content: "/"; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--white); }
.breadcrumbs [aria-current="page"] { color: #e5e5e5; }

/* Home */
.hero { overflow: hidden; color: var(--white); background: var(--black); }
.hero__inner { width: min(calc(100% - 3rem), var(--wide)); min-height: 610px; margin-inline: auto; }
.hero__copy { display: flex; padding: clamp(4.5rem, 8vw, 7rem) 0; flex-direction: column; justify-content: center; }
.hero__copy h1 { max-width: 1050px; margin-bottom: 1.25rem; font-size: clamp(3rem, 5.8vw, 5.5rem); }
.hero__lead { max-width: 800px; margin-bottom: 2.4rem; color: #c9c9c9; font-size: clamp(1rem, 1.35vw, 1.18rem); }
.home-competencies { padding-block: var(--space); }
.home-competencies__header { display: grid; margin-bottom: 3rem; grid-template-columns: .8fr 1.2fr; gap: .8rem 5rem; }
.home-competencies__header h2 { margin: 0; }
.competency-list { border-top: 1px solid var(--line); }
.competency-row { display: grid; padding: 2rem 0; grid-template-columns: 52px minmax(0, 1.25fr) minmax(240px, .75fr) 42px; align-items: center; gap: 1.5rem 3rem; border-bottom: 1px solid var(--line); }
.competency-row__number { align-self: start; padding-top: .35rem; color: var(--red); font-size: .78rem; font-weight: 850; }
.competency-row h3 { margin: 0 0 .65rem; font-size: clamp(1.5rem, 2.6vw, 2.4rem); }
.competency-row h3 a { text-decoration: none; }
.competency-row h3 a:hover { color: var(--red); }
.competency-row__main p { margin: 0; color: #55534f; }
.competency-row__projects { display: flex; margin: 0; padding: 0; flex-wrap: wrap; gap: .35rem; list-style: none; }
.competency-row__projects li { padding: .25rem .5rem; color: #55534f; background: var(--white); border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .66rem; overflow-wrap: anywhere; }
.competency-row__arrow { display: grid; width: 40px; height: 40px; place-items: center; color: var(--white); background: var(--black); text-decoration: none; }
.competency-row__arrow:hover { background: var(--red); }

/* Competency directory */
.page-hero { color: var(--white); background: var(--black); }
.page-hero__inner { width: min(calc(100% - 3rem), var(--max)); margin-inline: auto; padding: 3.5rem 0; }
.page-hero__inner h1 { max-width: 1050px; margin: 0; }
.competency-directory { padding-block: var(--space); }
.competency-directory__list { border-top: 1px solid var(--line); }
.competency-directory__row { display: grid; min-height: 230px; padding: 2rem 0; grid-template-columns: 70px 1.2fr .8fr 50px; align-items: center; gap: clamp(1rem, 4vw, 4rem); border-bottom: 1px solid var(--line); }
.competency-directory__number { color: var(--red); font-weight: 850; }
.competency-directory__row h2 { margin-bottom: .8rem; font-size: clamp(1.8rem, 3vw, 3rem); }
.competency-directory__row p { margin-bottom: 0; color: var(--muted); }
.competency-directory__projects { display: flex; flex-wrap: wrap; gap: .45rem; }
.competency-directory__projects span { padding: .35rem .55rem; color: #4c4b48; background: var(--white); border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .68rem; overflow-wrap: anywhere; }
.competency-directory__link { display: grid; width: 48px; height: 48px; place-items: center; color: var(--white); background: var(--black); font-size: 1.25rem; text-decoration: none; transition: background .2s; }
.competency-directory__link:hover { background: var(--red); }

/* Competency pages */
.competency-hero { color: var(--white); background: var(--black); }
.competency-hero__inner { display: grid; width: min(calc(100% - 3rem), var(--max)); margin-inline: auto; padding: 3.5rem 0 clamp(4.5rem, 8vw, 7rem); grid-template-columns: 1fr 1fr; align-items: end; gap: clamp(2rem, 8vw, 8rem); }
.competency-hero h1 { margin-bottom: 0; }
.competency-hero__inner > p { margin-bottom: .7rem; color: #c1c1c1; font-size: 1.1rem; }
.project-section { padding-block: var(--space); }
.project-section__header { display: grid; margin-bottom: 3.5rem; grid-template-columns: 1fr; gap: 1rem; }
.project-section__header h2 { margin-bottom: 0; font-size: clamp(1.55rem, 4vw, 4rem); white-space: nowrap; }
.project-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.project-card { display: grid; min-height: 0; padding: clamp(1.5rem, 3.5vw, 3rem); grid-template-columns: 510px minmax(0, 1fr); align-items: start; gap: 1.2rem 2.5rem; background: var(--white); border: 1px solid var(--line); }
.project-card__logo { display: flex; min-height: 160px; margin: 0; padding: 1.25rem; align-items: center; justify-content: center; border: 0; }
.project-card__logo--light { background: var(--white); }
.project-card__logo a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; text-decoration: none; }
.project-grid--bottom-aligned .project-card__logo { align-self: end; }
.project-card__logo img { width: auto; max-width: 100%; max-height: 112px; object-fit: contain; }
.project-brand-lockup { display: flex; max-width: 100%; align-items: center; }
.project-brand-lockup--text { gap: 8px; white-space: nowrap; }
.project-brand-lockup--text img { flex: 0 0 auto; width: auto; height: 42px; }
.project-brand-lockup--text > span { color: #111; font-family: "Rubik Brand", "Rubik", "Segoe UI", Arial, Helvetica, sans-serif; font-size: 2.1rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.project-card__logo[data-project="psychometria.co.pl"] .project-brand-lockup--text > span { font-size: 2.05rem; }
.project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text { gap: 10px; }
.project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text img { height: 52.5px; }
.project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text > span { font-size: 2.625rem; }
.project-card__logo[data-project="zabronione.pl"] .project-brand-lockup--text > span { color: #003c7e; }
.project-card__logo[data-project="terroryzm.edu.pl"] .project-brand-lockup--text img { height: 39px; }
.project-card__logo[data-project="zabronione.pl"] .project-brand-lockup--text img { height: 44px; }
.project-brand-lockup--formacja { gap: 15px; }
.project-brand-lockup--formacja .project-brand-lockup__symbol { width: auto; height: 50.6px; max-height: none; }
.project-brand-lockup--formacja .project-brand-lockup__wordmark { width: auto; height: 46px; max-height: none; transform: translateY(8px); }
.project-card__copy { grid-column: 2; }
.project-card__copy p { color: #55534f; }
.project-card__lead { color: var(--black) !important; font-size: 1.05rem; font-weight: 650; }
.tag-list, .project-card > .external-link { grid-column: 2; }
.tag-list { display: flex; margin: 0; padding: .2rem 0 0; flex-wrap: wrap; gap: .45rem; list-style: none; }
.tag-list li { padding: .28rem .55rem; color: #4d4c49; background: var(--warm); border: 1px solid #e1ddd5; font-size: .7rem; line-height: 1.3; }
.project-card > .external-link { margin-top: .3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.competency-switcher { padding-bottom: var(--space); }
.competency-switcher > p { margin-bottom: 1rem; font-size: .73rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.competency-switcher > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.competency-switcher a { display: inline-flex; min-height: 44px; padding: .6rem .85rem; align-items: center; gap: .55rem; background: var(--white); border: 1px solid var(--line); font-size: .8rem; font-weight: 750; text-decoration: none; }
.competency-switcher a span { color: var(--red); }
.competency-switcher a:hover { color: var(--white); background: var(--black); border-color: var(--black); }

/* Cooperation and contact */
.editorial-page-header { padding-block: 3.5rem; color: var(--white); background: var(--black); }
.editorial-page-header h1 { margin: 0; }
.editorial-profile-wrap { background: var(--white); }
.editorial-profile { display: grid; padding-block: var(--space); grid-template-columns: 359px minmax(0, 760px); align-items: start; gap: clamp(2.5rem, 6vw, 5rem); }
.editorial-profile__portrait { margin: 0; background: var(--white); border: 0; }
.editorial-profile__portrait img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; object-position: center bottom; }
.editorial-profile__bio { font-size: .98rem; }
.editorial-profile__bio p { margin-bottom: 1.15rem; }
.editorial-profile__publications { display: flex; margin: -.35rem 0 1.25rem; padding: 0; flex-wrap: wrap; gap: .35rem .5rem; list-style: none; }
.editorial-profile__publications li { display: contents; }
.editorial-profile__publications a { padding: .2rem .45rem; background: var(--white); border: 1px solid var(--line); font-size: .76rem; text-decoration: none; }
.editorial-profile__publications a:hover { color: var(--red); border-color: var(--red); }
.editorial-profile--contact { grid-template-columns: minmax(0, 560px) minmax(0, 520px); }
.contact-profile__image img { height: auto; aspect-ratio: auto; object-fit: contain; object-position: center; }
.contact-company { padding-top: .25rem; }
.contact-company h2 { max-width: 540px; margin-bottom: 1.5rem; font-size: clamp(2rem, 3.5vw, 3.4rem); }
.contact-company h2 a { text-decoration: none; overflow-wrap: anywhere; }
.contact-company h2 a:hover { color: var(--red); }
.contact-company__address { margin: 0; font-style: normal; line-height: 1.7; }
.contact-company__registry { max-width: 600px; margin: 1.7rem 0 0 !important; line-height: 1.7; }

/* 404 */
.not-found { min-height: 65vh; padding-block: var(--space); }
.not-found h1 { max-width: 900px; }
.not-found > p:not(.eyebrow) { color: var(--muted); font-size: 1.15rem; }
.not-found .button-row { margin-top: 2rem; }

/* Footer */
.site-footer { color: var(--white); background: var(--black); border-top: 1px solid #282828; }
.footer-grid { display: grid; width: min(calc(100% - 3rem), var(--wide)); margin-inline: auto; padding: 4.5rem 0; grid-template-columns: 1.5fr .85fr .85fr 1fr; gap: clamp(2rem, 5vw, 5rem); }
.footer-brand img { width: 220px; }
.footer-brand p { max-width: 360px; margin-top: 1.5rem; color: #999; font-size: .86rem; }
.site-footer h2 { margin-bottom: 1.2rem; color: #888; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: .45rem; }
.site-footer a { color: #d4d4d4; font-size: .82rem; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-contact address { margin-top: 1rem; color: #999; font-size: .78rem; font-style: normal; }
.footer-bottom { display: flex; width: min(calc(100% - 3rem), var(--wide)); margin-inline: auto; padding: 1.2rem 0; justify-content: space-between; gap: 2rem; color: #777; border-top: 1px solid #292929; font-size: .69rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 1100px) {
    :root { --header: 74px; }
    .brand img { width: 190px; }
    .nav-toggle { display: flex; }
    .primary-nav { position: fixed; z-index: 999; top: var(--header); right: 0; bottom: 0; left: 0; display: none; padding: 1.5rem; overflow-y: auto; background: var(--black); }
    .primary-nav.is-open { display: block; }
    .primary-nav > ul { display: block; }
    .primary-nav a { width: 100%; min-height: 58px; padding: 1rem 0; justify-content: space-between; border-bottom: 1px solid #2a2a2a; font-size: 1.05rem; }
    .primary-nav > ul > li > a::after { display: none; }
    .footer-grid { grid-template-columns: 1.3fr repeat(3, 1fr); gap: 2rem; }
    .project-card { grid-template-columns: 1fr; gap: 1rem; }
    .project-card__logo, .project-card__copy, .tag-list, .project-card > .external-link { grid-column: 1; }
}

@media (max-width: 900px) {
    .home-competencies__header { grid-template-columns: 1fr; gap: 1.5rem; }
    .competency-row { grid-template-columns: 42px 1fr 40px; gap: 1rem; }
    .competency-row__projects { grid-column: 2; }
    .competency-row__arrow { grid-column: 3; grid-row: 1 / 3; }
    .competency-directory__row { grid-template-columns: 50px 1fr 48px; }
    .competency-directory__projects { grid-column: 2 / 3; }
    .competency-directory__link { grid-column: 3; grid-row: 1 / 3; }
    .competency-hero__inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    body { font-size: .96rem; }
    .section-shell, .header-inner, .hero__inner, .page-hero__inner, .competency-hero__inner, .footer-grid, .footer-bottom, .breadcrumbs ol { width: min(calc(100% - 2rem), var(--max)); }
    .brand img { width: 165px; }
    .nav-toggle__label { display: none; }
    .hero__inner { min-height: 0; }
    .hero__copy h1 { font-size: clamp(2.65rem, 11.5vw, 4rem); }
    .hero__lead { font-size: 1rem; }
    .button-row { align-items: stretch; }
    .button-row .button { flex: 1 1 100%; }
    .competency-row { padding-block: 1.5rem; grid-template-columns: 34px 1fr; }
    .competency-row__main, .competency-row__projects, .competency-row__arrow { grid-column: 2; }
    .competency-row__arrow { grid-row: auto; }
    .competency-directory__row { min-height: 0; padding: 1.5rem 0; grid-template-columns: 40px 1fr; gap: .8rem; }
    .competency-directory__main, .competency-directory__projects, .competency-directory__link { grid-column: 2; }
    .competency-directory__link { grid-row: auto; }
    .competency-hero__inner { padding: 3.5rem 0 4.5rem; }
    .project-card__logo { min-height: 145px; }
    .project-brand-lockup--text { gap: 9px; }
    .project-brand-lockup--text img,
    .project-card__logo[data-project="terroryzm.edu.pl"] .project-brand-lockup--text img,
    .project-card__logo[data-project="zabronione.pl"] .project-brand-lockup--text img { height: 34px; }
    .project-brand-lockup--text > span,
    .project-card__logo[data-project="psychometria.co.pl"] .project-brand-lockup--text > span { font-size: 1.45rem; }
    .project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text { gap: 11.25px; }
    .project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text img { height: 42.5px; }
    .project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text > span { font-size: 1.8125rem; }
    .project-brand-lockup--formacja { gap: 10.35px; }
    .project-brand-lockup--formacja .project-brand-lockup__symbol { height: 39.1px; }
    .project-brand-lockup--formacja .project-brand-lockup__wordmark { height: 35.2px; transform: translateY(8px); }
    .competency-switcher a { width: 100%; }
    .editorial-profile { grid-template-columns: 1fr; }
    .editorial-profile__portrait { width: min(343px, 100%); }
    .editorial-profile--contact .editorial-profile__portrait { width: 100%; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { display: block; }
    .footer-bottom p + p { margin-top: .35rem; }
}

@media (max-width: 430px) {
    .project-brand-lockup--text { gap: 7px; white-space: normal; }
    .project-brand-lockup--text img,
    .project-card__logo[data-project="terroryzm.edu.pl"] .project-brand-lockup--text img,
    .project-card__logo[data-project="zabronione.pl"] .project-brand-lockup--text img { height: 26px; }
    .project-brand-lockup--text > span,
    .project-card__logo[data-project="psychometria.co.pl"] .project-brand-lockup--text > span { font-size: 1.1rem; line-height: 1.05; overflow-wrap: anywhere; }
    .project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text { gap: 8.75px; }
    .project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text img { height: 32.5px; }
    .project-card__logo[data-project="mikrobiologia.co.pl"] .project-brand-lockup--text > span { font-size: 1.375rem; }
}

@media (max-width: 390px) {
    .button { width: 100%; }
}

@media (min-width: 1600px) {
    .hero__inner { min-height: 850px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
    .site-header, .site-footer, .breadcrumbs, .button, .nav-toggle { display: none !important; }
    body { color: #000; background: #fff; }
    a { color: #000; }
}
