/* ============================================
   1. VARIABLES
============================================ */
:root {
    --ink: #17212b;
    --ink-soft: #33414d;
    --paper: #f3f5f2;
    --white: #ffffff;
    --cyan: #42c4d6;
    --cyan-dark: #177f8f;
    --amber: #ffb000;
    --line: rgba(23, 33, 43, 0.24);
    --gutter: clamp(1.125rem, 4.4vw, 5rem);
    --section-space: clamp(5rem, 10vw, 10rem);
    --max-width: 1760px;

    /* ============================================
       HERO BACKGROUND IMAGE
       Replace this path when using a custom image.
       Recommended dimensions: 2400 × 1500 px.
    ============================================= */
    --hero-image: url("../img/hero-background.webp");
}

/* ============================================
   2. RESET / BASE
============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}

body.menu-open {
    overflow: hidden;
}

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

a {
    color: inherit;
}

button,
input,
textarea {
    color: inherit;
    font: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 4px;
}

::selection {
    color: var(--ink);
    background: var(--cyan);
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 1rem;
    left: 1rem;
    padding: 0.75rem 1rem;
    color: var(--white);
    background: var(--ink);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ============================================
   3. TYPOGRAPHY / SHARED
============================================ */
h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.04;
}

h1 {
    margin-bottom: 0;
    max-width: 17ch;
    font-size: clamp(2.8rem, 6.1vw, 7.4rem);
    font-weight: 460;
    letter-spacing: -0.065em;
}

h1 strong {
    display: block;
    color: var(--cyan);
    font-weight: 680;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(2.15rem, 4.4vw, 5.2rem);
    font-weight: 530;
    letter-spacing: -0.055em;
}

h3 {
    font-size: clamp(1.2rem, 1.8vw, 2rem);
    font-weight: 620;
    letter-spacing: -0.025em;
}

.section-label {
    margin-bottom: 1.5rem;
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ============================================
   4. HEADER / NAVIGATION
============================================ */
.site-header {
    position: relative;
    z-index: 50;
    color: var(--white);
    background: var(--ink);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 76px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.site-logo {
    justify-self: start;
}

.site-logo img {
    width: 178px;
    height: 35px;
}

.desktop-nav {
    display: flex;
    gap: clamp(1.5rem, 3vw, 3.5rem);
    font-size: 0.9rem;
}

.desktop-nav a,
.mobile-menu a {
    text-decoration: none;
}

.desktop-nav a {
    position: relative;
    padding: 1.75rem 0;
}

.desktop-nav a::after {
    position: absolute;
    right: 0;
    bottom: 1.35rem;
    left: 0;
    height: 2px;
    background: var(--cyan);
    content: "";
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 180ms ease;
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 1.5rem;
}

.language-switcher {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    font-family: "Courier New", monospace;
    font-size: 0.76rem;
}

.language-switcher button {
    padding: 0.2rem;
    color: rgba(255, 255, 255, 0.56);
    background: transparent;
    border: 0;
}

.language-switcher button[aria-pressed="true"] {
    color: var(--cyan);
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    color: var(--white);
    background: transparent;
    border: 0;
}

.menu-toggle__mark {
    position: relative;
    width: 28px;
    height: 14px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__mark {
    border-color: var(--cyan);
}

.mobile-menu {
    padding: 0 var(--gutter) 1rem;
    background: var(--ink);
}

.mobile-menu a {
    display: block;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.45rem;
}

/* ============================================
   5. HERO
============================================ */
.hero {
    position: relative;
    min-height: calc(100svh - 76px);
    overflow: hidden;
    color: var(--white);
    background: var(--ink);
}

.hero__image-layer {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(23, 33, 43, 0.96) 0%, rgba(23, 33, 43, 0.83) 58%, rgba(23, 33, 43, 0.68) 100%),
        var(--hero-image);
    background-position: center;
    background-size: cover;
}

.hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(120px, 0.42fr) 1.58fr 0.8fr;
    grid-template-rows: auto 1fr auto;
    gap: clamp(2rem, 4vw, 5rem);
    min-height: calc(100svh - 76px);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(2.25rem, 5vw, 5.5rem) var(--gutter) clamp(2rem, 4vw, 4rem);
}

.hero__status {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: "Courier New", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-light {
    width: 0.65rem;
    height: 0.65rem;
    background: var(--amber);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 176, 0, 0.55);
    animation: status-pulse 2.6s ease-out infinite;
}

.hero__statement {
    grid-column: 1 / 3;
    align-self: center;
}

.hero__brief {
    grid-column: 3;
    align-self: end;
    max-width: 33rem;
    padding-bottom: 1rem;
}

.hero__brief p {
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: clamp(1rem, 1.4vw, 1.25rem);
}

.toggle-cta {
    display: inline-flex;
    gap: 1.3rem;
    align-items: center;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.toggle-cta__track {
    position: relative;
    width: 3.4rem;
    height: 1.35rem;
    background: var(--paper);
}

.toggle-cta__track i {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 0.95rem;
    height: 0.95rem;
    background: var(--cyan-dark);
    transition: left 180ms ease, background-color 180ms ease;
}

.toggle-cta:hover .toggle-cta__track i,
.toggle-cta:focus-visible .toggle-cta__track i {
    left: 2.25rem;
    background: var(--amber);
}

.hero__comb {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    min-height: 106px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero__comb p {
    grid-column: 1 / -1;
    margin: 0.85rem 0 0;
    color: rgba(255, 255, 255, 0.52);
    font-family: "Courier New", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-align: center;
}

.comb {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: 76px;
}

.comb span {
    display: block;
    background: var(--cyan);
}

.comb--left span:nth-child(1) {
    height: 14px;
}

.comb--left span:nth-child(2) {
    height: 29px;
}

.comb--left span:nth-child(3) {
    height: 45px;
}

.comb--left span:nth-child(4) {
    height: 61px;
}

.comb--left span:nth-child(5) {
    height: 76px;
}

.comb--right {
    align-items: start;
    transform: rotate(180deg);
}

.comb--right span {
    background: var(--amber);
}

.comb--right span:nth-child(1) {
    height: 14px;
}

.comb--right span:nth-child(2) {
    height: 29px;
}

.comb--right span:nth-child(3) {
    height: 45px;
}

.comb--right span:nth-child(4) {
    height: 61px;
}

.comb--right span:nth-child(5) {
    height: 76px;
}

/* ============================================
   6. STARTING POINTS
============================================ */
.starting-points {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--section-space) var(--gutter);
}

.section-intro {
    display: grid;
    grid-template-columns: 0.58fr 1.42fr;
    gap: 2rem;
    margin-bottom: clamp(4rem, 8vw, 7rem);
}

.section-intro h2 {
    max-width: 16ch;
}

.entry-list {
    border-top: 1px solid var(--ink);
}

.entry-list article {
    display: grid;
    grid-template-columns: 0.2fr 0.7fr 1.1fr;
    gap: 2rem;
    align-items: baseline;
    padding: clamp(1.6rem, 3vw, 3rem) 0;
    border-bottom: 1px solid var(--line);
}

.entry-list article > span {
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
}

.entry-list h3,
.entry-list p {
    margin-bottom: 0;
}

.entry-list p {
    max-width: 42rem;
    color: var(--ink-soft);
}

/* ============================================
   7. CAPABILITIES
============================================ */
.capabilities {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    min-height: 900px;
    color: var(--white);
    background: var(--cyan-dark);
}

.capabilities__heading {
    align-self: start;
    padding: var(--section-space) var(--gutter);
}

.capabilities__heading h2 {
    max-width: 10ch;
    margin-bottom: 2rem;
}

.capabilities__heading p {
    max-width: 34rem;
    color: rgba(255, 255, 255, 0.74);
}

.capability-lanes {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--section-space) var(--gutter) var(--section-space) 0;
}

.capability-lane {
    display: grid;
    grid-template-columns: 0.28fr 0.76fr 0.96fr;
    gap: 1.5rem;
    padding: clamp(1.4rem, 2.6vw, 2.5rem);
    color: var(--ink);
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    transition: transform 180ms ease, background-color 180ms ease;
}

.capability-lane:nth-child(even) {
    transform: translateX(clamp(-3rem, -4vw, -1rem));
}

.capability-lane:hover {
    z-index: 2;
    background: var(--amber);
    transform: translateX(-1rem);
}

.capability-lane__code {
    font-family: "Courier New", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
}

.capability-lane h3,
.capability-lane p {
    margin-bottom: 0;
}

.capability-lane p {
    color: var(--ink-soft);
}

/* ============================================
   8. WORKING MODEL
============================================ */
.working-model {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: clamp(3rem, 8vw, 10rem);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--section-space) var(--gutter);
}

.working-model__title {
    align-self: start;
    position: sticky;
    top: 2rem;
}

.working-model__title h2 {
    max-width: 10ch;
}

.joint-sequence {
    position: relative;
    padding: 3rem 0;
}

.joint-sequence::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--ink);
    content: "";
    transform: translateX(-1px);
}

.joint-step {
    position: relative;
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 1.5rem;
    width: calc(50% + 1px);
    min-height: 220px;
    padding: 2rem;
    color: var(--white);
    background: var(--ink);
}

.joint-step::after {
    position: absolute;
    top: 50%;
    width: 2rem;
    height: 4rem;
    background: var(--amber);
    content: "";
    transform: translateY(-50%);
}

.joint-step--left {
    margin-right: auto;
    padding-right: 3.5rem;
}

.joint-step--left::after {
    right: -2rem;
}

.joint-step--right {
    margin-left: auto;
    padding-left: 3.5rem;
    color: var(--ink);
    background: var(--cyan);
}

.joint-step--right::after {
    left: -2rem;
    background: var(--ink);
}

.joint-step > span {
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
}

.joint-step h3 {
    margin-bottom: 1rem;
}

.joint-step p {
    margin-bottom: 0;
    opacity: 0.78;
}

/* ============================================
   9. PRINCIPLES
============================================ */
.principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    color: var(--ink);
    background: var(--amber);
}

.principles p {
    display: grid;
    place-items: center;
    min-height: 220px;
    margin: 0;
    padding: 2rem;
    border-right: 1px solid var(--ink);
    font-size: clamp(1.25rem, 2vw, 2.2rem);
    font-weight: 640;
    letter-spacing: -0.03em;
    text-align: center;
}

.principles p:last-child {
    border-right: 0;
}

/* ============================================
   10. CONTACT
============================================ */
.contact {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: clamp(3rem, 9vw, 10rem);
    min-height: 860px;
    padding: var(--section-space) var(--gutter);
    color: var(--white);
    background: var(--ink);
}

.contact__intro h2 {
    max-width: 10ch;
    margin-bottom: 2.5rem;
}

.contact__intro > a {
    color: var(--cyan);
    font-size: clamp(1.05rem, 1.6vw, 1.4rem);
}

.contact__form-shell {
    position: relative;
    align-self: start;
    min-height: 650px;
}

.contact-form {
    display: grid;
    gap: 1.7rem;
    padding: clamp(1.5rem, 4vw, 4rem);
    color: var(--ink);
    background: var(--paper);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.7rem;
}

.field {
    display: grid;
    gap: 0.55rem;
}

.field label {
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.85rem 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
}

.field input:focus,
.field textarea:focus {
    border-bottom-color: var(--cyan-dark);
    outline: 0;
    box-shadow: 0 2px 0 var(--cyan-dark);
}

.field textarea {
    resize: vertical;
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.consent {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    font-size: 0.82rem;
    line-height: 1.45;
}

.consent input {
    flex: 0 0 auto;
    margin-top: 0.25rem;
}

.consent a {
    font-weight: 700;
}

.submit-button {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 1.1rem 1.25rem;
    color: var(--white);
    background: var(--cyan-dark);
    border: 0;
    transition: background-color 180ms ease;
}

.submit-button:hover,
.submit-button:focus-visible {
    color: var(--ink);
    background: var(--amber);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.form-status {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    color: var(--ink);
    background: rgba(23, 33, 43, 0.86);
}

.form-status[hidden] {
    display: none;
}

.form-status__panel {
    width: min(100%, 34rem);
    padding: clamp(2rem, 5vw, 4rem);
    background: var(--paper);
    border-top: 12px solid var(--cyan);
}

.form-status.is-error .form-status__panel {
    border-top-color: var(--amber);
}

.form-status__signal {
    display: block;
    width: 4rem;
    height: 1.25rem;
    margin-bottom: 2rem;
    background: repeating-linear-gradient(90deg, var(--ink) 0 7px, transparent 7px 12px);
}

.form-status h3 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.form-status button {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    color: var(--white);
    background: var(--ink);
    border: 0;
}

/* ============================================
   11. FOOTER
============================================ */
.site-footer {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr;
    gap: 2rem;
    padding: clamp(3rem, 6vw, 5rem) var(--gutter);
    color: rgba(255, 255, 255, 0.72);
    background: #0c1218;
    font-size: 0.82rem;
}

.site-footer > div:last-child {
    text-align: right;
}

.site-footer img {
    width: 178px;
    height: 35px;
}

.site-footer p {
    margin-bottom: 0.65rem;
}

.site-footer address {
    font-style: normal;
}

.site-footer a:hover {
    color: var(--cyan);
}

/* ============================================
   12. PRIVACY / ERROR PAGES
============================================ */
.legal-hero {
    padding: clamp(5rem, 10vw, 10rem) var(--gutter);
    color: var(--white);
    background: var(--cyan-dark);
}

.legal-hero h1 {
    max-width: 12ch;
}

.legal-layout {
    display: grid;
    grid-template-columns: 0.42fr 1.58fr;
    gap: clamp(3rem, 8vw, 9rem);
    max-width: 1380px;
    margin: 0 auto;
    padding: var(--section-space) var(--gutter);
}

.legal-index {
    position: sticky;
    top: 2rem;
    align-self: start;
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
}

.legal-article section {
    padding: 0 0 3rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--line);
}

.legal-article h2 {
    margin-bottom: 1.2rem;
    font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.legal-article li {
    margin-bottom: 0.65rem;
}

[data-lang-content][hidden] {
    display: none;
}

.error-page {
    display: grid;
    place-items: center;
    min-height: calc(100svh - 76px);
    padding: var(--gutter);
    text-align: center;
}

.error-page p {
    max-width: 40rem;
    margin: 1.5rem auto 2rem;
}

.error-code {
    display: block;
    color: var(--cyan-dark);
    font-family: "Courier New", monospace;
    font-size: clamp(5rem, 18vw, 15rem);
    font-weight: 700;
    line-height: 0.8;
}

/* ============================================
   13. RESPONSIVE
============================================ */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }

    .header-grid {
        grid-template-columns: 1fr auto;
    }

    .menu-toggle {
        display: flex;
    }

    .hero__grid {
        grid-template-columns: 1fr 0.7fr;
    }

    .hero__statement {
        grid-column: 1 / -1;
    }

    .hero__brief {
        grid-column: 2;
    }

    .capabilities {
        grid-template-columns: 1fr;
    }

    .capabilities__heading {
        padding-bottom: 3rem;
    }

    .capabilities__heading h2 {
        max-width: 15ch;
    }

    .capability-lanes {
        padding: 0 var(--gutter) var(--section-space);
    }

    .working-model {
        grid-template-columns: 1fr;
    }

    .working-model__title {
        position: static;
    }

    .working-model__title h2 {
        max-width: 14ch;
    }

    .contact {
        grid-template-columns: 1fr;
    }

    .contact__intro h2 {
        max-width: 15ch;
    }

    .site-footer {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer > div:last-child {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .site-logo img {
        width: 148px;
        height: auto;
    }

    .header-actions {
        gap: 0.8rem;
    }

    .hero__grid {
        display: flex;
        flex-direction: column;
        min-height: calc(100svh - 76px);
    }

    .hero__statement {
        margin: auto 0;
    }

    .hero__brief {
        align-self: stretch;
        padding: 0;
    }

    .hero__comb {
        flex: 0 0 auto;
        width: 100%;
        min-height: 80px;
    }

    .comb {
        height: 54px;
    }

    .comb--left span:nth-child(5),
    .comb--right span:nth-child(5) {
        height: 54px;
    }

    .section-intro {
        grid-template-columns: 1fr;
    }

    .entry-list article {
        grid-template-columns: 3rem 1fr;
    }

    .entry-list p {
        grid-column: 2;
    }

    .capability-lane {
        grid-template-columns: 1fr;
    }

    .capability-lane:nth-child(even) {
        transform: none;
    }

    .capability-lane:hover {
        transform: none;
    }

    .joint-sequence {
        padding-left: 1.5rem;
    }

    .joint-sequence::before {
        left: 0;
    }

    .joint-step {
        width: 100%;
        min-height: 0;
        margin: 0 0 1px;
        padding: 2rem;
    }

    .joint-step::after {
        top: 2rem;
        left: -1.5rem;
        width: 1.5rem;
        height: 2px;
        transform: none;
    }

    .principles {
        grid-template-columns: 1fr;
    }

    .principles p {
        min-height: 140px;
        border-right: 0;
        border-bottom: 1px solid var(--ink);
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-index {
        position: static;
    }
}

@media (max-width: 560px) {
    .header-grid {
        min-height: 68px;
    }

    .language-switcher {
        display: none;
    }

    .mobile-menu::before {
        display: block;
        margin: 0.8rem 0;
        color: var(--cyan);
        content: "EN / PL";
        font-family: "Courier New", monospace;
        font-size: 0.72rem;
    }

    .mobile-menu {
        position: relative;
    }

    .mobile-menu .mobile-language {
        display: flex;
    }

    h1 {
        font-size: clamp(2.45rem, 13.2vw, 4rem);
    }

    .hero {
        min-height: calc(100svh - 68px);
    }

    .hero__grid {
        min-height: calc(100svh - 68px);
    }

    .hero__status {
        align-items: flex-start;
    }

    .entry-list article {
        grid-template-columns: 2.2rem 1fr;
        gap: 1rem;
    }

    .capability-lanes {
        padding-right: 0;
        padding-left: 0;
    }

    .contact {
        padding-right: 0;
        padding-left: 0;
    }

    .contact__intro,
    .contact__form-shell {
        margin-right: var(--gutter);
        margin-left: var(--gutter);
    }

    .contact-form {
        padding: 1.25rem;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   14. MOTION PREFERENCES
============================================ */
@keyframes status-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 176, 0, 0.55);
    }

    65%,
    100% {
        box-shadow: 0 0 0 10px rgba(255, 176, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
