:root{
    --bg-left: #e9eaec;
    --text: #212122;
    --muted: rgba(18,19,22,.7);

    --right-1: #0e0f17;
    --right-2: #2b0f3b;
    --right-3: #5a1d72;

    --card: rgba(255,255,255,.16);
    --stroke: rgba(255,255,255,.18);

    --accent: #6b46ff;
    --accent-2: #9b5cff;

    --radius: 18px;
    --shadow: 0 18px 60px rgba(0,0,0,.22);
    --shadow-soft: 0 14px 35px rgba(0,0,0,.16);

    /* intro */
    --left-ratio: 0%;
    --intro-dur: 1.5s;
    --intro-ease: cubic-bezier(.16, 1, .3, 1);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
    margin:0;
    font-family: "Mulish", sans-serif;
    color: var(--text);
    background: #0b0c10;
    overflow-x: hidden;
}

a{ color: inherit; text-decoration:none; }
button{ font: inherit; }

.page{
    min-height: 100vh;
    position:relative;
}

.container{
    width:min(1200px, calc(100% - 48px));
    margin:0 auto;
}

/* =========================
   HEADER
========================= */

.header{
    max-width: 960px;
    position:absolute;
    left:0; right:0;
    top:0;
    z-index: 50; /* above everything */
    padding: 50px 0;
    padding-left: 150px;
}
.header__inner{
    display:flex;
    align-items:center;
    gap: 140px;
    margin: 0;
}
.logo{
    font-weight: 900;
    letter-spacing: -0.03em;
    font-size: 32px;
    color: #212122;
}
.logo span{ color: var(--accent); }

.nav{
    display:flex;
    gap: 28px;
    font-weight: 700;
    font-size: 16px;
    opacity: .9;
}
.nav a{
    position:relative;
    padding: 8px 4px;
}
.nav a::after{
    content:"";
    position:absolute;
    left:4px; right:4px;
    bottom:2px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: .22s ease;
}
.nav a:hover::after{ transform: scaleX(1); }

.burger{
    display:none;
    width:44px; height:44px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor:pointer;
}
.burger span{
    display:block;
    height: 2px;
    background: #161722;
    margin: 6px 10px;
    border-radius: 999px;
}

.mobile-nav{
    position:absolute;
    top: 74px;
    right: 24px;
    width: 220px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    z-index: 60;
}
.mobile-nav a{
    display:block;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 600;
}
.mobile-nav a:hover{
    background: rgba(0,0,0,.06);
}

/* =========================
   HERO + INTRO OVERLAY
========================= */

.hero{
    min-height: 100vh;
    display:flex;
    align-items: stretch;
    position:relative;
    overflow:hidden;
    z-index: 1;
}

/* Шторка: спочатку накриває весь hero, потім стискається вліво */
.hero::before{
    content:"";
    position:absolute;
    inset:0;
    z-index: 10; /* above hero blocks, below header/scroll */
    background: #fff;
    transform-origin: left center;
    transform: scaleX(1);
    pointer-events: none;
    will-change: transform;
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

/* Вмикаємо shrink */
.is-intro .hero::before{
    animation: heroLeftShrink var(--intro-dur) var(--intro-ease) forwards;
}
@keyframes heroLeftShrink{
    to{
        transform: scaleX(calc(var(--left-ratio) / 100));
    }
}

.hero__inner{
    display:grid;
    grid-template-columns: 1.02fr .98fr;
    width:100%;
    min-height: 100vh;
}

/* Робимо контент вище за “базу”, але нижче за шторку */
.hero__left,
.hero__right{
    position:relative;
    z-index: 5;
}

/* Лівий блок */
.hero__left{
    padding: 0;
    background: radial-gradient(1200px 600px at 20% 40%, rgba(155,92,255,.22), transparent 60%),
    linear-gradient(180deg, #f0f0f2, #e7e8eb);
    border-right: 1px solid rgba(0,0,0,.06);
    display:flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 150px;
}
.hero__left > *{
    width:min(560px, 100%);
}

/* Правий блок: спочатку темна база, градієнт проявляється псевдоелементом */
.hero__right{
    display:flex;
    flex-direction: column;
    gap: 25px;
    justify-content: center;
    align-items: center;
    background: #0b0c10;
    overflow: hidden; /* важливо для blobs/parallax */
}

/* Градієнтний фон на правій частині */
.hero__right::before{
    content:"";
    position:absolute;
    inset:0;
    z-index: 0;
    opacity: 0;
    transform: scale(1.02);
    background:
            radial-gradient(800px 520px at 55% 25%, rgba(178,72,255,.38), transparent 60%),
            radial-gradient(1000px 720px at 60% 70%, rgba(113,80,255,.26), transparent 62%),
            linear-gradient(180deg, var(--right-1), #1a1027 45%, #0c0d13);
    will-change: opacity, transform;
}

/* Після shrink — проявляємо правий градієнт */
.is-intro .hero__right::before{
    animation: rightGradientIn 900ms var(--intro-ease) forwards;
    animation-delay: 650ms;
}
@keyframes rightGradientIn{
    to{
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================
   TYPOGRAPHY
========================= */

.h1{
    margin: 0 0 30px 0;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.95;
    font-size: 48px;
}
.lead{
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.45;
    color: var(--muted);
    max-width: 520px;
    font-weight: 600;
}
.micro{
    margin: 0 0 30px 0;
    font-size: 12px;
    color: rgba(18,19,22,.62);
    font-weight: 600;
}

.chips{
    max-width: 800px;
    width: 100%;
    display:flex;
    gap: 20px;
    margin: 0 0 30px 0;
    font-size: 12px;
    color: rgba(18,19,22,.78);
}
.chip{
    display:flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
}
.dot{
    width:10px;
    height:10px;
    border-radius: 999px;
    background: #490CA7;
    box-shadow: 0 0 0 4px rgba(73, 12, 167, 0.15);
}

.actions{
    display:flex;
    gap: 14px;
    align-items:center;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 14px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    will-change: transform;
    white-space: nowrap;
}

.btn--primary{
    color: #fff;
    background: #1a1c26;
    box-shadow: 0 16px 36px rgba(0,0,0,.22);
}
.btn--primary:hover{
    transform: translateY(-2px);
    box-shadow: 0 20px 46px rgba(0,0,0,.28);
}
.btn--primary:active{ transform: translateY(0px) scale(.99); }

.btn--ghost{
    color: rgba(0,0,0,.82);
}
.btn--ghost:hover{
    transform: translateY(-2px);
    background: rgba(0,0,0,.06);
}

/* Правий текст має бути над фоном */
.tagline,
.big{
    position: relative;
    z-index: 2;
    user-select: none;
}

.tagline{
    width:min(560px, 100%);
    font-weight: 700;
    letter-spacing: .22em;
    font-size: 30px;
    opacity: .9;
    color: #fff;
}

.big{
    width:min(560px, 100%);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: .81;
    font-size: 140px;
    text-shadow: 0 18px 80px rgba(0,0,0,.30);
    color: #fff;
}

/* Scroll button */
.scroll{
    position:absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: rgba(255,255,255,.65);
    border: 1px solid rgba(0,0,0,.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display:grid;
    place-items:center;
    box-shadow: var(--shadow-soft);
    z-index: 55; /* above intro overlay */
}
.scroll span{
    font-size: 18px;
    transform: translateY(1px);
}

/* =========================
   SECTIONS / FOOTER
========================= */

.section{
    padding: 90px 0;
    color:#fff;
}
.section h2{ margin:0 0 12px; font-size: 34px; }
.section p{ margin:0; opacity:.85; max-width: 700px; }

.footer{
    padding: 36px 0 60px;
    color: rgba(255,255,255,.62);
}

/* =========================
   BACKGROUND BLOBS (RIGHT)
========================= */

.bg{
    height: 100vh;
    position:absolute;
    inset:0;
    pointer-events:none;
    z-index: 1; /* above right gradient, below text */
    overflow:hidden;
}

/* grain */
.bg__grain{
    width: 100%;
    position:absolute;
    inset:0;
    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='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
    opacity: .18;
    mix-blend-mode: overlay;
}

/* base blob state: hidden until intro */
.blob{
    position:absolute;
    opacity: 0;
    filter: blur(10px);
    transform: translate3d(80px, 40px, 0) scale(.92);
    will-change: transform, opacity, filter;
    user-select:none;
}

/* positions only (NO animation here to avoid conflicts) */
.blob--1{
    width: 591px;
    left: -10%;
    top: 0%;
}
.blob--2{
    width: 330px;
    left: 55%;
    top: 0%;
}
.blob--3{
    width: 740px;
    left: 33%;
    top: 13%;
}
.blob--4{
    width: 1304px;
    left: -27%;
    top: 36%;
}

/* intro: blob fly-in, then float (float starts later) */
.is-intro .blob--1{
    animation: blobIn 900ms var(--intro-ease) forwards,
    blobFloat1 12s ease-in-out infinite;
    animation-delay: 1100ms, 2000ms;
}
.is-intro .blob--2{
    animation: blobIn 900ms var(--intro-ease) forwards,
    blobFloat2 16s ease-in-out infinite;
    animation-delay: 1200ms, 2100ms;
}
.is-intro .blob--3{
    animation: blobIn 1000ms var(--intro-ease) forwards,
    blobFloat3 18s ease-in-out infinite;
    animation-delay: 1300ms, 2200ms;
}
.is-intro .blob--4{
    animation: blobIn 1100ms var(--intro-ease) forwards,
    blobFloat4 22s ease-in-out infinite;
    animation-delay: 1400ms, 2300ms;
}

@keyframes blobIn{
    to{
        opacity: .95;
        filter: blur(.2px);
        transform: translate3d(0,0,0) scale(1);
    }
}

/* float: subtle drift */
@keyframes blobFloat1{
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(18px, -14px, 0) scale(1.04); }
}
@keyframes blobFloat2{
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(-22px, 10px, 0) scale(1.03); }
}
@keyframes blobFloat3{
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(26px, 18px, 0) scale(1.05); }
}
@keyframes blobFloat4{
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(-28px, -16px, 0) scale(1.03); }
}

/* =========================
   REVEAL (SOFT)
========================= */

.reveal{
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    filter: blur(10px);
    will-change: transform, opacity, filter;
}

[data-reveal="fade-down"]{
    transform: translate3d(0, -14px, 0);
}

[data-reveal="fade-in"]{
    transform: none;
}

.is-ready .reveal{
    animation: revealSoft 950ms var(--intro-ease) forwards;
    animation-delay: var(--d, 0ms);
}

@keyframes revealSoft{
    to{
        opacity:1;
        transform: translate3d(0,0,0);
        filter: blur(0);
    }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px){
    .hero__inner{ grid-template-columns: 1fr; }
    .hero__left{
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,.08);
        padding: 120px 0 54px;
        padding-left: 28px;
    }
    .header{
        padding-left: 28px;
    }
    .hero__right{
        padding: 70px 0 90px;
    }
    .tagline, .big{
        width: min(560px, 100%);
    }
    .scroll{ bottom: 12px; }
    .nav{ display:none; }
    .burger{ display:inline-block; }

    /* blobs adapt */
    .blob--1, .blob--2, .blob--3, .blob--4{
        left: 10% !important;
    }
}

@media (max-width: 520px){
    .container{ width: min(1200px, calc(100% - 28px)); }
    .actions{ flex-direction: column; align-items: stretch; }
    .btn{ width: 100%; }
    .header__inner{ gap: 16px; justify-content: space-between; }
}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce){
    .hero::before,
    .hero__right::before{
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .blob{
        animation: none !important;
        opacity: .9 !important;
        filter: blur(.2px) !important;
        transform: none !important;
    }
    .is-ready .reveal{
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
    .btn{ transition:none; }
}
