/* ===========================================================
   RESET & BASE
=========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background: #f6f8ff;
    color: #20242f;
}

body {
    position: relative;
}

/* ===========================================================
   BACKGROUND & MESH
=========================================================== */

#background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 40%, #edf4ff 100%);
    z-index: -20;
}

/* Animated Mesh Layer */
#background::before {
    animation: aurora 28s ease-in-out infinite alternate;
    content: "";
    position: absolute;
    width: 180%;
    height: 180%;
    left: -40%;
    top: -40%;
    background: 
        radial-gradient(circle, #8d72ff 0%, transparent 32%),
        radial-gradient(circle, #4fc3ff 0%, transparent 30%),
        radial-gradient(circle, #ff7bc1 0%, transparent 26%),
        radial-gradient(circle, #ffe46b 0%, transparent 18%);
    background-size: 40% 40%, 38% 38%, 35% 35%, 30% 30%;
    background-position: 10% 10%, 85% 15%, 20% 85%, 80% 80%;
    opacity: 0.22;
    filter: blur(70px);
    will-change: transform;
}

/* ===========================================================
   BLOBS
=========================================================== */

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(85px);
    opacity: 0.45;
    will-change: transform;
}

.blob1 { width: 420px; height: 420px; background: #7c5cff; left: -120px; top: -100px; }
.blob2 { width: 360px; height: 360px; background: #00c8ff; right: -120px; top: 120px; }
.blob3 { width: 340px; height: 340px; background: #ff7cb2; left: 25%; bottom: -120px; }
.blob4 { width: 300px; height: 300px; background: #ffe25d; right: 18%; bottom: -100px; }
.blob5 { width: 260px; height: 260px; background: #79d7ff; left: 60%; top: 50%; }
.blob6 { width: 250px; height: 250px; background: #9d7dff; left: 45%; top: 10%; }

/* ===========================================================
   NOISE & PARTICLES
=========================================================== */

#noise {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background-image: radial-gradient(#000 1px, transparent 1px);
    background-size: 7px 7px;
}

#particles,
#particleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===========================================================
   PROGRESS
=========================================================== */

#progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: #e5e9f2;
    z-index: 999;
}

#progressBar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00c8ff, #7c5cff, #ff4e71);
}

/* ===========================================================
   STAGE & SCENE (3D CAMERA SETUP)
=========================================================== */

#stage {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    perspective: 1800px;
    transform-style: preserve-3d;
}

.scene {
    width: 92%;
    max-width: 1450px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 70px;
    transform-style: preserve-3d;
}

/* ===========================================================
   LEFT CONTENT
=========================================================== */

.content {
    width: 42%;
    z-index: 5;
}

.series {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ff5165;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.content h1 {
    margin-top: 35px;
    font-size: 78px;
    line-height: 1;
    font-weight: 800;
}

.content h1 span {
    display: inline-block;
    margin-right: 10px;
}

.content h2 {
    margin-top: 18px;
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(90deg, #00bfff, #7c5cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content p {
    margin-top: 26px;
    font-size: 24px;
    line-height: 1.7;
    color: #61697d;
}

/* ===========================================================
   WORKSPACE & WINDOW
=========================================================== */

.workspace {
    width: 58%;
    display: flex;
    justify-content: center;
    transform-style: preserve-3d;
}

.window {
    transform-style: preserve-3d;
    will-change: transform;
    box-shadow: 
        0 35px 80px rgba(34, 44, 80, 0.12),
        0 80px 180px rgba(34, 44, 80, 0.14),
        0 120px 250px rgba(0, 0, 0, 0.10);
}

/* ===========================================================
   HEADER
=========================================================== */

.window-header {
    height: 72px;
    background: #fbfcff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #edf1f8;
}

.traffic {
    display: flex;
    gap: 10px;
}

.traffic span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.red { background: #ff5f57; }
.yellow { background: #febc2e; }
.green { background: #28c840; }

.title {
    font-weight: 700;
    color: #6e59ff;
}

.actions {
    display: flex;
    gap: 12px;
}

.actions button {
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    background: #edf1fb;
    font-weight: 600;
    cursor: pointer;
}

.actions .primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #7c5cff, #00c8ff);
    color: #fff;
}

/* ===========================================================
   BODY & SIDEBAR
=========================================================== */

.window-body {
    display: flex;
    height: 620px;
}

.sidebar {
    width: 270px;
    background: #f8faff;
    border-right: 1px solid #edf1f8;
    padding: 28px;
}

.logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #7c5cff, #00c8ff);
    color: #fff;
    font-weight: 700;
    margin-bottom: 30px;
}

.nav {
    padding: 13px 18px;
    border-radius: 14px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #61697d;
    transition: 0.3s;
}

.nav.active {
    background: #fff;
    color: #7c5cff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* ===========================================================
   TEMPLATE CARDS
=========================================================== */

.templates {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.template {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.template.selected {
    outline: 3px solid #7c5cff;
}

.thumb {
    width: 72px;
    height: 72px;
    border-radius: 16px;
}

.purple { background: linear-gradient(135deg, #7c5cff, #9c8cff); }
.blue { background: linear-gradient(135deg, #00bfff, #73d8ff); }
.pink { background: linear-gradient(135deg, #ff6ea9, #ff9cc9); }

.info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.line {
    height: 10px;
    border-radius: 99px;
    background: #edf1f8;
}

.w80 { width: 80%; }
.w75 { width: 75%; }
.w70 { width: 70%; }
.w50 { width: 50%; }
.w40 { width: 40%; }
.w30 { width: 30%; }

/* ===========================================================
   EDITOR & CANVAS
=========================================================== */

.editor {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f4f8ff;
}

.canvas {
    width: 560px;
    height: 370px;
    background: #fff;
    border-radius: 26px;
    padding: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.08);
    transform-style: preserve-3d;
}

.hero-image {
    width: 100%;
    height: 170px;
    border-radius: 18px;
    background: linear-gradient(135deg, #7c5cff, #00c8ff, #ff6fb4);
    background-size: 220% 220%;
    position: relative;
    overflow: hidden;
}

.hero-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.18), transparent, rgba(255, 255, 255, 0.12));
    mix-blend-mode: screen;
}

/* ===========================================================
   CURSOR & INTERACTION EFFECTS
=========================================================== */

#cursor {
    position: absolute;
    width: 22px;
    height: 30px;
    left: 0;
    top: 0;
    background: #20242f;
    clip-path: polygon(0 0, 100% 72%, 62% 72%, 74% 100%, 60% 100%, 46% 75%, 0 100%);
    z-index: 1000;
    pointer-events: none;
    will-change: transform;
}

.click-ripple {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #7c5cff;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px rgba(124, 92, 255, 0.45);
}

/* ===========================================================
   DOWNLOAD COMPONENTS
=========================================================== */

.download-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 0;
    border-radius: 999px;
    background: #ffffff;
}

.download-file {
    position: fixed;
    width: 120px;
    height: 150px;
    background: #ffffff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #7c5cff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    pointer-events: none;
}

/* ===========================================================
   WEBSITE SCENE
=========================================================== */

#websiteScene {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

#websiteScene .browser {
    width: 1200px;
    height: 700px;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.18);
}

.browser-top {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: #f7f8fc;
    border-bottom: 1px solid #eceff6;
}

.dots {
    display: flex;
    gap: 8px;
}

.dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d6dae5;
}

.address {
    margin-left: 25px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #ffffff;
    font-size: 14px;
    color: #666666;
}

.website header {
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
}

.website nav {
    display: flex;
    gap: 35px;
    font-weight: 600;
    color: #555555;
}

.hero {
    padding: 60px;
    text-align: center;
}

.hero-image-big {
    height: 280px;
    border-radius: 20px;
    background: linear-gradient(135deg, #7c5cff, #00c8ff, #ff6fb4);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
}

.hero p {
    margin-top: 18px;
    font-size: 22px;
    color: #666666;
}

.hero button {
    margin-top: 35px;
    padding: 18px 40px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c5cff, #00c8ff);
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
}

/* ===========================================================
   COMMERCIAL ENDING & LIGHT EFFECTS
=========================================================== */

#endingMessage {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 99999;
    pointer-events: none;
}

#endingMessage h1 {
    font-size: 64px;
    font-weight: 800;
    color: #222222;
    margin-bottom: 18px;
}

#endingMessage h2 {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(90deg, #00c8ff, #7c5cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lightSweep {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    z-index: 99998;
}

.spark {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 20px #ffffff, 0 0 45px #7c5cff;
    pointer-events: none;
    z-index: 99997;
}

/* ===========================================================
   KEYFRAMES
=========================================================== */

@keyframes aurora {
    0% {
        transform: translate(-3%, -2%) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(2%, -3%) rotate(6deg) scale(1.08);
    }
    50% {
        transform: translate(4%, 3%) rotate(-4deg) scale(1.12);
    }
    75% {
        transform: translate(-2%, 4%) rotate(5deg) scale(1.05);
    }
    100% {
        transform: translate(-4%, -3%) rotate(-6deg) scale(1);
    }
}

/* ===========================================================
   MEDIA QUERIES
=========================================================== */

@media (max-width: 1200px) {
    .scene {
        flex-direction: column;
        justify-content: center;
    }

    .content,
    .workspace {
        width: 100%;
    }

    .content {
        text-align: center;
    }

    .window {
        width: 100%;
    }

    .content h1 {
        font-size: 58px;
    }

    .content h2 {
        font-size: 34px;
    }

    .window-body {
        height: auto;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .canvas {
        width: 90%;
        margin: 40px 0;
    }
}