/* ==========================================================================
   EDENS v2 — „aurachrome HUD"
   Ciemny front w estetyce Aurora Signal: głęboki granat, widmo zorzy
   (aqua → fiolet → róż → złoto), szklane karty, monospace'owe etykiety HUD.
   Zero frameworków, zero build stepu. PL, latin-ext.
   ========================================================================== */

/* ---------- 1. Reset ---------- */

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

* { margin: 0; padding: 0; }

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

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

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

/* ---------- 2. Tokeny ---------- */

:root {
    /* tła */
    --bg-0: #07080d;
    --bg-1: #0d0f17;
    --bg-2: #131624;
    --glass: rgba(255, 255, 255, .04);
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .14);

    /* tekst */
    --text: #e8eaf2;
    --muted: #9aa3b8;
    --dim: #6b7288;

    /* widmo aurachrome */
    --aqua: #67e8f9;
    --teal: #5eead4;
    --violet: #a78bfa;
    --pink: #f472b6;
    --gold: #fbbf24;
    --ok: #4ade80;
    --aurora-grad: linear-gradient(100deg, var(--aqua), var(--violet) 40%, var(--pink) 70%, var(--gold));

    /* typografia */
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', var(--font-body);
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* layout */
    --container: 1200px;
    --radius: 20px;
    --radius-sm: 14px;

    /* domyślny akcent (poza modułami featured) */
    --acc: var(--teal);
    --acc-2: var(--violet);
}

/* akcenty per projekt */
[data-accent="bliip"]  { --acc: var(--pink);   --acc-2: #ec4899; }
[data-accent="joy"]    { --acc: var(--violet); --acc-2: var(--aqua); }
[data-accent="aurora"] { --acc: var(--teal);   --acc-2: var(--gold); }

/* ---------- 3. Baza ---------- */

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

::selection { background: rgba(167, 139, 250, .35); color: #fff; }

body.story-open { overflow: hidden; }

/* pasek przewijania — dyskretny */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: #202435; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #2c3147; }

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

/* kotwice pod pływającym navem */
#projekty, #portfolio, #kontakt, #archiwum-head { scroll-margin-top: 90px; }

/* gradientowy tekst — z wolnym „przepływem" widma */
.grad { color: var(--acc, var(--teal)); }
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .grad {
        background: var(--aurora-grad);
        background-size: 220% 100%;
        background-position: 50% 50%; /* stan spoczynkowy = środek widma (reduced-motion) */
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: grad-flow 18s ease-in-out infinite alternate;
    }
}

@keyframes grad-flow {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}

/* hairline postępu strony (steruje site.js) */
.page-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    z-index: 120;
    background: var(--aurora-grad);
    transform: scaleX(0);
    transform-origin: 0 50%;
    pointer-events: none;
}

/* ---------- 4. Tło aurora ---------- */

.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 55% at 50% -10%, rgba(103, 232, 249, .06), transparent 60%),
        var(--bg-0);
}

.aurora-blob {
    position: absolute;
    width: 58vmax;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(70px);
    will-change: transform;
}

.aurora-a {
    top: -24vmax; left: -12vmax;
    background: radial-gradient(circle, rgba(103, 232, 249, .16), transparent 65%);
    animation: drift-a 70s ease-in-out infinite alternate;
}

.aurora-b {
    top: 16%; right: -26vmax;
    background: radial-gradient(circle, rgba(167, 139, 250, .14), transparent 65%);
    animation: drift-b 90s ease-in-out infinite alternate;
}

.aurora-c {
    bottom: -30vmax; left: 12%;
    background: radial-gradient(circle, rgba(244, 114, 182, .10), transparent 62%);
    animation: drift-c 80s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(7vmax, 5vmax) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-6vmax, 8vmax) scale(1.08); } }
@keyframes drift-c { to { transform: translate(9vmax, -6vmax) scale(1.15); } }

/* ziarno — subtelny szum nad blobami */
.aurora-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 5. HUD: mono-etykiety, kropka statusu ---------- */

.hud-label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dim);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, .5);
    animation: pulse 2.4s ease-out infinite;
    flex: none;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .45); }
    70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.section-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 34px;
}

.section-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-strong), transparent);
}

.section-head-wide {
    max-width: var(--container);
    margin: 110px auto 10px;
    padding: 0 20px;
}

/* ---------- 6. Przyciski ---------- */

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background-color .25s ease;
}

.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, var(--acc), var(--acc-2));
    color: #07080d;
}

/* pasmo światła przelatujące po hoverze */
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .45) 50%, transparent 58%);
    transform: translateX(-130%);
    transition: transform .65s ease;
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--acc) 65%, transparent);
}

.btn-primary:hover::after { transform: translateX(130%); }

.btn-secondary {
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: var(--glass);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--acc) 60%, transparent);
    box-shadow: 0 10px 26px -14px color-mix(in srgb, var(--acc) 45%, transparent);
}

/* ---------- 7. Nawigacja (pływająca pigułka) ---------- */

.site-nav {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translate(-50%, -12px);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 10px 12px 10px 22px;
    border-radius: 999px;
    background: rgba(13, 15, 23, .74);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .8);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease, transform .35s ease;
    max-width: calc(100vw - 24px);
}

.site-nav.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.nav-brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .01em;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    transition: color .2s ease;
    white-space: nowrap;
}

.nav-links a:hover { color: var(--text); }

.nav-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(74, 222, 128, .25);
    background: rgba(74, 222, 128, .08);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #a7f3c8;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease;
}

.nav-status:hover {
    background: rgba(74, 222, 128, .14);
    border-color: rgba(74, 222, 128, .4);
}

/* ---------- 8. Hero ---------- */

.main-header {
    position: relative;
    max-width: var(--container);
    margin: 0 auto;
    padding: clamp(96px, 16vh, 170px) 20px 30px;
    animation: hero-in .9s ease both;
}

@keyframes hero-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: clamp(30px, 5vw, 70px);
    align-items: center;
}

.hero-kicker { margin-bottom: 22px; }

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(2.7rem, 6.6vw, 4.9rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.03em;
    margin-bottom: 22px;
    text-wrap: balance;
}

.hero-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 12px;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    font-weight: 500;
    color: var(--muted);
}

.hero-subtitle .sub-accent {
    color: var(--text);
    font-weight: 600;
    background: linear-gradient(100deg, var(--aqua), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle .dot-sep { color: var(--dim); font-size: .8em; }

/* spec-blok — metryczka jak z plakatu Joy */
.hero-spec {
    position: relative;
    padding: 26px 28px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(165deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
}

.hero-spec::before {
    content: "";
    position: absolute;
    top: 0; left: 22px; right: 22px;
    height: 1px;
    background: var(--aurora-grad);
    opacity: .8;
    transform-origin: 0 50%;
    animation: line-draw .9s cubic-bezier(.2, .7, .2, 1) .5s both;
}

@keyframes line-draw {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* boot-sequence: wiersze metryczki wchodzą po kolei */
.spec-row {
    animation: spec-boot .5s ease both;
}
.spec-row:nth-child(1) { animation-delay: .65s; }
.spec-row:nth-child(2) { animation-delay: .82s; }
.spec-row:nth-child(3) { animation-delay: .99s; }
.spec-row:nth-child(4) { animation-delay: 1.16s; }

@keyframes spec-boot {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: none; }
}

.spec-head { margin-bottom: 18px; color: var(--muted); }

.spec-row {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 14px;
    align-items: baseline;
    padding: 9px 0;
}

.spec-row + .spec-row { border-top: 1px solid rgba(255, 255, 255, .05); }

.spec-row dt {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .14em;
    color: var(--dim);
}

.spec-row dd {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text);
}

.spec-status {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 12.5px !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #a7f3c8 !important;
}

/* ---------- 9. Intro / profil ---------- */

.intro-text {
    max-width: 880px;
    margin: 90px auto 0;
    padding: 0 20px;
}

.intro-text .lead {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.6vw, 1.7rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -.01em;
    margin-bottom: 26px;
    text-wrap: balance;
}

.intro-body {
    color: var(--muted);
    font-size: 16.5px;
    line-height: 1.75;
}

.intro-body strong { color: var(--text); font-weight: 600; }

.specializations { margin-top: 44px; }

.specializations h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.spec-grid li {
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--glass);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
    transition: border-color .3s ease, transform .3s ease;
}

.spec-grid li:hover {
    border-color: color-mix(in srgb, var(--violet) 45%, transparent);
    transform: translateY(-2px);
}

.spec-grid li strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
}

/* ---------- 10. Featured — numerowane moduły ---------- */

.featured-project {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(30px, 4.5vw, 60px);
    max-width: var(--container);
    margin: 56px auto;
    padding: clamp(28px, 4.5vw, 48px);
    border-radius: 26px;
    border: 1px solid transparent;
    background:
        linear-gradient(165deg, #0e1019, #0b0d15) padding-box,
        linear-gradient(140deg, color-mix(in srgb, var(--acc) 42%, transparent), var(--line) 38%, color-mix(in srgb, var(--acc-2) 24%, transparent)) border-box;
    overflow: hidden;
}

/* poświata w kolorze projektu */
.featured-project::before {
    content: "";
    position: absolute;
    top: -180px; left: -140px;
    width: 480px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--acc) 13%, transparent), transparent 68%);
    pointer-events: none;
}

.featured-content {
    flex: 1.05;
    min-width: 0;
    position: relative;
}

.featured-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.featured-num { color: color-mix(in srgb, var(--acc) 80%, #fff 5%); }

.featured-meta .featured-label {
    position: relative;
    padding-left: 15px;
}

.featured-meta .featured-label::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 5px; height: 5px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: var(--acc);
}

.featured-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.02em;
    margin-bottom: 18px;
    text-wrap: balance;
}

.featured-desc {
    color: var(--muted);
    font-size: 15.5px;
    line-height: 1.7;
    margin-bottom: 22px;
}

.featured-desc strong { color: var(--text); font-weight: 600; }

.featured-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 26px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(0, 0, 0, .22);
}

.featured-specs li {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: baseline;
}

.featured-specs .spec-k {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    color: color-mix(in srgb, var(--acc) 72%, var(--dim));
    text-transform: uppercase;
}

.featured-specs .spec-v {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
}

.featured-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 6px;
}

/* screeny */
.screens-gallery-container { margin-top: 28px; }

.gallery-label { margin-bottom: 14px; }

.screens-row {
    display: flex;
    gap: 12px;
}

.screens-row a {
    flex: 1 1 0;
    min-width: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-2);
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.screens-row a:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--acc) 55%, transparent);
    box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--acc) 40%, transparent);
}

.screens-row img { width: 100%; height: auto; }

.featured-visual {
    flex: .95;
    min-width: 0;
    position: relative;
    will-change: transform;
    transition: transform .3s ease-out;
}

.featured-visual img {
    width: 100%;
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 34px 70px -30px color-mix(in srgb, var(--acc) 28%, rgba(0, 0, 0, .8));
    transition: transform .45s ease;
}

.featured-project:hover .featured-visual img { transform: scale(1.015); }

/* ---------- 11. Archiwum prac ---------- */

.portfolio-note {
    max-width: var(--container);
    margin: 0 auto 44px;
    padding: 0 20px;
    color: var(--muted);
    font-size: 15px;
}

.portfolio-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.category-section { margin-bottom: 72px; }

.category-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 18px;
    margin-bottom: 22px;
}

.category-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.category-count {
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 400;
    color: var(--dim);
    letter-spacing: .08em;
}

.category-desc {
    width: 100%;
    color: var(--dim);
    font-size: 13.5px;
    max-width: 640px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.gallery-item { display: block; }

.photo-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-2);
    transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .92;
    transition: transform .5s ease, opacity .35s ease;
}

.photo-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 34px 14px 12px;
    background: linear-gradient(to top, rgba(4, 5, 9, .92), transparent);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .3s ease, transform .3s ease;
}

.photo-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item:hover .photo-card,
.gallery-item:focus-visible .photo-card {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--aqua) 45%, transparent);
    box-shadow: 0 18px 36px -16px rgba(103, 232, 249, .25);
}

.gallery-item:hover img { transform: scale(1.05); opacity: 1; }

.gallery-item:hover .photo-overlay,
.gallery-item:focus-visible .photo-overlay { opacity: 1; transform: none; }

/* ---------- 12. Kontakt ---------- */

.contact-section {
    max-width: 880px;
    margin: 130px auto 0;
    padding: 0 20px;
    text-align: center;
}

.contact-section .section-head { justify-content: center; }

.contact-section .section-head::before {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong));
}

.contact-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.1;
    margin-bottom: 20px;
    text-wrap: balance;
}

.contact-lead {
    color: var(--muted);
    font-size: 16.5px;
    max-width: 620px;
    margin: 0 auto 34px;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* ---------- 13. Stopka ---------- */

.main-footer {
    max-width: var(--container);
    margin: 110px auto 0;
    padding: 44px 20px 46px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.footer-signature {
    height: 24px;
    width: auto;
    margin: 0 auto 16px;
    opacity: .85;
}

.footer-tagline {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.footer-meta { font-size: 10.5px; }

/* ---------- 14. Story overlay (artykuły case-study) ---------- */

.story-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 16px 0;
}

/* display:flex nadpisałby atrybut hidden — przywracamy jego działanie */
.story-overlay[hidden] { display: none; }

.story-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 5, 9, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.story-panel {
    position: relative;
    width: 100%;
    max-width: 820px;
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 24px 24px 0 0;
    border: 1px solid var(--line);
    border-bottom: none;
    background: linear-gradient(180deg, #0e1019, #0a0c13);
    padding: 0 clamp(22px, 4vw, 46px) 60px;
    animation: story-in .38s ease both;
}

@keyframes story-in {
    from { opacity: 0; transform: translateY(36px); }
    to   { opacity: 1; transform: none; }
}

.story-progress {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 3px;
    margin: 0 calc(-1 * clamp(22px, 4vw, 46px));
    background: linear-gradient(90deg, var(--acc), var(--acc-2));
    transform: scaleX(0);
    transform-origin: 0 50%;
}

.story-head {
    position: sticky;
    top: 3px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 calc(-1 * clamp(22px, 4vw, 46px));
    padding: 16px clamp(22px, 4vw, 46px);
    background: linear-gradient(180deg, rgba(14, 16, 25, .96), rgba(14, 16, 25, .82) 75%, transparent);
}

.story-head .featured-label {
    position: relative;
    padding-left: 15px;
    color: color-mix(in srgb, var(--acc) 75%, var(--dim));
}

.story-head .featured-label::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 5px; height: 5px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: var(--acc);
}

.story-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--bg-2);
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, transform .2s ease;
    flex: none;
}

.story-close:hover {
    color: var(--text);
    border-color: var(--acc);
    transform: rotate(90deg);
}

.story-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin: 14px 0 26px;
    text-wrap: balance;
}

/* treść artykułu (wyjście mini-markdowna) */
.story-content { font-size: 16px; line-height: 1.78; color: #c7cddf; }

.story-content p { margin-bottom: 1.1em; }

.story-content strong { color: var(--text); font-weight: 600; }

.story-content h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--acc) 82%, #fff 6%);
    margin: 2em 0 .7em;
    letter-spacing: -.01em;
}

.story-content h3, .story-content h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.6em 0 .6em;
}

.story-content ul, .story-content ol { margin: 0 0 1.1em 1.3em; }

.story-content ul { list-style: disc; }
.story-content ol { list-style: decimal; }

.story-content li { margin-bottom: .45em; }

.story-content li::marker { color: var(--acc); }

.story-content blockquote {
    margin: 1.5em 0;
    padding: 16px 22px;
    border-left: 3px solid var(--acc);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: color-mix(in srgb, var(--acc) 6%, transparent);
    font-style: italic;
    color: var(--muted);
}

.story-content blockquote p:last-child { margin-bottom: 0; }

.story-content code {
    font-family: var(--font-mono);
    font-size: .86em;
    padding: 2px 7px;
    border-radius: 6px;
    background: #0a0c13;
    border: 1px solid rgba(255, 255, 255, .09);
    color: color-mix(in srgb, var(--acc) 80%, #fff 10%);
}

.story-content pre {
    margin: 0 0 1.2em;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: #0a0c13;
    border: 1px solid rgba(255, 255, 255, .09);
    overflow-x: auto;
}

.story-content pre code { padding: 0; border: none; background: none; }

.story-content img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    margin: 18px 0;
}

.story-content a {
    color: var(--acc);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--acc) 40%, transparent);
    text-underline-offset: 3px;
}

.story-content a:hover { text-decoration-color: var(--acc); }

.story-content hr {
    border: none;
    height: 1px;
    background: var(--line);
    margin: 2em 0;
}

/* ---------- 15. Scroll reveal (steruje site.js: html.anim + .reveal/.in) ---------- */

.anim .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}

.anim .reveal.in {
    opacity: 1;
    transform: none;
}

/* hover kafla nie może się gryźć z transformem reveala */
.anim .gallery-item.reveal.in:hover .photo-card { transform: translateY(-4px); }

/* kreski sekcji rysują się od lewej razem z revealem */
.section-head::after { transform-origin: 0 50%; }

.anim .reveal .section-head::after,
.anim .section-head.reveal::after {
    transform: scaleX(0);
    transition: transform 1s cubic-bezier(.2, .7, .2, 1) .25s;
}

.anim .reveal.in .section-head::after,
.anim .section-head.reveal.in::after {
    transform: scaleX(1);
}

/* moduły featured „wyostrzają się" przy wejściu */
.anim .featured-project.reveal {
    filter: blur(9px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1), filter .8s ease;
}

.anim .featured-project.reveal.in { filter: none; }

/* ---------- 16. Responsywność ---------- */

@media (max-width: 1000px) {
    .hero-inner { grid-template-columns: 1fr; gap: 40px; }
    .hero-spec { max-width: 520px; }
}

@media (max-width: 900px) {
    .featured-project {
        flex-direction: column-reverse;
        align-items: stretch;
        margin-left: 16px;
        margin-right: 16px;
    }
    .featured-visual { max-width: 440px; margin: 0 auto; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .spec-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .nav-links { display: none; }
    .site-nav { gap: 14px; padding: 9px 10px 9px 18px; }

    .main-header { padding-top: 84px; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* screeny featured: poziomy scroll ze snapem */
    .screens-row {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .screens-row a {
        flex: 0 0 44%;
        scroll-snap-align: start;
    }

    .story-overlay { padding: 3vh 8px 0; }

    .featured-specs li { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 420px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .nav-status-text { display: none; }
    .nav-status { padding: 7px 9px; }
    .contact-actions .btn-primary { width: 100%; justify-content: center; }
}

/* ---------- 17. Reduced motion ---------- */

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

    .aurora-blob, .status-dot { animation: none; }

    .main-header, .story-panel { animation: none; }

    *, *::before, *::after {
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
    }
}
