/* =========================================
   V4 — TERMINAL × THREE.JS HYBRID
   JetBrains Mono + neon green + 3D bg + SVG icons
   ========================================= */

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

:root {
    --bg:        #060906;
    --bg-2:    #0d130d;
    --bg-3:    #11181a;
    --fg:        #d8e6d8;
    --muted:    #6e8a6e;
    --line:    #1a2920;
    --line-2:    #2a4030;
    --accent:    #2dff8e;
    --accent-d: #16d273;
    --accent-glow: rgba(45, 255, 142, .35);
    --warn:    #ffd23f;
    --pink:    #ff5fa0;
    --cyan:    #28e7e7;

    --ff:        'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --ff-display: 'Space Grotesk', system-ui, sans-serif;

    --t-fast:    160ms ease;
    --t-med:    340ms cubic-bezier(.4,0,.2,1);
    --t-slow:    700ms cubic-bezier(.16,1,.3,1);

    --scan-opacity: .05;
}

[data-theme="light"] {
    --bg:        #f1f5ee;
    --bg-2:    #e7ede1;
    --bg-3:    #d8e2d1;
    --fg:        #0d1a10;
    --muted:    #4f6552;
    --line:    #cad1c5;
    --line-2:    #b0bcab;
    --accent:    #08a052;
    --accent-d: #0a8245;
    --accent-glow: rgba(8, 160, 82, .25);
    --warn:    #b07000;
    --pink:    #c12b6f;
    --cyan:    #00858a;
    --scan-opacity: .015;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--ff);
    font-weight: 400;
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--t-med), color var(--t-med);
}
body { overflow: hidden; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent); }
strong { color: var(--fg); font-weight: 500; }

/* =================== 3D BG + OVERLAYS =================== */
#bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

.scanlines {
    position: fixed; inset: 0; z-index: 100; pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,var(--scan-opacity)) 0,
        rgba(255,255,255,var(--scan-opacity)) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
}
[data-theme="light"] .scanlines {
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,var(--scan-opacity)) 0,
        rgba(0,0,0,var(--scan-opacity)) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: multiply;
}

.vignette {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 30%, color-mix(in srgb, var(--bg) 85%, transparent) 90%);
}

/* =================== SCROLL =================== */
.snap {
    position: relative;
    z-index: 2;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;      /* guardrail: nigdy nie pozwól na poziomy "suwak" na mobile */
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.snap::-webkit-scrollbar { display: none; }

.section {
    min-height: 100vh;
    min-height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 5.5rem clamp(1rem, 4vw, 4rem) 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Snap "mandatory" działa na każdej szerokości (efekt "one scroll").
   Sekcje wyższe od ekranu (np. #b2b) NIE blokują się: wg spec każda
   pozycja, w której sekcja przykrywa viewport, jest poprawnym punktem
   snapu, więc przewijasz je swobodnie, a snap łapie dopiero na krawędzi. */

/* =================== BARS =================== */
.bar {
    position: fixed;
    left: 0; right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: .65rem clamp(1rem, 4vw, 3rem);
    font-size: .8rem;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.bar--top { top: 0; border-bottom: 1px solid var(--line-2); }
.bar--bottom { bottom: 0; border-top: 1px solid var(--line-2); color: var(--muted); justify-content: space-between; font-size: .72rem; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
}
.brand b { color: var(--accent); font-weight: 700; }
.prompt { color: var(--accent); }
.muted  { color: var(--muted); }

.cursor {
    width: 7px; height: 13px;
    background: var(--accent);
    display: inline-block;
    margin-left: 2px;
    box-shadow: 0 0 6px var(--accent);
    animation: cursor-soft 1.5s ease-in-out infinite;
}
/* legacy hard blink (kept for any leftover usage) */
@keyframes blink { 50% { opacity: 0; } }

/* soft pulse — terminal cursor / caret */
@keyframes cursor-soft {
    0%, 100% { opacity: 1; }
    50%            { opacity: 0.15; }
}

/* slightly slower caret with a held-on phase */
@keyframes caret-soft {
    0%, 38%    { opacity: 1; }
    50%            { opacity: 0.1; }
    62%, 100% { opacity: 1; }
}

/* gentle breathing for scroll hint — opacity + drift */
@keyframes scroll-breathe {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50%            { opacity: 0.35; transform: translateY(3px); }
}

.menu {
    display: flex;
    gap: 1.5rem;
    margin-left: auto;
    color: var(--muted);
}
.menu a {
    position: relative;
    transition: color var(--t-fast);
}
.menu a:hover { color: var(--accent); }
.menu a::before {
    content: '> '; position: absolute; left: -1rem;
    color: var(--accent); opacity: 0;
    transition: opacity var(--t-fast);
}
.menu a:hover::before { opacity: 1; }

.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid var(--accent);
    border-radius: 5px;
    color: var(--fg);
    padding: .4rem .8rem;
    font-family: var(--ff);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 0 12px var(--accent-glow);
    transition: all var(--t-fast);
}
.theme-btn:hover {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 22px var(--accent-glow);
}
.theme-btn__icon { color: var(--accent); transition: color var(--t-fast); flex-shrink: 0; }
.theme-btn:hover .theme-btn__icon,
.theme-btn:hover .theme-btn__bracket { color: var(--bg); }
.theme-btn__bracket { color: var(--accent); transition: color var(--t-fast); }

.status { display: inline-flex; align-items: center; gap: .45rem; }
.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}
.dot.small { width: 6px; height: 6px; }
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%        { opacity: .35; transform: scale(.8); }
}

.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: inline; } }

/* =================== RAIL =================== */
.rail {
    position: fixed;
    left: clamp(.6rem, 1.5vw, 1.2rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    font-size: .72rem;
}
.rail a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .18rem .55rem;
    border-left: 2px solid transparent;
    color: var(--muted);
    transition: all var(--t-fast);
}
.rail-num { color: var(--line-2); }
/* Tylko realny wskaźnik (mysz). Na dotyku :hover "przykleja się" po
   tapnięciu i numerek zostawał podświetlony mimo dalszego scrollowania. */
@media (hover: hover) {
    .rail a:hover { color: var(--accent); border-color: var(--accent); }
}
.rail a.is-active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.rail a.is-active .rail-num { color: var(--accent); }

/* =================== HERO =================== */
.hero { justify-content: center; padding-top: 7rem; }
.hero__inner {
    max-width: 720px;
    margin: 0 auto 0 max(2rem, calc(50vw - 600px));
    padding: 0 1rem;
    position: relative;
}
/* Soft dark vignette behind hero content — boosts text contrast over terrain */
.hero__inner::before {
    content: '';
    position: absolute;
    inset: -3rem -4rem -3rem -4rem;
    background: radial-gradient(ellipse at 30% 50%, color-mix(in srgb, var(--bg) 75%, transparent) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(20px);
}
/* Na węższych ekranach poświata nie może wystawać 4rem poza kontener
   (przy szerokości viewportu ≲800px powodowało to poziomy "suwak"). */
@media (max-width: 820px) {
    .hero__inner::before { inset: -3rem 0; }
}
@media (min-width: 1400px) {
    .hero__inner { margin-left: max(4rem, calc(50vw - 640px)); }
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .65rem;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
}
.meta-tag__text { line-height: 1.5; }
/* On phones the uptime drops to its own line for readability */
@media (max-width: 560px) {
    .meta-tag { align-items: flex-start; }
    .meta-sep { display: none; }
    .meta-uptime { display: block; }
}

h1 {
    font-family: var(--ff);
    font-size: clamp(2.4rem, 8.5vw, 6.5rem);
    margin: 0 0 1.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--fg);
    word-break: keep-all;
    position: relative;
    text-shadow:
        0 2px 24px var(--bg),
        0 0 40px var(--bg),
        0 0 12px color-mix(in srgb, var(--fg) 15%, transparent);
}
h1 em { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }
.prompt-hero { color: var(--accent); margin-right: .25rem; }
.caret { color: var(--fg); animation: caret-soft 1.3s ease-in-out infinite; text-shadow: none; margin: 0 -.05em; }

/* glitch on hero title */
[data-glitch] { position: relative; }
[data-glitch]::before,
[data-glitch]::after {
    content: attr(data-glitch);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    pointer-events: none;
}
[data-glitch]::before {
    color: var(--pink); mix-blend-mode: screen;
    transform: translate(-1.5px, 0); clip-path: inset(0 0 60% 0);
    animation: g-a 6s steps(8) infinite; opacity: .28;
}
[data-glitch]::after {
    color: var(--cyan); mix-blend-mode: screen;
    transform: translate(1.5px, 0); clip-path: inset(60% 0 0 0);
    animation: g-b 6.4s steps(7) infinite; opacity: .28;
}

/* =================== HERO TITLE TYPING =================== */
.hero-title {
    white-space: nowrap;
    overflow: visible;
}
.hero-title__word,
.hero-title__sep,
.hero-title__static,
.prompt-hero,
.caret {
    display: inline-block;
    vertical-align: baseline;
}
.hero-title__static { color: var(--accent); }
.hero-title__sep { opacity: .65; }
.hero-title__word { position: relative; min-width: 0.6ch; }
.hero-title__word[data-glitch="" ] { min-width: 0; }
.hero-title__word.is-glitching::before { opacity: .55; animation-duration: 2.5s; }
.hero-title__word.is-glitching::after    { opacity: .55; animation-duration: 2.5s; }
@keyframes g-a {
    0%, 95%, 100% { transform: translate(0,0); clip-path: inset(0 0 60% 0); }
    96%  { transform: translate(-3px,1px); clip-path: inset(20% 0 30% 0); }
    98%  { transform: translate(2px,-1px); clip-path: inset(40% 0 20% 0); }
}
@keyframes g-b {
    0%, 92%, 100% { transform: translate(0,0); clip-path: inset(60% 0 0 0); }
    93%    { transform: translate(2px,2px); clip-path: inset(30% 0 25% 0); }
    97%    { transform: translate(-2px,-1px); clip-path: inset(50% 0 10% 0); }
}
[data-theme="light"] [data-glitch]::before,
[data-theme="light"] [data-glitch]::after {
    mix-blend-mode: multiply;
    opacity: .3;
}

.lead {
    max-width: 64ch;
    color: var(--fg-2, var(--fg));
    margin: 0 0 2.25rem;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.55;
    text-shadow: 0 1px 14px var(--bg);
}

.cta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.2rem;
    font-family: var(--ff);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 2px;
    border: 1px solid;
    transition: all var(--t-fast);
}
.btn .icon { transition: transform var(--t-fast); }
.btn:hover .icon { transform: translateX(2px); }

.btn--neon {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn--neon:hover {
    box-shadow: 0 0 22px var(--accent-glow);
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn--ghost:hover {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    box-shadow: 0 0 18px var(--accent-glow);
}

.btn--soft {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    font-size: .8rem;
    padding: .55rem 1rem;
}
.btn--soft:hover {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-color: var(--accent);
}

/* disabled / page-in-construction state */
.btn.is-disabled,
.btn:disabled {
    opacity: .45;
    color: var(--muted) !important;
    border-color: var(--line-2) !important;
    background: transparent !important;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important;
    text-shadow: none !important;
    user-select: none;
}
.btn.is-disabled .btn__hint,
.btn:disabled .btn__hint {
    font-size: .68rem;
    color: var(--muted);
    letter-spacing: .04em;
    margin-left: .25rem;
}

.hero__bottom {
    position: absolute;
    bottom: 4.5rem;
    left: clamp(1rem, 4vw, 4rem);
    right: clamp(1rem, 4vw, 4rem);
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .72rem;
}
.scroll-hint.blink { animation: scroll-breathe 2.6s ease-in-out infinite; color: var(--accent); }

/* =================== FRAME =================== */
.box { padding-top: 5.5rem; padding-bottom: 4.5rem; }
.frame {
    border: 1px solid var(--line-2);
    background: color-mix(in srgb, var(--bg-2) 55%, transparent);
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    position: relative;
    box-shadow:
        0 1px 0 0 color-mix(in srgb, var(--accent) 14%, transparent) inset,
        0 24px 56px -24px rgba(0,0,0,.5);
}
.frame::before,
.frame::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    border: 1.5px solid var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}
.frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.frame__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--line-2);
    background: color-mix(in srgb, var(--bg) 30%, transparent);
    color: var(--muted);
    font-size: .78rem;
}
.frame__id { color: var(--accent); font-size: .7rem; letter-spacing: .12em; }
.frame__body { padding: clamp(1.5rem, 3vw, 2.5rem); }

/* =================== HEADINGS =================== */
/* lekki overline — bez ramki, tylko kolor + monospace prefix */
.overline {
    display: inline-block;
    color: var(--accent);
    font-size: .85rem;
    letter-spacing: .04em;
    margin-bottom: .75rem;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 30%, transparent);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    border: 1px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border-radius: 2px;
    box-shadow:
        inset 0 0 10px color-mix(in srgb, var(--accent) 18%, transparent),
        0 0 14px color-mix(in srgb, var(--accent) 22%, transparent);
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    flex-shrink: 0;
}

h2 {
    font-size: clamp(1.8rem, 4.8vw, 3.6rem);
    line-height: 1;
    margin: 0;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--fg);
}
h2.section-title em {
    color: var(--accent);
    text-shadow: 0 0 16px var(--accent-glow);
}

p { color: var(--muted); margin: 0 0 1rem; max-width: 64ch; }
p:last-of-type { margin-bottom: 1.25rem; }

.about__body {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: clamp(1.5rem, 5vw, 4rem);
}

.me-body {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}
.me-head { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.me-title { font-size: clamp(2rem, 5.5vw, 4rem) !important; line-height: 1; }
.me-text {
    columns: 2;
    column-gap: clamp(2rem, 4vw, 3.5rem);
    max-width: 100%;
}
.me-text p {
    break-inside: avoid;
    margin: 0 0 1.1rem;
    max-width: none;
}
.me-text p:last-child { margin-bottom: 0; }
.me-cta { align-self: flex-start; }
@media (max-width: 767.98px) {
    .me-text { columns: 1; }
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line-2);
    border: 1px solid var(--line-2);
    margin-top: 1rem;
}
.stat {
    padding: 1.25rem 1.5rem;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    transition: background var(--t-fast);
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .8s var(--ease-out, cubic-bezier(.16,1,.3,1));
}
.stat.is-counted::after { transform: scaleX(1); }
.stat:hover { background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
.stat__num {
    font-family: var(--ff);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    line-height: 1;
    color: var(--fg);
    font-weight: 700;
    font-feature-settings: 'tnum';
    letter-spacing: -.03em;
    text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 25%, transparent);
}
.stat.is-counted .stat__num { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }
.stat__label {
    color: var(--muted);
    font-size: .68rem;
    letter-spacing: .1em;
    line-height: 1.45;
    text-transform: lowercase;
}

.services__head {
    margin-bottom: 1.75rem;
}

/* =================== CARDS =================== */
.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line-2);
    border: 1px solid var(--line-2);
}
/* 6 kart biznesowych: lg+ = 3 kolumny × 2 rzędy (poniżej dziedziczą 2 kol.) */
@media (min-width: 992px) {
    .cards--6 { grid-template-columns: repeat(3, 1fr); }
}

/* "...i wiele więcej" note under the service cards */
.cards-more {
    max-width: none;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--line-2);
    text-align: center;
    font-size: .92rem;
    color: var(--muted);
    letter-spacing: .01em;
    text-wrap: balance;
}
.cards-more__c { opacity: .6; }
.cards-more a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
    padding-bottom: 1px;
    transition: all var(--t-fast);
}
.cards-more a:hover {
    border-bottom-color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* =================== STACK SECTION =================== */
.stack {
    display: flex;
    flex-direction: column;
}
.stack-row {
    display: grid;
    grid-template-columns: minmax(170px, 220px) 1fr;
    align-items: start;
    gap: 1.5rem;
    padding: 1.1rem 0;
    border-bottom: 1px dashed var(--line-2);
}
.stack-row:first-child { padding-top: .25rem; }
.stack-row:last-child    { border-bottom: 0; padding-bottom: .25rem; }
.stack-label {
    color: var(--accent);
    font-size: .82rem;
    letter-spacing: .04em;
    padding-top: .35rem;
}
.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.stack-tag {
    display: inline-flex;
    align-items: center;
    padding: .35rem .8rem;
    border: 1px solid var(--line-2);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--fg);
    font-size: .82rem;
    border-radius: 3px;
    line-height: 1.2;
    cursor: default;
    transition: all var(--t-fast);
    white-space: nowrap;
}
.stack-tag:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
    transform: translateY(-1px);
}
@media (max-width: 767.98px) {
    .stack-row { grid-template-columns: 1fr; gap: .5rem; padding: .9rem 0; }
    .stack-label { padding-top: 0; }
}
.cell {
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    position: relative;
    transition: all var(--t-fast);
    overflow: hidden;
}
.cell::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-med);
}
.cell:hover {
    background: color-mix(in srgb, var(--accent) 5%, var(--bg));
}
.cell:hover::after { transform: scaleX(1); }
.cell:hover .cell__icon { color: var(--accent); transform: translateY(-2px); }

.cell__icon {
    color: var(--muted);
    margin-bottom: 1rem;
    transition: all var(--t-med);
    display: inline-flex;
}
.cell__icon svg { display: block; }

.cell__id {
    color: var(--accent);
    font-size: .72rem;
    margin-bottom: .55rem;
    display: block;
    letter-spacing: .03em;
}
.cell h3 {
    display: none;
}
.cell p { font-size: .88rem; margin: 0; }

/* =================== CONTACT =================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line-2);
    border: 1px solid var(--line-2);
    margin-bottom: 1.5rem;
}
.contact-cell {
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    transition: all var(--t-fast);
    display: flex;
    flex-direction: column;
    gap: .3rem;
    position: relative;
    overflow: hidden;
}
.contact-cell::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-med);
}
.contact-cell:hover {
    background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}
.contact-cell:hover::after { transform: scaleX(1); }
.contact-cell:hover .contact-cell__icon { color: var(--accent); transform: translateY(-2px); }

.contact-cell__icon {
    color: var(--muted);
    margin-bottom: .65rem;
    transition: all var(--t-med);
    display: inline-flex;
}
.contact-cell__key { color: var(--accent); font-size: .72rem; }
.contact-cell__val { color: var(--fg); font-size: clamp(.95rem, 1.4vw, 1.15rem); font-weight: 500; }
.contact-cell__meta { color: var(--muted); font-size: .78rem; }

/* phone reveal-on-click — blurred until clicked (real number kept out of static HTML) */
.contact-cell__val--blur { filter: blur(6px); user-select: none; transition: filter .45s ease; }
.contact-cell[data-phone] { cursor: pointer; }
.contact-cell[data-phone] .contact-cell__meta { color: var(--accent); }
.contact-cell[data-phone].is-revealed .contact-cell__meta { color: var(--muted); }

.foot {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .78rem;
    border-top: 1px solid var(--line-2);
    padding-top: 1rem;
}
.foot .link { color: var(--accent); }
.foot .link:hover { text-decoration: underline; }
.foot .link.is-disabled {
    color: var(--muted);
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: none;
}
.foot__sep { opacity: .4; margin: 0 .35rem; }

/* =================== COOKIES / ZGODA =================== */
.consent {
    position: fixed;
    z-index: 120;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 660px;
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--line-2);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    animation: consentIn var(--t-slow);
}
.consent[hidden] { display: none; }
.consent__text {
    flex: 1 1 320px;
    margin: 0;
    font-size: .8rem;
    line-height: 1.5;
    color: var(--muted);
}
.consent__text strong { color: var(--fg); font-weight: 500; }
.consent__c { color: var(--accent); opacity: .7; }
.consent__actions { display: flex; gap: .5rem; flex-shrink: 0; }
.consent .btn { padding: .55rem 1rem; font-size: .8rem; }
@keyframes consentIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 560px) {
    .consent { left: .6rem; right: .6rem; bottom: .6rem; }
    .consent__actions { width: 100%; }
    .consent .btn { flex: 1; justify-content: center; }
}

/* =================== REVEAL + SECTION TRANSITIONS =================== */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--t-slow), transform var(--t-slow);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Frame appears synchronized with content reveal (during deceleration phase) —
     no more empty boxes flashing in before the text is ready. */
.section .frame {
    opacity: 0;
    transform: translateY(18px) scale(.985);
    transition:
        opacity .9s cubic-bezier(.16, 1, .3, 1),
        transform .9s cubic-bezier(.16, 1, .3, 1);
}
.section.is-revealed .frame {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Page-wide chromatic flash during bg transition */
html.is-transitioning h2,
html.is-transitioning .frame__head .prompt {
    animation: chromFlash .55s ease-out;
}
@keyframes chromFlash {
    0%, 100% { text-shadow: none; }
    50% {
        text-shadow:
            -1.5px 0 0 #ff5fa0,
             1.5px 0 0 #28e7e7;
    }
}

/* Rail-num briefly emphasized on active */
.rail a.is-active .rail-num {
    animation: railPulse .8s ease-out;
}
@keyframes railPulse {
    0%        { transform: scale(1); }
    40%     { transform: scale(1.35); color: var(--fg); }
    100% { transform: scale(1); }
}

/* =================== RESPONSIVE (Bootstrap-style: lg/md/sm) =================== */

/* < lg (992): chowamy menu, kompaktujemy paski i szynę, hero na pełną szerokość.
   Tu też cards--6 schodzi z 3 → 2 kolumn (reguła min-width:992 wyżej). */
@media (max-width: 991.98px) {
    .menu { display: none; }
    .bar--bottom { font-size: .72rem; gap: .9rem; }
    .rail { font-size: .68rem; gap: 0; }
    .rail-label { display: none; }
    .rail a { padding: .12rem .4rem; }
    .hero__inner { margin-left: auto; max-width: 100%; }
    .section { padding: 5rem clamp(1rem, 4vw, 3rem) 4.5rem; }
}

/* < md (768): układy dwukolumnowe schodzą do jednej kolumny. */
@media (max-width: 767.98px) {
    .about__body { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .foot { flex-direction: column; gap: .5rem; }
    .section { padding: 4.5rem .9rem 4rem; }
    .hero__bottom { font-size: .65rem; bottom: 4rem; }
    h1 { letter-spacing: -.03em; }
}

/* < sm (576): telefon — wszystko w jednej kolumnie, najciaśniejsze odstępy. */
@media (max-width: 575.98px) {
    .stats { grid-template-columns: 1fr; }
    .stat { padding: 1rem; }
    .cards, .cards--6 { grid-template-columns: 1fr; }
    .bar--bottom { font-size: .68rem; gap: .6rem; }
    .section { padding: 4.25rem .75rem 3.75rem; }
}

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