/* AI Media Dream — wizytówka */

/* ---------- Czcionki (z własnego serwera, bez Google Fonts; licencja OFL w fonts/) ---------- */

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url(../fonts/outfit-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url(../fonts/outfit-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(../fonts/instrument-serif-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(../fonts/instrument-serif-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(../fonts/instrument-serif-italic-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(../fonts/instrument-serif-italic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #0a0a0b;
    --surface: rgba(16, 16, 17, .74);
    --ink: #f4f0ea;
    --muted: #a9a39b;
    --sand: #e7dfd8;
    --line: rgba(244, 240, 234, .14);

    --font-sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;

    --width: 1040px;
    --gutter: clamp(16px, 4vw, 48px);
    --radius: 30px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

/* Ciepła poświata u góry strony */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(90% 60% at 30% -10%, rgba(231, 223, 216, .08), transparent 60%);
    pointer-events: none;
}

h1, h2, p, dl, dd, ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

address {
    font-style: normal;
}

a {
    color: inherit;
}

em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.08em;
    color: var(--sand);
}

::selection {
    background: var(--sand);
    color: var(--bg);
}

:focus-visible {
    outline: 2px solid var(--sand);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ---------- Tło ---------- */

.field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(28px, 4vw, 44px);
    padding: clamp(20px, 5vw, 56px) var(--gutter);
    /* Ciemna otoczka liter, żeby punkty tła nie zjadały tekstu */
    text-shadow: 0 0 12px rgba(10, 10, 11, .85);
}

/* ---------- Wizytówka ---------- */

.card {
    width: min(100%, var(--width));
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 60px 120px -60px rgba(0, 0, 0, .95);
    overflow: hidden;
}

.card__logo {
    position: relative;
    min-height: 420px;
    border-right: 1px solid var(--line);
    background: radial-gradient(circle at 50% 46%, rgba(231, 223, 216, .07), transparent 62%);
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.card__logo.is-dragging {
    cursor: grabbing;
}

.card__logo canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.card__hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    font-size: .7rem;
    letter-spacing: .26em;
    text-align: center;
    text-transform: uppercase;
    color: var(--muted);
    transition: opacity .8s;
    pointer-events: none;
}

.card__logo.was-used .card__hint {
    opacity: 0;
}

.card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 4.4vw, 56px);
}

.wordmark {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
}

.wordmark__main {
    font-size: clamp(2.3rem, 5vw, 3.5rem);
    letter-spacing: .1em;
}

.wordmark__sub {
    font-size: clamp(.85rem, 1.3vw, 1rem);
    font-weight: 400;
    letter-spacing: .72em;
    color: var(--muted);
}

.tagline {
    max-width: 30em;
    margin-bottom: 32px;
    font-size: clamp(1.02rem, 1.4vw, 1.15rem);
    font-weight: 300;
    color: var(--muted);
}

.contact {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.contact__mail {
    display: inline-block;
    padding-bottom: .16em;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 400;
    text-decoration: none;
    overflow-wrap: anywhere;
    background: linear-gradient(var(--sand), var(--sand)) 0 100% / 0 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 100% / 100% 1px no-repeat;
    transition: background-size .6s var(--ease), color .3s;
}

.contact__mail:hover {
    color: var(--sand);
    background-size: 100% 1px, 100% 1px;
}

.contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(244, 240, 234, .03);
    color: var(--ink);
    font: 400 .84rem/1 var(--font-sans);
    text-decoration: none;
    text-shadow: none;
    cursor: pointer;
    transition: background .3s, border-color .3s, color .3s, transform .3s var(--ease);
}

.chip svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chip:hover {
    border-color: var(--ink);
    background: rgba(244, 240, 234, .08);
    transform: translateY(-2px);
}

.chip.is-done {
    border-color: var(--sand);
    background: var(--sand);
    color: var(--bg);
}

.details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    justify-content: start;
    gap: 20px clamp(24px, 4vw, 48px);
    padding-top: 26px;
}

.details__wide {
    grid-column: 1 / -1;
}

.details dt {
    margin-bottom: 4px;
    font-size: .7rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
}

.details dd {
    font-size: .98rem;
    font-variant-numeric: tabular-nums;
}

/* ---------- Projekty ---------- */

.projects {
    width: min(100%, var(--width));
}

.projects__title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    font-size: .76rem;
    font-weight: 400;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: var(--muted);
}

.projects__title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* Pięć kafelków: dwa szersze u góry, trzy pod nimi */
.projects__list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.projects__list > li {
    display: flex;
    grid-column: span 2;
}

.projects__list > li:nth-child(-n+2) {
    grid-column: span 3;
}

.project {
    position: relative;
    isolation: isolate;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 24px 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-decoration: none;
    overflow: hidden;
    transition: transform .5s var(--ease), border-color .4s;
}

/* Poświata podążająca za kursorem */
.project::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(231, 223, 216, .14), transparent 65%);
    opacity: 0;
    transition: opacity .5s;
}

.project:hover {
    transform: translateY(-6px);
    border-color: rgba(244, 240, 234, .32);
}

.project:hover::before {
    opacity: 1;
}

.project__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.project__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    font-size: 1.05rem;
    font-weight: 600;
    text-shadow: none;
    transition: transform .7s var(--ease), background .4s;
}

.project:hover .project__mark {
    background: var(--sand);
    transform: rotate(-360deg);
}

.project__tag {
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .66rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
}

.project__name {
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.project__arrow {
    display: inline-block;
    color: var(--sand);
    transition: transform .4s var(--ease);
}

.project:hover .project__arrow {
    transform: translate(3px, -3px);
}

.project__desc {
    font-size: .94rem;
    line-height: 1.5;
    color: var(--muted);
}

.project__url {
    margin-top: auto;
    padding-top: 8px;
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

.footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .84rem;
    color: var(--muted);
    text-align: center;
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
}

.footer__links a {
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 4px;
    transition: color .3s, text-decoration-color .3s;
}

.footer__links a:hover {
    color: var(--ink);
    text-decoration-color: currentColor;
}

/* ---------- Polityka prywatności ---------- */

.doc-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: clamp(20px, 5vw, 56px) var(--gutter);
}

.doc-page__back {
    align-self: center;
    width: min(100%, 820px);
    font-size: .84rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color .3s;
}

.doc-page__back:hover {
    color: var(--ink);
}

.doc {
    width: min(100%, 820px);
    padding: clamp(24px, 5vw, 56px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-weight: 300;
}

.doc h1 {
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 4.4vw, 2.6rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.doc__date {
    margin-bottom: 8px;
    font-size: .9rem;
    color: var(--muted);
}

.doc h2 {
    margin: 40px 0 14px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.3;
    scroll-margin-top: 24px;
}

.doc h3 {
    margin: 24px 0 8px;
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--sand);
}

.doc p,
.doc ul {
    margin: 0 0 12px;
}

.doc ul {
    padding-left: 1.25em;
    list-style: disc;
}

.doc li {
    margin-bottom: 6px;
}

.doc li::marker {
    color: var(--muted);
}

.doc strong {
    font-weight: 500;
}

.doc a {
    color: var(--sand);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.doc code {
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: .86em;
}

.doc__table {
    margin: 14px 0 18px;
    overflow-x: auto;
}

.doc table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: .9rem;
}

.doc th,
.doc td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.doc th {
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

.doc .chip {
    margin: 4px 0 12px;
}

/* ---------- Wejście ---------- */

.js [data-enter] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
    transition-delay: calc(var(--i) * 80ms + 100ms);
}

.js.is-ready [data-enter] {
    opacity: 1;
    transform: none;
}

/* Napis rozsuwa się jak w logo */
.js .wordmark__main,
.js .wordmark__sub {
    transition: letter-spacing 1.6s var(--ease) .25s;
}

.js:not(.is-ready) .wordmark__main {
    letter-spacing: .4em;
}

.js:not(.is-ready) .wordmark__sub {
    letter-spacing: 1.2em;
}

/* ---------- Mniejsze ekrany ---------- */

@media (max-width: 820px) {
    .card {
        grid-template-columns: 1fr;
    }

    .card__logo {
        min-height: 0;
        aspect-ratio: 1 / .82;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .projects__list {
        grid-template-columns: 1fr;
    }

    .projects__list > li,
    .projects__list > li:nth-child(-n+2) {
        grid-column: auto;
    }
}

@media (max-width: 420px) {
    .details {
        grid-template-columns: repeat(2, minmax(0, auto));
    }
}

/* ---------- Ograniczony ruch ---------- */

@media (prefers-reduced-motion: reduce) {
    .js [data-enter],
    .js .wordmark__main,
    .js .wordmark__sub {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .js:not(.is-ready) .wordmark__main {
        letter-spacing: .1em;
    }

    .js:not(.is-ready) .wordmark__sub {
        letter-spacing: .72em;
    }

    .project,
    .project__mark,
    .project__arrow,
    .chip {
        transition: none;
    }
}
