:root {
    --gold: #C5A059;
    --gold-bright: #E2C27D;
    --gold-dim: rgba(197, 160, 89, 0.15);
    --black: #0A0A0A;
    --black-soft: #141414;
    --black-card: #1a1a1a;
    --white: #F5F5F5;
    --text-muted: #E0E0E0;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Outfit', sans-serif;
}

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

html {
    scroll-behavior: initial;
}

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-ar);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

/* ═══ ENHANCED LOADER ═══ */
.loader-wrapper {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #141414 0%, #0A0A0A 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-content {
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.loader-progress-container {
    width: 100%;
    height: 2px;
    background: rgba(197, 160, 89, 0.1);
    margin-top: 30px;
    border-radius: 4px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
    box-shadow: 0 0 15px var(--gold);
}

/* ═══ PHARAOH MASK CURSOR ═══ */
.custom-cursor {
    width: 36px;
    height: 48px;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transition: transform 0.15s ease-out, opacity 0.3s;
    filter: drop-shadow(0 0 8px rgba(197, 160, 89, 0.6));
    top: 0;
    left: 0;
}

.custom-cursor img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cursor-ring {
    width: 50px;
    height: 50px;
    border: 1.5px solid var(--gold);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    opacity: 0.4;
    transition: transform 0.2s ease-out, opacity 0.3s, width 0.3s, height 0.3s, border-color 0.3s;
    top: 0;
    left: 0;
}

.cursor-ring.active {
    width: 70px;
    height: 70px;
    opacity: 0.2;
    border-color: var(--gold-bright);
}

.custom-cursor.active {
    transform: scale(1.2);
}

a,
button,
.civ-card,
.king-card,
.achievement-row,
.btn-primary,
.lang-switch,
.god-card,
.gallery-item {
    cursor: none;
}

/* ═══ TYPOGRAPHY ═══ */
h1,
h2,
h3 {
    font-weight: 900;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.subtitle {
    color: var(--gold);
    font-family: var(--font-en);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 700;
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.section-title {
    margin-bottom: 1rem;
}

/* ═══ NAVBAR ═══ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 1rem 5%;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(14px);
}

.logo {
    font-family: var(--font-en);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.logo span {
    color: var(--gold);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.lang-switch {
    font-family: var(--font-en);
    border: 1px solid var(--gold);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.lang-switch:hover {
    background: var(--gold);
    color: var(--black);
}

/* ═══ SECTIONS ═══ */
.section {
    padding: 8rem 5%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ═══ HERO ═══ */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.45);
}

.hero-bg .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(transparent, var(--black));
}

.hero-content {
    text-align: center;
    z-index: 10;
}

.hero-content h1 {
    font-size: clamp(2.8rem, 9vw, 7.5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-content h1 span {
    display: block;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--gold);
}

.hero-content p {
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--gold);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--gold);
    border-radius: 50%;
    animation: scrollAnim 2s infinite;
}

@keyframes scrollAnim {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 18px);
        opacity: 0;
    }
}

/* ═══ CIV GRID ═══ */
.civ-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 4rem;
}

.civ-card {
    background: var(--black-soft);
    padding: 2.5rem;
    border: 1px solid rgba(197, 160, 89, 0.08);
    position: relative;
    overflow: hidden;
    /* نلغي الـ transition هنا لأن GSAP سيتولى الأنميشن */
    transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.civ-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: var(--transition);
}

.civ-card:hover {
    border-color: var(--gold);
    transform: translateY(-8px);
}

.civ-card:hover::before {
    width: 100%;
}

.card-icon {
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 900;
    color: rgba(197, 160, 89, 0.15);
    margin-bottom: 1.5rem;
}

.civ-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--gold);
}

.civ-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 1;
    visibility: visible;
}

/* ═══ HISTORY TIMELINE ═══ */
.history-timeline {
    width: 100%;
    overflow: hidden;
    background: var(--black-soft);
    padding: 8rem 0;
}

.timeline-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 0 5%;
}

.timeline-wrapper {
    width: 100%;
}

.timeline-container {
    display: flex;
    padding: 0 5%;
    gap: 70px;
    width: max-content;
}

.timeline-item {
    width: 380px;
    flex-shrink: 0;
    position: relative;
    padding-top: 45px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% + 70px);
    height: 1px;
    background: rgba(197, 160, 89, 0.2);
}

.timeline-item:last-child::before {
    width: 100%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 0;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(197, 160, 89, 0.5);
}

.timeline-item .year {
    font-family: var(--font-en);
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.timeline-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.timeline-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ═══ KINGS ═══ */
.kings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 4rem;
}

.king-card {
    background: var(--black-card);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
    text-align: center;
    transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.king-card:hover {
    border-color: var(--gold);
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(197, 160, 89, 0.08);
}

.king-icon {
    font-size: 3rem;
    margin-bottom: 1.2rem;
    display: block;
}

.king-card h3 {
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.king-card .king-title {
    font-size: 0.8rem;
    color: var(--gold-bright);
    margin-bottom: 1rem;
    display: block;
    opacity: 0.7;
}

.king-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ═══ GODS ═══ */
.gods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 4rem;
}

.god-card {
    background: var(--black-card);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid transparent;
    text-align: center;
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.god-card:hover {
    border-color: var(--gold);
    transform: translateY(-6px);
}

.god-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.god-card h3 {
    font-size: 1.15rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.god-card .god-role {
    font-size: 0.8rem;
    color: var(--gold-bright);
    margin-bottom: 0.8rem;
    display: block;
    opacity: 0.7;
}

.god-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.7;
}

/* ═══ NILE ═══ */
.nile-layout {
    display: flex;
    gap: 3%;
    align-items: flex-start;
    margin-top: 4rem;
    flex-wrap: wrap;
}

.nile-text {
    flex: 1.2;
    min-width: 300px;
}

.nile-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.nile-visual {
    flex: 0.8;
    min-width: 280px;
}

.nile-visual .img-wrapper {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.nile-visual img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: none;
}

.nile-facts {
    flex: 1 1 280px;
    min-width: 280px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.nile-fact-card {
    background: var(--black-card);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(197, 160, 89, 0.08);
    width: 100%;
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.nile-fact-card:hover {
    border-color: var(--gold);
}

.nile-fact-card .big-num {
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold);
    display: block;
}

.nile-fact-card span:last-child {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══ ACHIEVEMENTS ═══ */
.achievements-list {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.achievement-row {
    display: flex;
    gap: 3rem;
    align-items: center;
    padding: 2.5rem;
    background: var(--black-card);
    border-radius: 10px;
    border-left: 3px solid var(--gold);
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.achievement-row:hover {
    transform: translateX(-5px);
    border-color: var(--gold-bright);
}

.achievement-number {
    font-family: var(--font-en);
    font-size: 4rem;
    font-weight: 900;
    color: rgba(197, 160, 89, 0.12);
    line-height: 1;
    flex-shrink: 0;
}

.achievement-content h3 {
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 0.6rem;
}

.achievement-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ═══ GEM ═══ */
.gem-container {
    display: flex;
    align-items: center;
    gap: 5%;
}

.gem-content {
    flex: 1;
}

.gem-content h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 1.5rem;
}

.gem-content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 600px;
    line-height: 1.8;
}

.gem-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.gem-fact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gem-fact .fact-icon {
    font-size: 1.1rem;
}

.gem-fact span:last-child {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.gem-visual {
    flex: 1.2;
    position: relative;
}

.img-wrapper {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.gem-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
}


/* ═══ HERITAGE ═══ */
.heritage-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 4rem;
    align-items: center;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 550px;
    object-fit: cover;
    transition: none;
}

.item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.gallery-content {
    padding-right: 40px;
}

.gallery-content p {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 3rem;
    line-height: 1.7;
}

.stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat .num {
    font-family: var(--font-en);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--gold);
}

.stat .label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ═══ BUTTONS ═══ */
.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--gold);
    color: var(--black);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--gold-bright);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(197, 160, 89, 0.25);
}

/* ═══ FOOTER ═══ */
.footer {
    padding: 4rem 5%;
    border-top: 1px solid rgba(197, 160, 89, 0.1);
    text-align: center;
}

.footer-logo {
    font-family: var(--font-en);
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.footer-logo span {
    color: var(--gold);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 968px) {
    .navbar {
        padding: 1rem 5%;
    }

    .nav-links {
        display: none;
    }

    .gem-container,
    .nile-layout {
        flex-direction: column;
    }

    .gem-content p {
        margin: 0 auto 1.5rem;
    }

    .gem-facts {
        grid-template-columns: 1fr;
    }

    .heritage-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-content {
        padding-right: 0;
        order: -1;
    }

    .stats {
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .timeline-item {
        width: 280px;
    }

    .achievement-row {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        border-left: none;
        border-top: 3px solid var(--gold);
    }

    .nile-facts {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .custom-cursor,
    .cursor-ring {
        display: none !important;
    }

    body {
        cursor: auto;
    }

    a,
    button,
    .civ-card,
    .king-card,
    .achievement-row,
    .btn-primary,
    .lang-switch,
    .god-card,
    .gallery-item {
        cursor: auto;
    }
}

/* إصلاح شامل للموبايل */
html,
body {
    overflow-x: hidden;
    width: 100%;
}

/* تابلت */
@media (max-width:768px) {

    .section {
        padding: 4rem 20px;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: 2.3rem;
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .civ-grid,
    .kings-grid,
    .gods-grid {
        grid-template-columns: 1fr;
    }

    .civ-card,
    .king-card,
    .god-card {
        padding: 1.5rem;
    }

    .achievement-row {
        padding: 1.5rem;
    }

    .gallery-item img {
        height: 320px;
    }

    .nile-visual img {
        height: 260px;
    }

    .timeline-item {
        width: 240px;
    }
}

/* موبايل صغير */
@media (max-width:480px) {

    .logo {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: .95rem;
    }

    .subtitle {
        letter-spacing: 2px;
        font-size: .75rem;
    }

    .timeline-item {
        width: 210px;
    }

    .stat .num {
        font-size: 2rem;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
        padding: 14px;
    }
}

/* ================= MOBILE PRO ================= */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 42px;
    height: 42px;
    cursor: pointer;
    position: relative;
    z-index: 3000;
}

.menu-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    margin: 8px 0;
    transition: .3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* tablet */
@media(max-width:968px) {

    .menu-toggle {
        display: block;
    }

    .navbar {
        padding: 16px 20px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: #111;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 28px;
        transition: .45s ease;
        z-index: 2500;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    .section {
        padding: 70px 20px;
    }

    .civ-grid,
    .kings-grid,
    .gods-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .timeline-container {
        gap: 25px;
    }

    .timeline-item {
        width: 230px;
    }

    .gallery-item img {
        height: 320px;
    }

    .nile-visual img {
        height: 260px;
    }

    .gem-container,
    .nile-layout,
    .heritage-gallery {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
    }
}

/* tiny phones */
@media(max-width:480px) {

    .logo {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    .hero-content h1 {
        font-size: 1.9rem;
    }

    .subtitle {
        letter-spacing: 2px;
        font-size: .7rem;
    }

    .timeline-item {
        width: 200px;
    }

    .stat .num {
        font-size: 2rem;
    }

    .loader-text {
        font-size: .9rem;
    }
}