/* ---------- Tokens ---------- */
:root {
    --ink: #1d2024;
    --ink-soft: #2a2e33;
    --plaster: #edeeeb;
    --plaster-deep: #e0e2dd;
    --walnut: #7a4a2b;
    --lamp: #e6c07d;
    --text: #23272b;
    --text-muted: #5b6168;
    --text-on-dark: #e9eae6;
    --muted-on-dark: #a4a9ae;
    --line: rgba(29, 32, 36, 0.18);
    --line-on-dark: rgba(233, 234, 230, 0.2);

    --font-display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
    --font-body: "Instrument Sans", Arial, sans-serif;

    --gutter: clamp(20px, 5vw, 64px);
    --section-space: clamp(72px, 10vw, 140px);
    --header-h: 72px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--plaster);
    -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.05;
    margin: 0;
    letter-spacing: -0.02em;
}

p { margin: 0; }

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

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    background: var(--lamp);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.section { padding-block: var(--section-space); }

.section-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(29, 32, 36, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-on-dark);
    color: var(--text-on-dark);
}

.nav {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.1;
}
.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}
.brand-owner {
    font-size: 0.8125rem;
    color: var(--muted-on-dark);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu a {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    font-size: 0.9688rem;
    font-weight: 500;
    color: var(--text-on-dark);
    border-radius: 999px;
    transition: color 0.2s, background-color 0.2s;
}
.nav-menu a:hover { color: var(--lamp); }

.nav-menu a.nav-cta {
    margin-left: 10px;
    background: var(--lamp);
    color: var(--ink);
    font-weight: 600;
    padding-inline: 20px;
}
.nav-menu a.nav-cta:hover { background: #f0cf94; color: var(--ink); }

.menu-button { display: none; }

/* ---------- Hero ---------- */
.hero {
    background: var(--ink);
    color: var(--text-on-dark);
    overflow: hidden;
}

.hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(56px, 7vw, 96px);
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.9rem, 7.2vw, 6.25rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.035em;
    max-width: 12ch;
}

.hero-lead {
    margin-top: clamp(24px, 3vw, 36px);
    max-width: 34rem;
    font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
    color: var(--muted-on-dark);
}

.hero-actions {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
}

.button {
    display: inline-block;
    padding: 15px 28px;
    background: var(--lamp);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    transition: background-color 0.2s, transform 0.2s;
}
.button:hover { background: #f0cf94; }
.button:active { transform: scale(0.98); }

.text-link {
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--line-on-dark);
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
    transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: var(--lamp); }

.hero-figure {
    margin: 0;
    position: relative;
    justify-self: end;
    width: 100%;
    max-width: 460px;
}
.hero-figure img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 220px 220px 4px 4px; /* kształt otworu drzwiowego */
}

/* Linijka: miarka przy dolnej krawędzi hero */
.ruler {
    height: 44px;
    background:
        repeating-linear-gradient(90deg, var(--lamp) 0 2px, transparent 2px 120px) 0 0 / 100% 36px no-repeat,
        repeating-linear-gradient(90deg, rgba(233, 234, 230, 0.5) 0 1px, transparent 1px 24px) 0 0 / 100% 22px no-repeat,
        repeating-linear-gradient(90deg, rgba(233, 234, 230, 0.22) 0 1px, transparent 1px 12px) 0 0 / 100% 12px no-repeat;
    border-top: 1px solid var(--line-on-dark);
}

/* Jedyna animacja na stronie: miarka wsuwa się przy ładowaniu */
@media (prefers-reduced-motion: no-preference) {
    .ruler {
        animation: ruler-in 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }
    @keyframes ruler-in {
        from { clip-path: inset(0 100% 0 0); }
        to   { clip-path: inset(0 0 0 0); }
    }
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}

.about-body { max-width: 40rem; }
.about-body p + p { margin-top: 1.1em; }

.about-body .about-lead {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.5rem, 2.6vw, 2.125rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin-bottom: 1.1em;
}

.facts {
    margin: 48px 0 0;
    border-top: 1px solid var(--line);
}
.facts > div {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--text-muted); font-size: 0.9375rem; }
.facts dd { margin: 0; font-weight: 500; }

/* ---------- Services ---------- */
.services {
    background: var(--plaster-deep);
}

.service-list {
    list-style: none;
    margin: clamp(40px, 6vw, 72px) 0 0;
    padding: 0;
    border-top: 2px solid var(--ink);
}

.service {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 16px clamp(24px, 6vw, 96px);
    align-items: baseline;
    padding: clamp(24px, 3.5vw, 40px) 0;
    border-bottom: 1px solid var(--line);
}

.service h3 {
    font-size: clamp(1.75rem, 3.6vw, 2.875rem);
    font-weight: 700;
}
.service p {
    color: var(--text-muted);
    max-width: 28rem;
}

/* ---------- Projects ---------- */
.project-grid {
    margin-top: clamp(40px, 6vw, 72px);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(32px, 4vw, 56px) clamp(16px, 2.4vw, 32px);
    align-items: start;
}

.project { margin: 0; }
.project img {
    width: 100%;
    object-fit: cover;
    background: var(--plaster-deep);
}

.project figcaption {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 2px solid var(--ink);
}
.project h3 {
    font-size: 1.5rem;
    font-weight: 700;
}
.project p {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.9688rem;
    max-width: 26rem;
}

.project-a { grid-column: 1 / span 6; }
.project-a img { aspect-ratio: 6 / 7; }

.project-b { grid-column: 8 / span 5; margin-top: clamp(40px, 9vw, 140px); }
.project-b img { aspect-ratio: 2 / 3; }

.project-c { grid-column: 4 / span 8; }
.project-c img { aspect-ratio: 4 / 3; object-position: 50% 70%; }

/* ---------- Contact ---------- */
.contact {
    background: var(--ink);
    color: var(--text-on-dark);
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: clamp(32px, 6vw, 96px);
}

.contact-intro p {
    margin-top: 20px;
    color: var(--muted-on-dark);
    max-width: 22rem;
}

.contact-phone {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.1rem, 6vw, 4.75rem);
    line-height: 1;
    letter-spacing: -0.03em;
    text-decoration: none;
    color: var(--lamp);
    transition: color 0.2s;
}
.contact-phone:hover { color: #f5dcae; }

.contact-list {
    margin: clamp(32px, 5vw, 56px) 0 0;
    border-top: 1px solid var(--line-on-dark);
}
.contact-list > div {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line-on-dark);
}
.contact-list dt { color: var(--muted-on-dark); font-size: 0.9375rem; }
.contact-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.contact-list a {
    text-decoration: underline;
    text-decoration-color: var(--line-on-dark);
    text-underline-offset: 5px;
    transition: text-decoration-color 0.2s;
}
.contact-list a:hover { text-decoration-color: var(--lamp); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--ink);
    color: var(--muted-on-dark);
    border-top: 1px solid var(--line-on-dark);
    font-size: 0.9062rem;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding-block: 28px;
}
.footer-inner a {
    text-decoration: none;
}
.footer-inner a:hover { color: var(--lamp); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero h1 { max-width: 14ch; }
    .hero-figure { justify-self: start; max-width: 360px; }

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

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

    .project-a { grid-column: 1 / span 12; }
    .project-b { grid-column: 4 / span 9; margin-top: 0; }
    .project-c { grid-column: 1 / span 12; margin-top: 0; }
}

@media (max-width: 768px) {
    :root { --header-h: 64px; }

    .menu-button {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 8px 4px;
        background: none;
        border: 0;
        color: var(--text-on-dark);
        font: 500 0.9688rem var(--font-body);
        cursor: pointer;
    }
    .menu-button-icon,
    .menu-button-icon::before {
        display: block;
        width: 22px;
        height: 2px;
        background: currentColor;
        transition: transform 0.25s;
    }
    .menu-button-icon { position: relative; transform: translateY(-4px); }
    .menu-button-icon::before { content: ""; position: absolute; top: 8px; left: 0; }
    .menu-button[aria-expanded="true"] .menu-button-icon { transform: translateY(0) rotate(45deg); }
    .menu-button[aria-expanded="true"] .menu-button-icon::before { top: 0; transform: rotate(-90deg); }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px var(--gutter) 24px;
        background: var(--ink);
        border-bottom: 1px solid var(--line-on-dark);
    }
    .nav-menu.menu-open { display: flex; }
    .nav-menu a {
        padding: 14px 0;
        border-radius: 0;
        border-bottom: 1px solid var(--line-on-dark);
        font-size: 1.0625rem;
    }
    .nav-menu a.nav-cta {
        margin: 18px 0 0;
        padding: 14px 20px;
        text-align: center;
        border: 0;
        border-radius: 999px;
    }

    .facts > div,
    .contact-list > div { grid-template-columns: 1fr; gap: 2px; }

    .project-b { grid-column: 1 / span 12; }
    .project-a img, .project-b img { aspect-ratio: 4 / 5; }

    .ruler { background-size: 100% 36px, 100% 22px, 100% 12px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
