:root {
    --bg: rgb(15, 23, 43);
    --panel: #1e293b;
    --accent-a: rgb(112, 218, 254);
    --accent-b: rgb(37, 85, 101);
    --muted: #cbd5e1;
}

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0
}

html,
body {
    height: 100%
}

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--bg);
    color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header / Nav (fixed) ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(15, 23, 43, 0.95), rgba(15, 23, 43, 0.95));
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
}

.container-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, var(--accent-a), var(--accent-b));
    color: #022
}

.text-logo {
    font-weight: 600;
    letter-spacing: 0.4px
}

/* Nav links */
.nav-list {
    list-style: none;
    display: flex;
    gap: 22px;
    align-items: center
}

.nav-list .nav-link {
    color: #fff;
    text-decoration: none;
    text-transform: capitalize;
    font-weight: 500;
    opacity: 0.95;
    transition: transform .25s, color .2s
}

.nav-list .nav-link:hover {
    transform: translateY(-4px);
    color: var(--accent-a)
}

.nav-list .nav-link.active {
    color: var(--accent-a);
    text-shadow: 0 6px 18px rgba(56, 189, 248, 0.12)
}

/* nav actions */
.nav-actions .btn-nav {
    background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
    border-radius: 6px;
    padding: 8px 14px;
    color: #fff;
    border: none;
    cursor: pointer
}

/* ===== Content wrapper (below header) ===== */
#content {
    position: relative;
    margin-top: 74px;
    /* space for fixed header */
    min-height: calc(100vh - 74px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 60px;
}

/* ===== Page (stacked, animated) ===== */
.page {
    position: absolute;
    inset: 0 0 0 0;
    padding: 48px 40px;
    overflow: auto;
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(.22, .9, .3, 1), opacity 0.55s ease;
    will-change: transform, opacity;
    -webkit-overflow-scrolling: touch;
}

/* When a page is active (slides in from left) */
.page.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* When page exits to right */
.page.exit-right {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Each page can style its internals (so layout preserved) */

/* ===== Home ===== */
#home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4%
}

#home .text-main {
    flex: 1;
    color: white;
    text-align: left;
    max-width: 60%
}

.animated-title {
    font-size: 44px;
    font-weight: 600;
    text-transform: capitalize;
    display: flex;
    gap: 12px;
    /* مسافة بين الكلمات */
}

.animated-title span {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s forwards;
}

.animated-title span:nth-child(1) {
    animation-delay: 0.3s;
}

.animated-title span:nth-child(2) {
    animation-delay: 0.8s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



#home p {
    color: rgba(240, 248, 255, 0.78);
    line-height: 1.6
}

.btns {
    display: flex;
    gap: 18px;
    margin-top: 24px
}

.btns button {
    width: 160px;
    height: 44px;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    border: none
}

.btn-one {
    background: linear-gradient(90deg, var(--accent-a), var(--accent-b))
}

#btn-two {
    background: linear-gradient(90deg, rgb(38, 46, 71), var(--accent-b))
}

/* image circle */
.img-main {
    flex: 0 0 300px;
    height: 300px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 50px rgba(55, 81, 115, 0.6);
    overflow: hidden
}

.img-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

/* ===== Skills ===== */
.section-title {
    font-size: 28px;
    color: var(--accent-a);
    margin-bottom: 10px
}

.section-sub {
    color: var(--muted);
    margin-bottom: 28px
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 22px;
    align-items: stretch
}

.skill-box {
    background: linear-gradient(145deg, #22324b, #0f172a);
    border-radius: 12px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5), -6px -6px 18px rgba(255, 255, 255, 0.02);
    transform-style: preserve-3d;
    transition: transform .35s ease, box-shadow .35s
}

.skill-box i {
    font-size: 32px;
    color: var(--accent-a)
}

.skill-box h3 {
    font-size: 16px
}

.skill-box:hover {
    transform: translateY(-10px) rotateX(8deg) rotateY(8deg) scale(1.04);
    box-shadow: 18px 18px 36px rgba(0, 0, 0, 0.6), -18px -18px 36px rgba(255, 255, 255, 0.02)
}

/* ===== Projects (3D cubes) ===== */
.projects-container {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center
}

.project-cube {
    perspective: 1100px;
    width: 320px;
    height: 220px
}

.project-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .9s cubic-bezier(.22, .9, .3, 1)
}

.project-cube:hover .project-inner {
    transform: rotateY(180deg)
}

.project-front,
.project-back {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    backface-visibility: hidden;
    overflow: hidden;
    box-shadow: 10px 10px 28px rgba(0, 0, 0, 0.6), -8px -8px 24px rgba(255, 255, 255, 0.03)
}

.project-front img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.project-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    transform: rotateY(180deg);
    color: #fff
}

.project-back h3 {
    margin-bottom: 12px
}

.project-back a {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--accent-a), #6366f1);
    text-decoration: none;
    color: #022
}

/* ===== Trainings ===== */
.trainings-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 900px;
    margin: 0 auto
}

.training-box {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: var(--panel);
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(-20px);
    animation: slideIn .6s ease forwards
}

.training-box i {
    font-size: 28px;
    color: var(--accent-a);
    min-width: 46px
}

.training-text h3 {
    margin-bottom: 6px;
    color: #e6e6e6
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

/* ===== Contact ===== */
.contact {
    min-height: calc(100vh - 74px);
    text-align: center;
    padding-top: 40px
}

.page h2,
p {
    text-align: center;
    padding: 2% 0%;
}

.container-contact {
    width: 520px;
    max-width: 92%;
    margin: 22px auto;
    text-align: center;
    padding: 22px;
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6)
}

.container-contact p {
    color: var(--muted);
    margin: 12px 0;
    font-size: 1rem
}

.container-contact a {
    color: #fff;
    text-decoration: none
}

.social {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 10px;
    margin-top: 10px
}

.social a {
    margin: 0 12px;
    color: #9aa3b2;
    font-size: 20px
}

.container-contact .btn-nav {
    background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
    border-radius: 6px;
    padding: 8px 14px;
    color: #fff;
    border: none;
    margin-top: 10px;
    cursor: pointer
}

/* small screens */
@media (max-width:900px) {
    #home {
        flex-direction: column;
        align-items: center;
        padding: 28px 22px
    }

    #home .text-main {
        max-width: 100%;
        text-align: center
    }

    .img-main {
        margin-top: 18px;
        flex: 0 0 220px;
        height: 220px
    }

    .nav-list {
        display: none
    }

    /* simplify nav on small screens (you can add burger later) */
}

/* Burger hidden on large screens */
.burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: white;
    cursor: pointer;
}

/* Responsive (mobile) */
@media (max-width: 900px) {
    nav {
        justify-content: space-between;
    }

    .burger {
        display: block;
    }

    .text-logo {
        margin-left: auto;
        font-weight: 600;
    }

    .nav-actions {
        display: none;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 74px;
        /* height of header */
        left: 0;
        width: 100%;
        background: var(--bg);
        padding: 20px;
        gap: 16px;
    }

    .nav-list.show {
        display: flex;
    }

    #home {
        flex-direction: column;
        text-align: center;
    }

    .animated-title {
        font-size: 30px;
        font-weight: 600;

    }

    #home .img-main {
        order: -1;
        /* يخلي الصورة تيجي قبل النص */
        margin-bottom: 20px;
    }

    #home .text-main {
        max-width: 100%;
        text-align: center;
    }
}