/* ==========================================================================
   Ferrum Cars – refined minimal, drobna typografia, złoty akcent
   ========================================================================== */
:root {
    --bg: #fcfbf9;
    --surface: #ffffff;
    --ink: #16140f;
    --ink-soft: #6b675e;
    --hairline: #eae6dd;
    --gold: #c29a3f;
    --gold-deep: #a37f2e;
    --gold-bright: #f4c74a;
    --font: "Geist", sans-serif;
    --nav-h: 62px;
    --pad: clamp(20px, 4vw, 48px);
    --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 15px;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Preloader (intro filmowe z markami) ------------------------------- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0a0907;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: preloadOut .5s cubic-bezier(.6,.1,.3,1) 2.7s forwards;
}
.preloader::before,
.preloader::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 40px;
    background: #0a0907;
    z-index: 3;
    pointer-events: none;
}
.preloader::before { top: -1px; animation: barTop .5s cubic-bezier(.6,.1,.3,1) 2.7s forwards; }
.preloader::after { bottom: -1px; animation: barBottom .5s cubic-bezier(.6,.1,.3,1) 2.7s forwards; }
@keyframes barTop { to { transform: translateY(-100%); } }
@keyframes barBottom { to { transform: translateY(100%); } }
@keyframes preloadOut {
    to { opacity: 0; visibility: hidden; }
}

.preloader__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 3.2vw, 56px);
    width: min(86vw, 1100px);
    height: clamp(50px, 8vw, 90px);
    transform: scale(.78) skewX(-8deg);
    opacity: 0;
    animation:
        stageIn .8s cubic-bezier(.22,.8,.3,1) .15s forwards,
        stagePush .8s cubic-bezier(.6,.1,.3,1) 1.95s forwards;
}
.preloader__stage img {
    height: 100%;
    width: auto;
    max-width: min(14vw, 170px);
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0;
    transform: translateY(20px);
    animation: brandDrop .55s cubic-bezier(.2,.7,.3,1) forwards;
    animation-delay: calc(.35s + var(--i) * .09s);
}
@keyframes stageIn {
    to { opacity: 1; transform: scale(1) skewX(-2deg); }
}
@keyframes stagePush {
    to { transform: scale(1.35) skewX(6deg); opacity: 0; }
}
@keyframes brandDrop {
    to { opacity: 1; transform: translateY(0); }
}

.preloader__scan {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 48%, rgba(194,154,63,.14) 50%, transparent 52%);
    background-size: 100% 6px;
    opacity: .5;
    mix-blend-mode: screen;
    pointer-events: none;
}

.preloader__mark {
    position: absolute;
    bottom: clamp(28px, 6vh, 56px);
    left: 50%;
    transform: translateX(-50%);
    font-family: "Chakra Petch", var(--font);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .6em;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    padding-left: .6em;
    opacity: 0;
    animation: markIn .6s ease .6s forwards, markPulse 1.4s ease .9s infinite alternate;
}
@keyframes markIn { to { opacity: 1; } }
@keyframes markPulse {
    from { color: rgba(255,255,255,.35); }
    to   { color: var(--gold-bright); }
}

body.preload-done .preloader { display: none; }

/* --- Buttons – motorsport (ścięte rogi + przelot światła) ------------- */
.btn {
    --cut: 8px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
    padding: 10px 18px;
    color: #fff;
    overflow: hidden;
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    transition: transform .2s cubic-bezier(.22,.8,.3,1), box-shadow .25s ease, color .22s ease;
}
.btn > * { position: relative; z-index: 2; }
.btn svg { width: 14px; height: 14px; transition: transform .25s cubic-bezier(.22,.8,.3,1); }
/* sweep światła */
.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(105deg, transparent 32%, rgba(255,255,255,.45) 50%, transparent 68%);
    transform: translateX(-130%);
    transition: transform .6s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}
.btn:hover::after { transform: translateX(130%); }
.btn:active { transform: translateY(1px); }

/* primary – metaliczne złoto */
.btn--gold {
    background: linear-gradient(135deg, #e9bd54 0%, var(--gold) 45%, var(--gold-deep) 100%);
    color: #17130a;
    box-shadow: 0 6px 18px -8px rgba(163, 127, 46, .7), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--gold:hover { box-shadow: 0 10px 26px -8px rgba(163, 127, 46, .85), inset 0 1px 0 rgba(255,255,255,.5); }
.btn--gold:hover svg { transform: translateX(4px); }

/* secondary na wideo – szklane obramowanie z gold krawędzią */
.btn--light {
    background: rgba(255, 255, 255, .05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.btn--light:hover { box-shadow: inset 0 0 0 1px var(--gold); color: #fff; }

/* secondary na białym */
.btn--ghost {
    color: var(--ink);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--hairline);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--gold); }
.btn--ghost::after { background: linear-gradient(105deg, transparent 32%, rgba(194,154,63,.22) 50%, transparent 68%); }

.btn--block { width: 100%; }

/* --- Nav -------------------------------------------------------------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    transition: background .3s ease, border-color .3s ease;
}
.nav.is-solid {
    background: rgba(252, 251, 249, .86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--hairline);
}
.nav__inner {
    max-width: 1360px;
    margin: 0 auto;
    height: var(--nav-h);
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.nav__logo img { width: 118px; height: auto; }
.nav__links { display: flex; gap: clamp(16px, 2.4vw, 32px); }
.nav__links a {
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .8);
    padding: 5px 0;
    transition: color .18s ease;
}
.nav__links a:hover { color: #fff; }
.nav.is-solid .nav__links a { color: var(--ink-soft); }
.nav.is-solid .nav__links a:hover { color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: 16px; }
.nav__phone {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, .8);
    transition: color .18s ease;
}
.nav__phone svg { width: 13px; height: 13px; color: var(--gold); }
.nav__phone:hover { color: #fff; }
.nav.is-solid .nav__phone { color: var(--ink-soft); }
.nav.is-solid .nav__phone:hover { color: var(--ink); }
.nav__cta { padding: 8px 15px; font-size: 13px; }

/* burger */
.nav__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px; height: 38px;
    padding: 0 8px;
    background: none;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    cursor: pointer;
}
.nav__burger span {
    display: block;
    height: 1.5px;
    background: #fff;
    transition: transform .3s ease;
}
.nav.is-solid .nav__burger { border-color: var(--hairline); }
.nav.is-solid .nav__burger span { background: var(--ink); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* mobile menu */
.mnav[hidden] { display: none; }
.mnav {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    z-index: 99;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(20px, 5vw, 40px) var(--pad) 36px;
}
.mnav__links { display: flex; flex-direction: column; }
.mnav__links a {
    font-weight: 600;
    font-size: clamp(22px, 5.5vw, 30px);
    letter-spacing: -.02em;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mnav__links a::after {
    content: "→";
    color: var(--gold);
    font-size: .65em;
}
.mnav__foot { display: flex; flex-direction: column; gap: 14px; }
.mnav__phone {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
}

/* --- Hero -------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: clamp(540px, 82svh, 760px);
    display: flex;
    color: #fff;
    overflow: hidden;
}
.hero__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.hero__bg video,
.hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(12, 11, 9, .42) 0%, rgba(12, 11, 9, .06) 32%, rgba(12, 11, 9, .1) 62%, rgba(12, 11, 9, .62) 100%),
        linear-gradient(100deg, rgba(12, 11, 9, .4) 0%, rgba(12, 11, 9, .12) 48%, rgba(12, 11, 9, 0) 72%);
}
.hero__inner {
    position: relative;
    z-index: 1;
    max-width: 1360px;
    margin: 0 auto;
    width: 100%;
    padding: calc(var(--nav-h) + clamp(20px, 4vh, 44px)) var(--pad) clamp(30px, 5vh, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}
.hero__stage {
    width: 100%;
    text-align: center;
}

/* --- Title (filmowy reveal) --- */
.hero__title {
    font-family: "Manrope", var(--font);
    font-weight: 800;
    font-size: clamp(38px, 7.4vw, 112px);
    line-height: .88;
    letter-spacing: -.045em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 32px rgba(0, 0, 0, .35);
    margin-bottom: clamp(28px, 4vh, 46px);
}
.hero__title-line {
    display: block;
    position: relative;
    opacity: 0;
    will-change: transform, opacity;
}
.hero__title-line--1 {
    transform: translateX(-110vw);
}
.hero__title-line--2 {
    transform: translateX(110vw) skewX(-9deg);
    color: var(--gold-bright);
}

body.hero-play .hero__title-line--1 {
    animation:
        filmSlide1 .9s cubic-bezier(.85, 0, .1, 1) .1s forwards,
        heroGlitch1 .55s cubic-bezier(.35, .7, .4, 1) 1.6s forwards;
}
body.hero-play .hero__title-line--2 {
    animation:
        filmSlide2 .9s cubic-bezier(.85, 0, .1, 1) .3s forwards,
        heroGlitch2 .55s cubic-bezier(.35, .7, .4, 1) 1.85s forwards;
}
@keyframes filmSlide1 {
    0%   { opacity: 0; transform: translateX(-110vw); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes filmSlide2 {
    0%   { opacity: 0; transform: translateX(110vw) skewX(-9deg); }
    100% { opacity: 1; transform: translateX(0) skewX(-9deg); }
}
@keyframes heroGlitch1 {
    0%   { transform: translateX(0); text-shadow: 0 2px 32px rgba(0, 0, 0, .35); }
    15%  { transform: translateX(8px); text-shadow: -8px 0 rgba(255,255,255,.95), 8px 0 rgba(255,255,255,.75), 0 0 24px rgba(255,255,255,.4), 0 2px 32px rgba(0, 0, 0, .35); }
    30%  { transform: translateX(-7px); text-shadow: 9px 0 rgba(255,255,255,.95), -9px 0 rgba(255,255,255,.7), 0 0 28px rgba(255,255,255,.45), 0 2px 32px rgba(0, 0, 0, .35); }
    45%  { transform: translateX(6px); text-shadow: -7px 0 rgba(255,255,255,.9), 7px 0 rgba(255,255,255,.6), 0 0 22px rgba(255,255,255,.35), 0 2px 32px rgba(0, 0, 0, .35); }
    60%  { transform: translateX(-4px); text-shadow: 5px 0 rgba(255,255,255,.8), -5px 0 rgba(255,255,255,.55), 0 0 18px rgba(255,255,255,.3), 0 2px 32px rgba(0, 0, 0, .35); }
    75%  { transform: translateX(3px); text-shadow: -3px 0 rgba(255,255,255,.6), 3px 0 rgba(255,255,255,.4), 0 2px 32px rgba(0, 0, 0, .35); }
    90%  { transform: translateX(-1px); text-shadow: 0 2px 32px rgba(0, 0, 0, .35); }
    100% { transform: translateX(0); text-shadow: 0 2px 32px rgba(0, 0, 0, .35); }
}
@keyframes heroGlitch2 {
    0%   { transform: translateX(0) skewX(-9deg); text-shadow: 0 2px 32px rgba(0, 0, 0, .35); }
    15%  { transform: translateX(-8px) skewX(-9deg); text-shadow: 8px 0 rgba(255,255,255,.95), -8px 0 rgba(255,255,255,.75), 0 0 24px rgba(255,255,255,.4), 0 2px 32px rgba(0, 0, 0, .35); }
    30%  { transform: translateX(7px) skewX(-9deg); text-shadow: -9px 0 rgba(255,255,255,.95), 9px 0 rgba(255,255,255,.7), 0 0 28px rgba(255,255,255,.45), 0 2px 32px rgba(0, 0, 0, .35); }
    45%  { transform: translateX(-6px) skewX(-9deg); text-shadow: 7px 0 rgba(255,255,255,.9), -7px 0 rgba(255,255,255,.6), 0 0 22px rgba(255,255,255,.35), 0 2px 32px rgba(0, 0, 0, .35); }
    60%  { transform: translateX(4px) skewX(-9deg); text-shadow: -5px 0 rgba(255,255,255,.8), 5px 0 rgba(255,255,255,.55), 0 0 18px rgba(255,255,255,.3), 0 2px 32px rgba(0, 0, 0, .35); }
    75%  { transform: translateX(-3px) skewX(-9deg); text-shadow: 3px 0 rgba(255,255,255,.6), -3px 0 rgba(255,255,255,.4), 0 2px 32px rgba(0, 0, 0, .35); }
    90%  { transform: translateX(1px) skewX(-9deg); text-shadow: 0 2px 32px rgba(0, 0, 0, .35); }
    100% { transform: translateX(0) skewX(-9deg); text-shadow: 0 2px 32px rgba(0, 0, 0, .35); }
}

/* --- Reveal (opis + buttony z dołu) --- */
.hero__reveal {
    opacity: 0;
    transform: translateY(46px);
    will-change: transform, opacity;
}
body.hero-play .hero__reveal {
    animation: heroReveal .9s cubic-bezier(.22, .8, .3, 1) 1.35s forwards;
}
@keyframes heroReveal {
    to { opacity: 1; transform: translateY(0); }
}

.hero__lead {
    font-size: clamp(15px, 1.1vw, 17px);
    color: rgba(255, 255, 255, .82);
    max-width: 52ch;
    margin: 0 auto 24px;
}
.hero__cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}
/* --- Facts (biała sekcja pod hero) -------------------------------------- */
.facts {
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
}
.facts__list {
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(16px, 2.4vw, 40px);
    padding: clamp(26px, 4vw, 40px) var(--pad);
}
.facts__list li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    padding-left: 15px;
}
.facts__list li::before {
    content: "";
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: 1px;
    background: var(--ink);
}
.facts__list strong {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink);
}
.facts__list span {
    font-size: 12.5px;
    color: var(--ink-soft);
}

/* FerrumCare – markowy program w pasku atutów */
.facts__safe a {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.facts__safe strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.facts__safe-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid var(--gold);
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: .03em;
    color: var(--gold-deep);
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.facts__safe span:not(.facts__safe-badge) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.facts__safe span:not(.facts__safe-badge)::after {
    content: "→";
    font-size: 11px;
    color: var(--gold);
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity .2s ease, transform .2s ease;
}
.facts__safe a:hover .facts__safe-badge {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
}
.facts__safe a:hover span:not(.facts__safe-badge)::after { opacity: 1; transform: translateX(0); }

/* --- Animations --------------------------------------------------------- */
.anim {
    opacity: 0;
    transform: translateY(16px);
    animation: rise .7s cubic-bezier(.22, .8, .3, 1) forwards;
    animation-delay: var(--d, 0s);
}
@keyframes rise {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1080px) {
    .nav__phone span { display: none; }
}
@media (max-width: 900px) {
    .nav__links, .nav__phone { display: none; }
    .nav__burger { display: flex; }

    .facts__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px clamp(16px, 3vw, 28px);
    }
}
@media (max-width: 600px) {
    .nav__cta { display: none; }
    .nav__logo img { width: 104px; }

    .hero { min-height: clamp(520px, 86svh, 700px); }
    .hero__title { font-size: clamp(44px, 15vw, 84px); }
    .hero__cta .btn { flex: 1 1 auto; }
    .facts__list { grid-template-columns: 1fr 1fr; }
}

/* --- Reduced motion (musi być na końcu — nadpisuje media queries) ------ */
@media (prefers-reduced-motion: reduce) {
    .anim, .anim-panel, .hero__reveal {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .hero__title-line--1 { animation: none !important; opacity: 1 !important; transform: translateX(0) !important; }
    .hero__title-line--2 { animation: none !important; opacity: 1 !important; transform: translateX(0) skewX(-9deg) !important; }
    .preloader { display: none !important; }
}
