/*
 * fx.css — ciemny motyw „zorza" + efekty przewijania dla limsko.pl (PL i EN).
 * Ładowany PO style.css i tylko go nadpisuje; bez tego pliku strona dalej działa.
 * Efekty zależne od JS są aktywne tylko przy klasie .fx na <html> (dodaje ją js/fx.js).
 */

:root {
    --bg: #080f19;
    --bg-2: #0b1522;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-2: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.18);
    --text: #e9f0fa;
    --muted: #93a3b8;
    --primary: #7ec57a;
    --primary-dark: #5cb85c;
    --teal: #3fd6c0;
    --violet: #9b87ff;
    --secondary: var(--muted);
    --dark: var(--text);
    --light: var(--bg);
    --gray: var(--line);
    --gradient: linear-gradient(135deg, #7ec57a 0%, #3fd6c0 100%);
    --aurora: linear-gradient(100deg, #7ec57a 0%, #3fd6c0 45%, #9b87ff 100%);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    color-scheme: dark;
}

html { scroll-behavior: auto; scroll-padding-top: 80px; overflow-x: clip; }

body {
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: rgba(126, 197, 122, 0.35); color: #fff; }

/* Delikatna siatka i „mgła" zorzy za całą stroną (poza hero). */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60vw 40vh at 85% 10%, rgba(155, 135, 255, 0.07), transparent 70%),
        radial-gradient(70vw 50vh at 10% 60%, rgba(63, 214, 192, 0.06), transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 64px 64px;
    -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}

/* ---------- Pasek postępu przewijania ---------- */
.fx-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 1100;
    background: var(--aurora);
    transform-origin: 0 50%;
    transform: scaleX(0);
    box-shadow: 0 0 12px rgba(63, 214, 192, 0.6);
    pointer-events: none;
}
@supports (animation-timeline: scroll()) {
    .fx-progress {
        animation: fx-progress linear both;
        animation-timeline: scroll(root);
    }
    @keyframes fx-progress { to { transform: scaleX(1); } }
}

/* ---------- Nawigacja ---------- */
nav {
    background: transparent;
    border-bottom: 1px solid transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: background .4s ease, border-color .4s ease, padding .4s var(--ease-out), transform .45s var(--ease-out);
}
nav.scrolled {
    background: rgba(8, 15, 25, 0.62);
    border-bottom-color: var(--line);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    padding: 10px 0;
}
nav.hide { transform: translateY(-100%); }
.nav-logo { transition: height .4s var(--ease-out); }
nav.scrolled .nav-logo { height: 32px; }

.nav-links a {
    position: relative;
    color: rgba(233, 240, 250, 0.7);
    padding: 6px 0;
}
.nav-links a:hover, .nav-links a.current { color: #fff; }
.nav-links li:not(.lang-switcher) a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: var(--aurora);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .45s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a.current::after { transform: scaleX(1); }
.lang-switcher { border-left-color: var(--line-2); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background: #050b14;
    isolation: isolate;
}
.hero-aurora {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: block;
    opacity: 0;
    transition: opacity 1.8s ease;
}
.hero-aurora.on { opacity: 1; }
/* Zapas bez WebGL: statyczna zorza z gradientów. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(90% 55% at 25% 40%, rgba(126, 197, 122, 0.2), transparent 60%),
        radial-gradient(70% 45% at 75% 30%, rgba(155, 135, 255, 0.18), transparent 60%),
        linear-gradient(#02050c, #0b1a2c);
}
/* Płynne przejście hero → reszta strony. */
.hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 160px;
    z-index: -1;
    background: linear-gradient(transparent, var(--bg));
    pointer-events: none;
}

.hero-content { will-change: transform; }
.hero-text h1 {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.hero-text h1 .fx-char { color: #fff; }
.hero-text h1 span:not(.fx-char) {
    background: var(--aurora);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fx-shimmer 8s ease-in-out infinite;
}
@keyframes fx-shimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

.hero-subtitle { color: rgba(233, 240, 250, 0.85); }
.hero-description { color: rgba(233, 240, 250, 0.66); }

.badge {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line-2);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text);
}
.badge.primary { background: var(--gradient); border-color: transparent; color: #06140c; font-weight: 600; }

.btn { border-radius: 999px; position: relative; will-change: transform; }
.btn-primary {
    background: var(--gradient);
    color: #06140c;
    box-shadow: 0 8px 30px -8px rgba(63, 214, 192, 0.55);
}
.btn-primary:hover { box-shadow: 0 14px 44px -8px rgba(63, 214, 192, 0.75); }
.btn-secondary {
    border: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.btn-secondary:hover { border-color: var(--teal); color: #fff; background: rgba(255, 255, 255, 0.1); }

/* Zdjęcie: obracający się pierścień zorzy zamiast płaskiej ramki. */
.hero-image::before {
    inset: -4px;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 30px;
    background: conic-gradient(from var(--fx-angle, 0deg), #7ec57a, #3fd6c0, #9b87ff, #7ec57a);
    animation: fx-spin 6s linear infinite;
}
.hero-image::after {
    content: '';
    position: absolute;
    inset: -30px;
    z-index: -1;
    border-radius: 50%;
    background: conic-gradient(from var(--fx-angle, 0deg), #7ec57a, #3fd6c0, #9b87ff, #7ec57a);
    filter: blur(40px);
    opacity: 0.35;
    animation: fx-spin 6s linear infinite;
}
.hero-image img { border-radius: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
@property --fx-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes fx-spin { to { --fx-angle: 360deg; } }

.fx-scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 28px;
    width: 26px; height: 42px;
    margin-left: -13px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    z-index: 1;
}
.fx-scroll-hint::before {
    content: '';
    position: absolute;
    left: 50%; top: 8px;
    width: 4px; height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: #fff;
    animation: fx-wheel 1.8s var(--ease-out) infinite;
}
@keyframes fx-wheel { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Pasek technologii (marquee) ---------- */
.fx-marquee {
    position: relative;
    overflow: hidden;
    padding: 22px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.fx-marquee-track {
    display: flex;
    width: max-content;
    gap: 56px;
    animation: fx-marquee 40s linear infinite;
}
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused; }
.fx-marquee span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(233, 240, 250, 0.45);
    white-space: nowrap;
    transition: color .3s;
}
.fx-marquee span:hover { color: #fff; }
.fx-marquee i { font-size: 1.3rem; }
@keyframes fx-marquee { to { transform: translateX(-50%); } }

/* ---------- Sekcje ---------- */
.about, .skills, .experience, .services, .contact { background: transparent; }
section { position: relative; }

.section-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    letter-spacing: -0.02em;
    color: #fff;
}
.section-title::before {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    margin-bottom: 18px;
    border-radius: 4px;
    background: var(--aurora);
}
.section-subtitle { color: var(--muted); }

.about-text p { color: rgba(233, 240, 250, 0.74); }

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}
.stat-number {
    background: var(--aurora);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
    font-size: 2.8rem;
}

/* Karty: szkło + reflektor podążający za kursorem (--mx/--my ustawia fx.js). */
.skill-card, .service-card, .contact-form, .business-info {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.skill-card, .service-card {
    transform-style: preserve-3d;
    transition: border-color .3s, background .3s, box-shadow .3s, transform .5s var(--ease-out);
}
.skill-card::before, .service-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s;
    background:
        radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(126, 197, 122, 0.14), transparent 45%);
}
.skill-card::after, .service-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(63, 214, 192, 0.9), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.skill-card:hover, .service-card:hover {
    background: var(--surface-2);
    border-color: var(--line-2);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.skill-card:hover::before, .service-card:hover::before,
.skill-card:hover::after, .service-card:hover::after { opacity: 1; }
.skill-card:hover { transform: translateY(-4px); }
.fx .skill-card:hover, .fx .service-card:hover {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
}

.skill-icon {
    border-radius: 14px;
    color: #06140c;
    box-shadow: 0 10px 30px -10px rgba(63, 214, 192, 0.7);
    transform: translateZ(30px);
}
.skill-card h3, .service-card h3 { color: #fff; }
.skill-card p { color: var(--muted); }
.skill-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    color: rgba(233, 240, 250, 0.75);
}
.service-card i {
    background: var(--aurora);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ---------- Oś czasu rysowana przewijaniem ---------- */
.timeline::before { background: var(--line); }
.timeline::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 2px;
    height: 100%;
    background: var(--aurora);
    background-size: 100% 100%;
    transform-origin: 50% 0;
    transform: scaleY(var(--fx-line, 1));
    box-shadow: 0 0 12px rgba(63, 214, 192, 0.7);
}
.timeline-item::before {
    background: var(--bg);
    border: 2px solid var(--line-2);
    box-shadow: none;
    width: 14px; height: 14px;
    left: -6px;
    transition: background .4s, border-color .4s, box-shadow .4s, transform .4s var(--ease-out);
    z-index: 1;
}
.timeline-item.lit::before, html:not(.fx) .timeline-item::before {
    background: var(--primary);
    border-color: #d8ffe6;
    box-shadow: 0 0 0 6px rgba(126, 197, 122, 0.18), 0 0 20px rgba(126, 197, 122, 0.8);
    transform: scale(1.15);
}
.timeline-date {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(126, 197, 122, 0.12);
    border: 1px solid rgba(126, 197, 122, 0.3);
    color: var(--primary);
}
.timeline-title { color: #fff; }
.timeline-company { color: var(--teal); opacity: .85; }
.timeline-description { color: rgba(233, 240, 250, 0.7); }

/* ---------- Kontakt ---------- */
.contact-info h3, .business-info h4, .contact-item-content h4 { color: #fff; }
.contact-item i { color: #06140c; border-radius: 12px; }
.contact-item-content a { color: var(--primary); }
.social-link {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
    border-radius: 14px;
    transition: transform .4s var(--ease-out), background .25s, border-color .25s, color .25s, box-shadow .25s;
}
.social-link:hover {
    background: var(--gradient);
    border-color: transparent;
    color: #06140c;
    box-shadow: 0 10px 30px -10px rgba(63, 214, 192, 0.8);
}
.contact-form { border-radius: 24px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8); }
.business-info { border-radius: 20px; }
.business-details dt { color: #fff; }
.form-group label { color: rgba(233, 240, 250, 0.85); }
.form-group input, .form-group textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--line-2);
    color: var(--text);
    border-radius: 12px;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(147, 163, 184, 0.6); }
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(63, 214, 192, 0.15);
    background: rgba(0, 0, 0, 0.35);
}
.form-success { color: var(--primary); }
.form-success p { color: var(--muted); }

footer { background: transparent; border-top: 1px solid var(--line); }

/* ---------- Pojawianie się przy przewijaniu ---------- */
.fx [data-reveal] {
    opacity: 0;
    transform: translateY(36px);
    filter: blur(6px);
    transition:
        opacity .9s var(--ease-out) var(--d, 0s),
        transform 1s var(--ease-out) var(--d, 0s),
        filter .9s var(--ease-out) var(--d, 0s);
}
.fx [data-reveal="left"] { transform: translateX(-40px); }
.fx [data-reveal="right"] { transform: translateX(40px); }
.fx [data-reveal="zoom"] { transform: scale(.92); }
.fx [data-reveal].in { opacity: 1; transform: none; filter: none; }
/* Po wejściu karta wraca do własnych przejść (hover/tilt nie może czekać na --d). */
.fx .skill-card.in, .fx .service-card.in {
    transition: border-color .3s, background .3s, box-shadow .3s, transform .5s var(--ease-out);
}

/* Tytuł hero: litery wlatują po kolei. */
.fx-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.6em) rotate(8deg);
    animation: fx-char .9s var(--ease-out) forwards;
    animation-delay: calc(var(--i) * 45ms + 150ms);
}
@keyframes fx-char { to { opacity: 1; transform: none; } }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .hero-image::after { inset: -16px; }
    .fx-scroll-hint { display: none; }
    .fx-marquee-track { gap: 36px; animation-duration: 28s; }
    .timeline::after, .timeline::before { left: 0; }
    .contact-grid > * { min-width: 0; }
    .contact-form { padding: 24px 18px; }
    .business-info { padding: 24px 20px; }
}

/* ---------- Ograniczony ruch ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .fx [data-reveal] { opacity: 1; transform: none; filter: none; }
    .fx-char { opacity: 1; transform: none; }
    .fx-marquee-track { animation: none; }
}
