@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,500&family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --beige-light: #faf6f0;
    --beige-soft: #f2e8dc;
    --beige-warm: #e4d4c2;
    --sand-gold: #cbb49a;
    --brown-medium: #8c6a4f;
    --brown-rich: #5e422e;
    --brown-dark: #3b2618;
    --white-glass: rgba(255, 252, 248, 0.78);
    --border-soft: rgba(140, 106, 79, 0.22);
    --shadow-soft: 0 10px 30px rgba(59, 38, 24, 0.08);
    --shadow-hover: 0 18px 40px rgba(59, 38, 24, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Tajawal', sans-serif;
    color: var(--brown-dark);
    line-height: 1.75;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

main {
    padding-top: 64px;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        -45deg,
        #faf6f0,
        #efe2d1,
        #dec7ae,
        #c8ab8e,
        #f3e9dc
    );
    background-size: 400% 400%;
    animation: smoothGradientMove 18s ease-in-out infinite;
}

@keyframes smoothGradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* القائمة ثابتة دائماً في الأعلى أثناء السكرول */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(250, 246, 240, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 4px 20px rgba(59, 38, 24, 0.08);
    padding: 12px 16px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
}

.nav-buttons {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.nav-btn {
    display: inline-block;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--brown-dark);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), var(--beige-soft));
    border: 1px solid var(--border-soft);
    padding: 6px 14px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(59, 38, 24, 0.04);
}

.nav-btn:hover,
.nav-btn:focus {
    background: linear-gradient(135deg, var(--brown-medium), var(--brown-rich));
    color: var(--beige-light);
    border-color: var(--brown-rich);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(94, 66, 46, 0.25);
}

.section {
    padding: 65px 0;
}

.section-title {
    text-align: center;
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--brown-dark);
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 14px;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 85px;
    height: 3.5px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--sand-gold), var(--brown-rich), var(--sand-gold));
}

.section-description {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 45px auto;
    font-size: 1.1rem;
    color: var(--brown-rich);
    background: var(--white-glass);
    padding: 18px 28px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.about-section {
    padding-top: 40px;
}

.hero-content {
    background: var(--white-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    padding: 45px 30px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.hero-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--beige-warm), var(--brown-rich), var(--beige-warm));
}

.hero-content h2 {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--brown-dark);
    margin-bottom: 8px;
}

.hero-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brown-medium);
    margin-bottom: 18px;
}

.bio-text {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--brown-dark);
}

.skills-box {
    background: linear-gradient(135deg, rgba(255, 252, 248, 0.85), rgba(242, 232, 220, 0.85));
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    padding: 32px 26px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.skills-box h3 {
    font-size: 1.35rem;
    color: var(--brown-rich);
    margin-bottom: 20px;
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.skills-list li {
    font-family: 'Playfair Display', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--beige-light);
    background: linear-gradient(135deg, var(--brown-medium), var(--brown-dark));
    padding: 9px 22px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(59, 38, 24, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skills-list li:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 22px rgba(59, 38, 24, 0.25);
}

.certificates-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 26px;
    margin-top: 25px;
}

.certificate-card {
    flex: 0 1 360px;
    max-width: 100%;
    background: var(--white-glass);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.certificate-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-hover);
}

.certificate-card img {
    width: 100%;
    height: 290px;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0 auto;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    cursor: zoom-in;
    transition: transform 0.5s ease;
}

.certificate-card:hover img {
    transform: scale(1.04);
}

.certificate-caption {
    width: 100%;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.95), var(--beige-soft));
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-caption p {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--brown-dark);
}

.sub-section {
    margin-top: 40px;
    background: rgba(255, 252, 248, 0.55);
    padding: 28px 22px;
    border-radius: 22px;
    border: 1px solid var(--border-soft);
}

.sub-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brown-rich);
    margin-bottom: 20px;
    text-align: center;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 22px;
    margin-top: 22px;
}

.gallery-item {
    flex: 0 1 360px;
    max-width: 100%;
    background: var(--white-glass);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.gallery-item img {
    width: 100%;
    height: 290px;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0 auto;
    cursor: zoom-in;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.drawings-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 26px;
}

.drawing-card {
    flex: 0 1 360px;
    max-width: 100%;
    background: var(--white-glass);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.drawing-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-hover);
}

.drawing-card img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0 auto;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    cursor: zoom-in;
    transition: transform 0.5s ease;
}

.drawing-card:hover img {
    transform: scale(1.04);
}

.drawing-caption {
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.95), var(--beige-soft));
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.drawing-caption p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brown-dark);
}

.main-footer {
    background: linear-gradient(135deg, var(--brown-rich), var(--brown-dark));
    color: var(--beige-light);
    padding: 60px 20px 28px;
    margin-top: 45px;
    text-align: center;
    border-top: 4px solid var(--sand-gold);
}

.main-footer h2 {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--beige-light);
}

.main-footer > .container > p {
    font-size: 1.05rem;
    color: var(--beige-warm);
    margin-bottom: 32px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.contact-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    max-width: 100%;
    color: var(--brown-dark);
    background: linear-gradient(135deg, var(--beige-light), var(--beige-warm));
    padding: 13px 22px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.35s ease;
}

.contact-card i {
    font-size: 1.2rem;
    color: var(--brown-rich);
    flex-shrink: 0;
    transition: transform 0.35s ease;
}

.contact-card span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-card:hover {
    transform: translateY(-4px);
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.contact-card:hover i {
    transform: scale(1.2);
    color: var(--brown-medium);
}

.copyright {
    border-top: 1px solid rgba(228, 212, 194, 0.2);
    padding-top: 20px;
    font-size: 0.9rem;
    color: var(--sand-gold);
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background-color: rgba(34, 21, 13, 0.92);
    backdrop-filter: blur(8px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    cursor: zoom-out;
    animation: fadeIn 0.25s ease;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    max-width: 92vw;
    max-height: 75vh;
    border-radius: 14px;
    border: 3px solid var(--beige-warm);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    cursor: default;
    animation: zoomIn 0.3s ease;
}

.lightbox-caption {
    margin-top: 14px;
    color: var(--beige-light);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    max-width: 90vw;
}

.lightbox-close {
    position: absolute;
    top: 14px;
    right: 20px;
    color: var(--beige-light);
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
    color: var(--sand-gold);
    transform: scale(1.15);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.88); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 1024px) {
    html {
        scroll-padding-top: 76px;
    }

    main {
        padding-top: 58px;
    }

    .container {
        padding: 0 20px;
    }

    .nav-buttons {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-buttons::-webkit-scrollbar {
        display: none;
    }

    .nav-btn {
        flex-shrink: 0;
        font-size: 0.85rem;
        padding: 7px 15px;
    }

    .certificate-card,
    .gallery-item,
    .drawing-card {
        flex: 0 1 340px;
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 66px;
    }

    main {
        padding-top: 54px;
    }

    .container {
        padding: 0 14px;
    }

    .main-header {
        padding: 9px 10px;
    }

    .nav-btn {
        font-size: 0.8rem;
        padding: 6px 13px;
    }

    .section {
        padding: 38px 0;
    }

    .section-title {
        font-size: 1.45rem;
    }

    .section-description {
        font-size: 0.98rem;
        padding: 14px 16px;
        margin-bottom: 28px;
    }

    .hero-content {
        padding: 24px 16px;
        border-radius: 18px;
    }

    .hero-content h2 {
        font-size: 1.38rem;
    }

    .hero-content h3 {
        font-size: 1.02rem;
    }

    .bio-text {
        font-size: 0.95rem;
    }

    .skills-box {
        padding: 22px 14px;
        border-radius: 18px;
    }

    .skills-list li {
        font-size: 0.86rem;
        padding: 7px 15px;
    }

    .sub-section {
        padding: 18px 12px;
        margin-top: 24px;
        border-radius: 18px;
    }

    .sub-title {
        font-size: 1.12rem;
    }

    .certificates-grid,
    .gallery-grid,
    .drawings-grid {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .certificate-card,
    .gallery-item,
    .drawing-card {
        flex: none;
        width: 100%;
        max-width: 350px;
    }

    .certificate-card img,
    .gallery-item img,
    .drawing-card img {
        height: 225px;
    }

    .lightbox-content {
        max-width: 95vw;
        max-height: 70vh;
    }

    .contact-card {
        width: 100%;
        max-width: 330px;
        justify-content: center;
        font-size: 0.88rem;
        padding: 12px 16px;
    }
}