/* === EXACT VARIABLES FROM SOURCE CSS === */
:root {
    --background: hsl(222, 47%, 6%);
    --foreground: hsl(40, 20%, 90%);
    --card: hsl(222, 40%, 9%);
    --secondary: hsl(222, 30%, 14%);
    --border: hsl(222, 25%, 16%);
    --muted-fg: hsl(220, 15%, 55%);
    --gold: hsl(43, 72%, 52%);
    --gold-light: hsl(43, 80%, 65%);
    --radius: 0.5rem;
    /* exact gradient stops from .gold-gradient in source */
    --gold-grad: linear-gradient(135deg, #9b7427, #e8b430, #f7d56e, #e8b430, #9b7427);
    /* exact gradient stops from .gold-text in source */
    --gold-tgrad: linear-gradient(135deg, #b88a2e, #edc55e, #f9dc86, #edc55e, #b88a2e);
    /* exact hover values from .hover\:gold-border and .hover\:gold-glow in source */
    --hover-border: #ddab2c4d;
    --hover-glow: 0 0 20px #ddab2c26, 0 0 40px #ddab2c0d;
}

/* === RESET === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    line-height: 1.5;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    padding-top: 70px;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    background: none;
    border: none;
}

img,
svg {
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.5;
}

ul {
    list-style: none;
}

/* === GOLD UTILS (exact source) === */
.gold-text {
    background: var(--gold-tgrad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === LAYOUT === */
.container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 2rem;
    padding-left: 2rem;
}

@media (min-width:1400px) {
    .container {
        max-width: 1400px;
    }
}

/* =========================================
       NAVBAR
    ========================================= */
#navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    min-height: 64px;
    transition: background-color .3s, border-bottom .3s, backdrop-filter .3s;
}

#navbar.scrolled {
    background-color: hsl(222, 47%, 6%, .9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

/* Logo — far right in RTL */
.nav-logo {
    display: flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-d {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gold-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 900;
    color: hsl(222, 47%, 6%);
    flex-shrink: 0;
}

.nav-logo-text {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: .07em;
    white-space: nowrap;
    display: block;
    margin-top: 0.4rem;
}

/* Center links */
.nav-links {
    display: flex;
    align-items: center;
    gap: .1rem;
    flex: 1;
    justify-content: center;
    margin-top: 25px;
    padding: 0;
}

.nav-links a {
    color: var(--muted-fg);
    font-size: .875rem;
    font-weight: 500;
    padding: .4rem .65rem;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: color .15s, background-color .15s;
}

.nav-links a:hover {
    color: var(--gold-light);
    background-color: hsl(222, 30%, 14%, .5);
}

/* CTA — far left in RTL */
.nav-cta {
    flex-shrink: 0;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-grad);
    color: hsl(222, 47%, 6%);
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: .9rem;
    padding: .5rem 1rem;
    border-radius: var(--radius);
    white-space: nowrap;
    cursor: pointer;
    transition: opacity .2s;
    padding: 0.6rem 1.2rem;
}

.btn-nav:hover {
    opacity: .88;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: .35rem;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--foreground);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: hsl(222, 47%, 6%, .97);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    color: var(--foreground);
    font-size: 1.35rem;
    font-weight: 700;
    background: none;
    border: none;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: color .2s;
}

.mobile-menu a:hover,
.mobile-menu .mm-btn:hover {
    color: var(--gold);
}

/* =========================================
       BUTTONS
    ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: none;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    border-radius: var(--radius);
    transition: opacity .2s, transform .15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(.97);
}

.btn-gold,.mobile-menu .btn-gold {
    background: var(--gold-grad);
    color: hsl(222, 47%, 6%);
    padding: 1rem 1.75rem;
    font-size: .875rem;
}

@media (min-width:768px) {
    .btn-gold {
        font-size: 1rem;
        padding: 1.2rem 2rem;
    }
}

.btn-gold:hover,.mobile-menu .btn-gold:hover {
    opacity: .9;
    color: hsl(222, 47%, 6%);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid hsl(43, 72%, 52%, .3);
    color: var(--gold);
    padding: 1rem 1.75rem;
    font-size: .875rem;
}

@media (min-width:768px) {
    .btn-outline {
        font-size: 1rem;
        padding: 1.2rem 2rem;
    }
}

.btn-outline:hover {
    background: hsl(43, 72%, 52%, .1);
    border-color: var(--gold);
}

/* =========================================
       SOCIAL SECTION
    ========================================= */
#social {
    padding-top: 3.5rem;
    padding-bottom: 0;
}

@media (min-width:768px) {
    #social {
        padding-top: 6rem;
        padding-bottom: .5rem;
    }
}

.social-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
}

@media (min-width:640px) {
    .social-row {
        gap: 1.25rem;
    }
}

.social-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background-color: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-fg);
    transition: color .3s, border-color .3s, box-shadow .3s;
}

@media (min-width:640px) {
    .social-btn {
        width: 56px;
        height: 56px;
    }
}

@media (min-width:768px) {
    .social-btn {
        width: 64px;
        height: 64px;
    }
}

.social-btn svg {
    width: 26px;
    height: 26px;
}

@media (min-width:768px) {
    .social-btn svg {
        width: 30px;
        height: 30px;
    }
}

.social-btn:hover {
    color: var(--gold);
    border-color: var(--hover-border);
    box-shadow: var(--hover-glow);
}

.social-tip {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .7rem;
    color: var(--muted-fg);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}

.social-btn:hover .social-tip {
    opacity: 1;
}

/* =========================================
       HERO
    ========================================= */
#hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2.5rem 0 1.5rem;
}

@media (min-width:768px) {
    #hero {
        min-height: 85vh;
        padding: 5rem 0 2.5rem;
    }
}

.hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(ellipse at center, hsl(43, 72%, 52%, .04) 0%, transparent 70%);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 10;
    padding-top: 2.5rem;
    width: 100%;
}

@media (min-width:768px) {
    .hero-content {
        padding-top: 5rem;
    }
}

.hero-h1 {
    font-size: 1.875rem;
    line-height: 1.5;
    font-weight: 900;
    margin-bottom: .75rem;
}

@media (min-width:768px) {
    .hero-h1 {
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }
}

@media (min-width:1024px) {
    .hero-h1 {
        font-size: 4.5rem;
    }
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--gold-light);
    font-weight: 500;
    margin-bottom: .75rem;
}

@media (min-width:768px) {
    .hero-sub {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.hero-body {
    color: var(--muted-fg);
    max-width: 48rem;
    margin: 0 auto 1.5rem;
    line-height: 1.625;
    font-size: .875rem;
}

@media (min-width:768px) {
    .hero-body {
        font-size: 1.125rem;
        margin-bottom: 2.5rem;
    }
}

.hero-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

@media (min-width:640px) {
    .hero-btns {
        flex-direction: row;
    }
}

@media (min-width:768px) {
    .hero-btns {
        margin-bottom: 2.5rem;
    }
}

.hero-free {
    font-size: 1.25rem;
    font-weight: 900;
    margin-top: 1.5rem;
}

@media (min-width:768px) {
    .hero-free {
        font-size: 1.875rem;
        margin-top: 2.5rem;
    }
}

/* =========================================
       STATS
    ========================================= */
#stats {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

@media (min-width:768px) {
    #stats {
        padding: 4rem 0;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width:1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    text-align: center;
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity .7s ease, transform .7s ease;
}

.stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: .5rem;
}

@media (min-width:768px) {
    .stat-value {
        font-size: 1.875rem;
    }
}

.stat-label {
    color: var(--muted-fg);
    font-size: .875rem;
    font-weight: 500;
}

/* =========================================
       ABOUT
    ========================================= */
#about {
    padding: 3.5rem 0;
}

@media (min-width:768px) {
    #about {
        padding: 5rem 0;
    }
}

.about-inner {
    max-width: 56rem;
    margin: 0 auto;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1.5rem;
}

@media (min-width:768px) {
    .section-title {
        font-size: 2.25rem;
        margin-bottom: 2.5rem;
    }
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--foreground);
    line-height: 1.625;
    font-size: .875rem;
    margin-bottom: 2.5rem;
}

@media (min-width:768px) {
    .about-text {
        font-size: 1.125rem;
    }
}

.about-cta {
    text-align: center;
}

.about-free {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 2rem;
}

@media (min-width:768px) {
    .about-free {
        font-size: 1.875rem;
    }
}

/* =========================================
       SERVICES
    ========================================= */
#services {
    padding: 3.5rem 0;
    background-color: hsl(222, 30%, 14%, .3);
}

@media (min-width:768px) {
    #services {
        padding: 5rem 0;
    }
}

.services-inner {
    max-width: 64rem;
    margin: 0 auto;
}

.section-subtitle {
    color: var(--muted-fg);
    text-align: center;
    max-width: 48rem;
    margin: 0 auto 2rem;
    line-height: 1.625;
    font-size: .875rem;
}

@media (min-width:768px) {
    .section-subtitle {
        font-size: 1.125rem;
        margin-bottom: 3.5rem;
    }
}

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

@media (min-width:640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width:768px) {
    .services-grid {
        gap: 1.5rem;
        margin-bottom: 3.5rem;
    }
}

.service-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--card);
    transition: border-color .3s, box-shadow .3s;
}

@media (min-width:768px) {
    .service-card {
        gap: 1rem;
        padding: 1.5rem;
    }
}

.service-card:hover {
    border-color: var(--hover-border);
    box-shadow: var(--hover-glow);
}

.svc-icon {
    color: var(--gold);
    flex-shrink: 0;
}

.svc-icon svg {
    width: 24px;
    height: 24px;
}

@media (min-width:768px) {
    .svc-icon svg {
        width: 32px;
        height: 32px;
    }
}

.svc-name {
    font-weight: 500;
    font-size: .875rem;
}

@media (min-width:768px) {
    .svc-name {
        font-size: 1rem;
    }
}

.services-free {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1.5rem;
}

@media (min-width:768px) {
    .services-free {
        font-size: 2.25rem;
        margin-bottom: 2.5rem;
    }
}

.services-cta {
    text-align: center;
}

/* =========================================
       PARTNERS
    ========================================= */
#partners {
    padding: 3.5rem 0;
    background-color: hsl(222, 30%, 14%, .3);
}

@media (min-width:768px) {
    #partners {
        padding: 5rem 0;
    }
}

.partners-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.partner-wrap {
    display: flex;
    justify-content: center;
}

.partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    border-radius: .75rem;
    border: 1px solid var(--border);
    background-color: var(--card);
    max-width: 24rem;
    width: 100%;
    text-align: center;
    text-decoration: none;
    color: var(--foreground);
    transition: border-color .3s, box-shadow .3s;
}

.partner-card:hover {
    border-color: var(--hover-border);
    box-shadow: var(--hover-glow);
}

.partner-logo {
    height: 4rem;
    width: 7rem;
    background: #000;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.xtb-wrap {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.xtb-x {
    background: #e63946;
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-family: Arial, sans-serif;
}

.xtb-tb {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    font-family: Arial, sans-serif;
}

.partner-name {
    font-weight: 700;
    font-size: 1.125rem;
}

.partner-desc {
    color: var(--muted-fg);
    font-size: .875rem;
    line-height: 1.625;
}

/* =========================================
       PORTFOLIO
    ========================================= */
#portfolio {
    padding: 3.5rem 0;
}

@media (min-width:768px) {
    #portfolio {
        padding: 5rem 0;
    }
}

.portfolio-inner {
    max-width: 56rem;
    margin: 0 auto;
}

.portfolio-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 2rem;
}

@media (min-width:768px) {
    .portfolio-list {
        gap: 1rem;
        margin-bottom: 3rem;
    }
}

.pf-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--card);
}

@media (min-width:768px) {
    .pf-item {
        gap: 1rem;
        padding: 1.25rem;
    }
}

.pf-icon {
    color: var(--gold);
    flex-shrink: 0;
}

.pf-icon svg {
    width: 20px;
    height: 20px;
}

@media (min-width:768px) {
    .pf-icon svg {
        width: 24px;
        height: 24px;
    }
}

.pf-text {
    font-size: .875rem;
    font-weight: 500;
}

@media (min-width:768px) {
    .pf-text {
        font-size: 1rem;
    }
}

.portfolio-cta {
    text-align: center;
    margin-bottom: 2rem;
}

@media (min-width:768px) {
    .portfolio-cta {
        margin-bottom: 2.5rem;
    }
}

.portfolio-disc {
    color: var(--muted-fg);
    font-size: .75rem;
    text-align: center;
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.625;
}

/* =========================================
       FOOTER
    ========================================= */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

@media (min-width:768px) {
    footer {
        padding: 3rem 0;
    }
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

@media (min-width:768px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: right;
    }
}

.footer-links-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: .75rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.footer-links a,
.footer-links button {
    color: var(--muted-fg);
    font-size: .875rem;
    font-family: 'Tajawal', sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    transition: color .15s;
    text-align: inherit;
}

.footer-links a:hover,
.footer-links button:hover {
    color: var(--gold);
}

.footer-copy {
    color: var(--muted-fg);
    font-size: .875rem;
}

@media (min-width:768px) {
    .footer-copy {
        text-align: left;
    }
}

/* =========================================
       MODAL
    ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .8);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: .75rem;
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
    position: relative;
    animation: modalIn .2s ease;
}

@media (min-width:768px) {
    .modal-box {
        max-width: 420px;
        padding: 2rem;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: var(--muted-fg);
    cursor: pointer;
    font-size: 1.1rem;
    padding: .25rem;
    transition: color .15s;
}

.modal-close:hover {
    color: var(--foreground);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: .35rem;
}

.modal-sub {
    color: var(--muted-fg);
    text-align: center;
    font-size: .875rem;
    margin-bottom: 1.5rem;
}

.modal-broker {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--secondary);
    text-decoration: none;
    color: var(--foreground);
    transition: border-color .2s, box-shadow .2s;
}

.modal-broker:hover {
    border-color: var(--hover-border);
    box-shadow: var(--hover-glow);
}

.modal-broker-logo {
    background: #000;
    border-radius: .25rem;
    padding: .4rem .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-broker-name {
    font-weight: 700;
    font-size: 1.125rem;
}

/* =========================================
       ANIMATIONS
    ========================================= */
.fade-up {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity .7s ease, transform .7s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
       RESPONSIVE — hide desktop nav on mobile
    ========================================= */
@media (max-width:767px) {
    .nav-links {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}