/* =====================================================
   SELWA TOFIK PORTFOLIO
   Main Stylesheet
===================================================== */


/* =====================================================
   1. RESET & GLOBAL
===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;

    --text: #0f172a;
    --text-light: #64748b;

    --background: #f8fafc;
    --surface: #ffffff;
    --section-bg: #f1f5f9;

    --border: #e2e8f0;

    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 18px 40px rgba(15, 23, 42, 0.13);

    --transition: 0.3s ease;
}

body {
    font-family: "Poppins", sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

section {
    scroll-margin-top: 80px;
}


/* =====================================================
   2. HEADER / NAVIGATION
===================================================== */

header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;

    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);

    z-index: 1000;

    border-bottom: 1px solid rgba(226, 232, 240, 0.7);

    transition: var(--transition);
}

nav {
    width: min(1200px, 92%);
    height: 80px;
    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;

    font-size: 30px;
    font-weight: 700;

    color: var(--primary);

    flex-shrink: 0;
}

.logo span {
    color: var(--accent);
}


/* Navigation links */

nav ul {
    display: flex;
    align-items: center;

    list-style: none;

    gap: 24px;
}

nav ul li a {
    position: relative;

    text-decoration: none;

    color: var(--text);

    font-size: 14px;
    font-weight: 500;

    padding: 8px 0;

    transition: var(--transition);
}

nav ul li a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 0;
    height: 2px;

    background: var(--primary);

    transition: var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}


/* Navigation controls */

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#theme-toggle,
#menu-toggle {
    width: 42px;
    height: 42px;

    border: none;
    border-radius: 50%;

    background: transparent;

    color: var(--primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;

    transition: var(--transition);
}

#theme-toggle:hover,
#menu-toggle:hover {
    background: #eff6ff;
    transform: translateY(-2px);
}

#menu-toggle {
    display: none;
}


/* =====================================================
   3. HERO
===================================================== */

.hero {
    width: min(1200px, 92%);
    min-height: 100vh;

    margin: auto;

    padding: 120px 0 80px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 60px;
}

.hero-text {
    width: 55%;
}

.hero-greeting {
    color: var(--primary) !important;

    font-size: 18px !important;
    font-weight: 600;

    margin-bottom: 8px;
}

.hero-text h1 {
    font-size: clamp(42px, 5vw, 64px);

    line-height: 1.15;

    margin-bottom: 10px;
}

.hero-text h1 span {
    color: var(--primary);
}

.hero-text h2 {
    min-height: 48px;

    margin: 15px 0;

    font-size: clamp(26px, 3vw, 36px);

    color: #475569;
}

.hero-description {
    max-width: 600px;

    color: var(--text-light);

    font-size: 17px;

    line-height: 1.8;
}


/* Hero buttons */

.buttons {
    display: flex;
    flex-wrap: wrap;

    gap: 15px;

    margin-top: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 13px 26px;

    border-radius: 30px;

    background: var(--primary);
    color: white;

    text-decoration: none;

    font-weight: 500;

    border: 2px solid var(--primary);

    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);

    transform: translateY(-3px);

    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn.outline {
    background: transparent;
    color: var(--primary);
}

.btn.outline:hover {
    background: var(--primary);
    color: white;
}


/* Hero image */

.hero-image {
    width: 40%;

    display: flex;
    justify-content: center;
}

.hero-image img {
    width: min(380px, 100%);
    aspect-ratio: 1;

    object-fit: cover;

    border-radius: 50%;

    border: 8px solid white;

    outline: 5px solid var(--primary);

    box-shadow: var(--shadow-hover);

    transition: var(--transition);
}

.hero-image img:hover {
    transform: scale(1.03);
}


/* =====================================================
   4. SECTION TITLES
===================================================== */

.section-title {
    text-align: center;

    max-width: 700px;

    margin: 0 auto 55px;
}

.section-title h2 {
    font-size: clamp(32px, 4vw, 42px);

    color: var(--primary);

    margin-bottom: 8px;
}

.section-title p {
    color: var(--text-light);

    font-size: 16px;
}


/* =====================================================
   5. ABOUT
===================================================== */

.about {
    padding: 110px 4%;
    background: var(--surface);
}

.about-container {
    width: min(1100px, 100%);

    margin: auto;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 60px;

    align-items: start;
}

.about-text h3 {
    font-size: 30px;

    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-light);

    line-height: 1.8;

    margin-bottom: 18px;
}

.about-info div {
    background: var(--background);

    padding: 18px 20px;

    margin-bottom: 15px;

    border-left: 4px solid var(--primary);

    border-radius: 10px;

    box-shadow: var(--shadow);

    transition: var(--transition);
}

.about-info div:hover {
    transform: translateX(5px);
}

.about-info strong {
    margin-right: 8px;
}


/* =====================================================
   6. SKILLS
===================================================== */

.skills {
    padding: 110px 4%;

    background: var(--section-bg);
}

.skills-container {
    width: min(1100px, 100%);

    margin: auto;

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 25px;
}

.skill-card {
    background: var(--surface);

    padding: 35px 25px;

    text-align: center;

    border-radius: 16px;

    box-shadow: var(--shadow);

    border: 1px solid transparent;

    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-8px);

    border-color: #bfdbfe;

    box-shadow: var(--shadow-hover);
}

.skill-card i {
    font-size: 45px;

    color: var(--primary);

    margin-bottom: 18px;
}

.skill-card h3 {
    margin-bottom: 10px;
}

.skill-card p {
    color: var(--text-light);
}


/* =====================================================
   7. PROJECTS
===================================================== */

.projects {
    padding: 110px 4%;

    background: var(--background);
}

.projects-container {
    width: min(1200px, 100%);

    margin: auto;

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 30px;
}

.project-card {
    display: flex;
    flex-direction: column;

    background: var(--surface);

    border-radius: 18px;

    overflow: hidden;

    box-shadow: var(--shadow);

    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-8px);

    box-shadow: var(--shadow-hover);
}

.project-card img {
    width: 100%;
    height: 230px;

    object-fit: cover;

    transition: var(--transition);
}

.project-card:hover img {
    transform: scale(1.03);
}

.project-content {
    display: flex;
    flex-direction: column;

    flex: 1;

    padding: 25px;
}

.category {
    display: inline-block;

    width: fit-content;

    color: var(--primary);

    background: #eff6ff;

    padding: 5px 12px;

    border-radius: 20px;

    font-size: 13px;

    font-weight: 600;

    margin-bottom: 12px;
}

.project-content h3 {
    font-size: 22px;

    margin-bottom: 12px;
}

.project-content p {
    color: var(--text-light);

    line-height: 1.7;
}

.technology {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin: 20px 0;
}

.technology span {
    background: #dbeafe;

    color: var(--primary);

    padding: 5px 11px;

    border-radius: 20px;

    font-size: 13px;

    font-weight: 500;
}

.project-links {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: auto;
}

.project-btn,
.demo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 10px 18px;

    border-radius: 25px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    transition: var(--transition);
}

.project-btn {
    background: var(--primary);
    color: white;
}

.project-btn:hover {
    background: var(--primary-dark);

    transform: translateY(-2px);
}

.demo-btn {
    border: 2px solid var(--primary);

    color: var(--primary);
}

.demo-btn:hover {
    background: var(--primary);

    color: white;
}


/* =====================================================
   8. EDUCATION
===================================================== */

.education {
    padding: 110px 4%;

    background: var(--section-bg);
}

.education-container {
    display: flex;
    justify-content: center;
}

.education-card {
    width: min(600px, 100%);

    background: var(--surface);

    text-align: center;

    padding: 45px 35px;

    border-radius: 18px;

    box-shadow: var(--shadow);

    transition: var(--transition);
}

.education-card:hover {
    transform: translateY(-5px);

    box-shadow: var(--shadow-hover);
}

.education-card i {
    font-size: 50px;

    color: var(--primary);

    margin-bottom: 20px;
}

.education-card h3 {
    font-size: 22px;

    margin-bottom: 12px;
}

.education-card h4 {
    color: var(--primary);

    font-size: 19px;
}

.education-card p {
    color: var(--text-light);

    margin: 10px 0;
}

.education-card span {
    color: var(--accent);

    font-weight: 600;
}


/* =====================================================
   9. ACHIEVEMENTS
===================================================== */

.achievements {
    padding: 110px 4%;

    background: var(--surface);
}

.achievement-container {
    width: min(1200px, 100%);

    margin: auto;

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 25px;
}

.achievement-card {
    background: var(--background);

    padding: 30px 22px;

    text-align: center;

    border-radius: 16px;

    border: 1px solid var(--border);

    transition: var(--transition);
}

.achievement-card:hover {
    transform: translateY(-8px);

    box-shadow: var(--shadow-hover);
}

.achievement-card i {
    font-size: 42px;

    color: var(--primary);

    margin-bottom: 18px;
}

.achievement-card h3 {
    font-size: 19px;

    margin-bottom: 12px;
}

.achievement-card p {
    color: var(--text-light);

    line-height: 1.6;
}


/* =====================================================
   10. SERVICES
===================================================== */

.services {
    padding: 110px 4%;

    background: var(--section-bg);
}

.services-container {
    width: min(1200px, 100%);

    margin: auto;

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 25px;
}

.service-card {
    background: var(--surface);

    padding: 35px 25px;

    text-align: center;

    border-radius: 16px;

    box-shadow: var(--shadow);

    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);

    box-shadow: var(--shadow-hover);
}

.service-card i {
    font-size: 42px;

    color: var(--primary);

    margin-bottom: 18px;
}

.service-card h3 {
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-light);

    line-height: 1.6;
}


/* =====================================================
   11. RESUME
===================================================== */

.resume {
    padding: 110px 4%;

    text-align: center;

    background: var(--background);
}

.resume-box {
    width: min(650px, 100%);

    margin: auto;

    background: var(--surface);

    padding: 45px 30px;

    border-radius: 18px;

    box-shadow: var(--shadow);
}

.resume-box i {
    font-size: 60px;

    color: #ef4444;

    margin-bottom: 20px;
}

.resume-box h3 {
    font-size: 26px;

    margin-bottom: 12px;
}

.resume-box p {
    color: var(--text-light);

    margin-bottom: 25px;
}


/* =====================================================
   12. CONTACT
===================================================== */

.contact {
    padding: 110px 4%;

    background: var(--section-bg);
}

.contact-container {
    width: min(1100px, 100%);

    margin: auto;

    display: grid;

    grid-template-columns: 0.8fr 1.2fr;

    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contact-card {
    background: var(--surface);

    padding: 25px;

    border-radius: 15px;

    box-shadow: var(--shadow);

    transition: var(--transition);
}

.contact-card:hover {
    transform: translateX(5px);
}

.contact-card i {
    font-size: 28px;

    color: var(--primary);

    margin-bottom: 10px;
}

.contact-card h3 {
    margin-bottom: 5px;
}

.contact-card p {
    color: var(--text-light);
}


/* Contact form */

.contact-form {
    display: flex;

    flex-direction: column;

    gap: 18px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;

    padding: 15px 18px;

    border: 1px solid var(--border);

    background: var(--surface);

    color: var(--text);

    border-radius: 10px;

    font-size: 15px;

    outline: none;

    resize: vertical;

    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form button {
    border: none;

    padding: 14px 25px;

    background: var(--primary);

    color: white;

    border-radius: 30px;

    font-size: 16px;

    transition: var(--transition);
}

.contact-form button:hover {
    background: var(--primary-dark);

    transform: translateY(-2px);
}


/* Accessibility labels */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* =====================================================
   13. FOOTER
===================================================== */

footer {
    background: #0f172a;

    color: white;

    text-align: center;

    padding: 50px 20px;
}

footer h3 {
    font-size: 28px;

    margin-bottom: 8px;
}

footer p {
    color: #cbd5e1;

    margin: 10px 0;
}

.social-icons {
    display: flex;

    justify-content: center;

    align-items: center;

    flex-wrap: wrap;

    gap: 18px;

    margin: 25px 0;
}

.social-icons a {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    border: 1px solid #334155;

    border-radius: 50%;

    font-size: 20px;

    text-decoration: none;

    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--primary);

    border-color: var(--primary);

    transform: translateY(-4px);
}

.copyright {
    font-size: 14px;

    margin-top: 20px;
}


/* =====================================================
   14. SCROLL TO TOP
===================================================== */

#scroll-top {
    position: fixed;

    right: 25px;
    bottom: 25px;

    width: 45px;
    height: 45px;

    border: none;

    border-radius: 50%;

    background: var(--primary);

    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 17px;

    opacity: 0;
    visibility: hidden;

    transform: translateY(15px);

    transition: var(--transition);

    z-index: 900;
}

#scroll-top.show {
    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}

#scroll-top:hover {
    background: var(--primary-dark);

    transform: translateY(-4px);
}


/* =====================================================
   15. SCROLL REVEAL
===================================================== */

section {
    opacity: 0;

    transform: translateY(35px);

    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

section.show {
    opacity: 1;

    transform: translateY(0);
}


/* =====================================================
   16. DARK MODE
===================================================== */

body.dark-mode {
    --text: #f8fafc;
    --text-light: #cbd5e1;

    --background: #0f172a;
    --surface: #1e293b;
    --section-bg: #111827;

    --border: #334155;

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.35);
}

body.dark-mode header {
    background: rgba(15, 23, 42, 0.95);

    border-color: #334155;
}

body.dark-mode nav ul li a {
    color: #f8fafc;
}

body.dark-mode nav ul li a:hover,
body.dark-mode nav ul li a.active {
    color: #60a5fa;
}

body.dark-mode #theme-toggle {
    color: #facc15;
}

body.dark-mode #theme-toggle:hover,
body.dark-mode #menu-toggle:hover {
    background: #1e293b;
}

body.dark-mode .hero-text h2 {
    color: #cbd5e1;
}

body.dark-mode .hero-image img {
    border-color: #1e293b;

    outline-color: #3b82f6;
}

body.dark-mode .category {
    background: #172554;
}

body.dark-mode .technology span {
    background: #172554;
}

body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
    background: #1e293b;

    color: #f8fafc;

    border-color: #334155;
}

body.dark-mode .contact-form input::placeholder,
body.dark-mode .contact-form textarea::placeholder {
    color: #94a3b8;
}

body.dark-mode .achievement-card {
    border-color: #334155;
}


/* =====================================================
   17. TABLET
===================================================== */

@media (max-width: 1100px) {

    nav ul {
        gap: 16px;
    }

    nav ul li a {
        font-size: 13px;
    }

    .achievement-container,
    .services-container {
        grid-template-columns: repeat(2, 1fr);
    }

}


/* =====================================================
   18. MOBILE
===================================================== */

@media (max-width: 900px) {

    nav {
        height: 70px;
    }

    .logo {
        font-size: 27px;
    }


    /* Mobile menu button */

    #menu-toggle {
        display: flex;
    }


    /* Mobile navigation */

    nav ul {
        position: absolute;

        top: 70px;
        right: 4%;

        width: min(280px, 90vw);

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 0;

        padding: 10px 0;

        background: var(--surface);

        border: 1px solid var(--border);

        border-radius: 14px;

        box-shadow: var(--shadow-hover);

        opacity: 0;

        visibility: hidden;

        transform: translateY(-10px);

        transition: var(--transition);
    }

    nav ul.active {
        opacity: 1;

        visibility: visible;

        transform: translateY(0);
    }

    nav ul li a {
        display: block;

        padding: 13px 20px;

        font-size: 14px;
    }

    nav ul li a::after {
        display: none;
    }


    /* Hero */

    .hero {
        min-height: auto;

        padding: 120px 0 80px;

        flex-direction: column-reverse;

        text-align: center;

        gap: 40px;
    }

    .hero-text,
    .hero-image {
        width: 100%;
    }

    .hero-text h1 {
        font-size: 42px;
    }

    .hero-text h2 {
        font-size: 28px;
    }

    .hero-description {
        margin: auto;

        font-size: 16px;
    }

    .buttons {
        justify-content: center;
    }

    .hero-image img {
        width: 270px;
    }


    /* About */

    .about-container {
        grid-template-columns: 1fr;

        gap: 35px;
    }


    /* Skills */

    .skills-container {
        grid-template-columns: repeat(2, 1fr);
    }


    /* Projects */

    .projects-container {
        grid-template-columns: repeat(2, 1fr);
    }


    /* Contact */

    .contact-container {
        grid-template-columns: 1fr;

        gap: 35px;
    }

}


/* =====================================================
   19. SMALL MOBILE
===================================================== */

@media (max-width: 600px) {

    .section-title {
        margin-bottom: 40px;
    }

    .section-title h2 {
        font-size: 32px;
    }


    .hero-text h1 {
        font-size: 36px;
    }

    .hero-text h2 {
        font-size: 24px;
    }

    .hero-image img {
        width: 220px;
    }


    .buttons {
        flex-direction: column;

        align-items: center;
    }

    .btn {
        width: min(280px, 100%);
    }


    .skills-container,
    .projects-container,
    .achievement-container,
    .services-container {
        grid-template-columns: 1fr;
    }


    .education-card {
        padding: 35px 20px;
    }


    .project-card img {
        height: 210px;
    }


    .contact {
        padding-left: 5%;
        padding-right: 5%;
    }


    #scroll-top {
        right: 18px;

        bottom: 18px;
    }

}


/* =====================================================
   20. REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }

}