/* =============================================
   PORTFOLIO — styles.css
   Erfan Ghoreishi · Backend Software Engineer
   ============================================= */

/* ----- CSS CUSTOM PROPERTIES ----- */
:root {
    --clr-primary:    #1e3a8a;
    --clr-accent:     #3b82f6;
    --clr-white:      #ffffff;
    --clr-off-white:  #f9fafb;
    --clr-text:       #1f2937;
    --clr-text-light: #6b7280;
    --clr-border:     #e5e7eb;

    --ff-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --fs-h1:   2.5rem;
    --fs-h2:   2rem;
    --fs-h3:   1.5rem;
    --fs-body: 1rem;
    --fs-sm:   0.875rem;
    --fs-xs:   0.75rem;

    --fw-regular: 400;
    --fw-medium:  500;
    --fw-semi:    600;
    --fw-bold:    700;

    --max-width:  1200px;
    --nav-height: 64px;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --transition: 0.25s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    color: var(--clr-text);
    background: var(--clr-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

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

ul {
    list-style: none;
}

/* ----- UTILITY ----- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.accent {
    color: var(--clr-accent);
}

.section {
    padding: 80px 0;
}

.section--alt {
    background: var(--clr-off-white);
}

.section__title {
    font-size: var(--fs-h2);
    font-weight: var(--fw-bold);
    color: var(--clr-primary);
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.section__title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--clr-accent);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ----- BUTTONS ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-weight: var(--fw-semi);
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.btn--primary {
    background: var(--clr-primary);
    color: var(--clr-white);
    border-color: var(--clr-primary);
}

.btn--primary:hover,
.btn--primary:focus-visible {
    background: #15306e;
    border-color: #15306e;
    box-shadow: var(--shadow-md);
}

.btn--outline {
    background: transparent;
    color: var(--clr-primary);
    border-color: var(--clr-primary);
}

.btn--outline:hover,
.btn--outline:focus-visible {
    background: var(--clr-primary);
    color: var(--clr-white);
}

.btn--small {
    padding: 8px 18px;
    font-size: var(--fs-sm);
    background: var(--clr-primary);
    color: var(--clr-white);
    border-color: var(--clr-primary);
}

.btn--small:hover,
.btn--small:focus-visible {
    background: #15306e;
    border-color: #15306e;
    box-shadow: var(--shadow-md);
}

/* ----- NAVIGATION ----- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--clr-border);
    z-index: 1000;
    transition: box-shadow var(--transition);
}

.navbar--scrolled {
    box-shadow: var(--shadow-sm);
}

.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.navbar__logo {
    font-size: 1.4rem;
    font-weight: var(--fw-bold);
    color: var(--clr-primary);
    letter-spacing: -0.5px;
}

.navbar__menu {
    display: flex;
    gap: 32px;
}

.navbar__link {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--clr-text-light);
    transition: color var(--transition);
    position: relative;
    padding: 4px 0;
}

.navbar__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--clr-accent);
    transition: width var(--transition);
}

.navbar__link:hover,
.navbar__link.active {
    color: var(--clr-primary);
}

.navbar__link:hover::after,
.navbar__link.active::after {
    width: 100%;
}

/* Mobile toggle */
.navbar__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.navbar__toggle-bar {
    width: 24px;
    height: 2px;
    background: var(--clr-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* ----- HERO ----- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--nav-height);
    background: linear-gradient(160deg, var(--clr-off-white) 0%, var(--clr-white) 50%, #eef2ff 100%);
    position: relative;
}

.hero__inner {
    max-width: 700px;
    margin: 0 auto;
}

.hero__greeting {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--clr-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.hero__name {
    font-size: var(--fs-h1);
    font-weight: var(--fw-bold);
    color: var(--clr-primary);
    line-height: 1.15;
    margin-bottom: 8px;
}

.hero__title {
    font-size: var(--fs-h3);
    font-weight: var(--fw-medium);
    color: var(--clr-text);
    margin-bottom: 12px;
}

.hero__tagline {
    font-size: var(--fs-body);
    color: var(--clr-text-light);
    margin-bottom: 32px;
}

.hero__cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.hero__socials {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 48px;
}

.hero__socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--clr-border);
    color: var(--clr-text-light);
    font-size: 1.15rem;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.hero__socials a:hover,
.hero__socials a:focus-visible {
    color: var(--clr-white);
    background: var(--clr-primary);
    border-color: var(--clr-primary);
}

.hero__scroll {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--clr-text-light);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.hero__scroll:hover {
    opacity: 1;
}

.hero__scroll-icon {
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* ----- ABOUT ----- */
.about__content {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.about__text {
    font-size: 1.05rem;
    color: var(--clr-text);
    line-height: 1.75;
    margin-bottom: 28px;
}

.about__badge {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: var(--clr-off-white);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin-bottom: 28px;
    text-align: left;
}

.about__badge i {
    font-size: 1.5rem;
    color: var(--clr-primary);
}

.about__badge strong {
    display: block;
    font-size: var(--fs-body);
    color: var(--clr-text);
}

.about__badge span {
    font-size: var(--fs-sm);
    color: var(--clr-text-light);
}

/* ----- SKILLS ----- */
.skills__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.skills__card {
    background: var(--clr-white);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.skills__card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.skills__card-title {
    font-size: var(--fs-body);
    font-weight: var(--fw-semi);
    color: var(--clr-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skills__card-title i {
    font-size: 1.1rem;
    color: var(--clr-accent);
}

.skills__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    background: #eef2ff;
    color: var(--clr-primary);
    border-radius: 100px;
    white-space: nowrap;
}

.tag--project {
    background: rgba(30, 58, 138, 0.08);
    color: var(--clr-primary);
    font-size: var(--fs-xs);
}

/* ----- PROJECTS ----- */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 28px;
}

.project-card {
    background: var(--clr-white);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.project-card__body {
    flex: 1;
}

.project-card__title {
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    color: var(--clr-primary);
    margin-bottom: 12px;
}

.project-card__desc {
    font-size: var(--fs-sm);
    color: var(--clr-text-light);
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.project-card__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ----- CONTACT ----- */
.contact {
    text-align: center;
}

.contact__subtitle {
    font-size: 1.05rem;
    color: var(--clr-text-light);
    margin-top: -28px;
    margin-bottom: 40px;
}

.contact__links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-bottom: 36px;
}

.contact__item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: var(--fs-body);
    color: var(--clr-text);
    padding: 12px 24px;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    background: var(--clr-white);
    transition: border-color var(--transition), box-shadow var(--transition), color var(--transition);
    min-width: 300px;
}

.contact__item:hover,
.contact__item:focus-visible {
    border-color: var(--clr-accent);
    box-shadow: var(--shadow-sm);
    color: var(--clr-primary);
}

.contact__item i {
    font-size: 1.15rem;
    color: var(--clr-accent);
    width: 20px;
    text-align: center;
}

/* ----- FOOTER ----- */
.footer {
    padding: 24px 0;
    border-top: 1px solid var(--clr-border);
}

.footer__inner {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--clr-text-light);
}

/* =============================================
   RESPONSIVE — Mobile-first breakpoints
   ============================================= */

/* ----- 768px and below (tablet / mobile) ----- */
@media (max-width: 768px) {
    :root {
        --fs-h1: 2rem;
        --fs-h2: 1.6rem;
        --fs-h3: 1.25rem;
    }

    .section {
        padding: 48px 0;
    }

    .section__title {
        margin-bottom: 32px;
    }

    /* Navigation — mobile menu */
    .navbar__toggle {
        display: flex;
    }

    .navbar__menu {
        position: fixed;
        top: var(--nav-height);
        right: 0;
        width: 260px;
        height: calc(100vh - var(--nav-height));
        background: var(--clr-white);
        flex-direction: column;
        gap: 0;
        padding: 16px 0;
        border-left: 1px solid var(--clr-border);
        box-shadow: -4px 0 12px rgba(0,0,0,.06);
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .navbar__menu.open {
        transform: translateX(0);
    }

    .navbar__link {
        display: block;
        padding: 14px 24px;
        font-size: var(--fs-body);
    }

    .navbar__link::after {
        display: none;
    }

    /* Toggle animation */
    .navbar__toggle.active .navbar__toggle-bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .navbar__toggle.active .navbar__toggle-bar:nth-child(2) {
        opacity: 0;
    }
    .navbar__toggle.active .navbar__toggle-bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(var(--nav-height) + 48px) 0 64px;
    }

    .hero__cta {
        flex-direction: column;
        align-items: center;
    }

    /* Projects */
    .projects__grid {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact__item {
        min-width: 0;
        width: 100%;
        max-width: 360px;
    }
}

/* ----- 480px and below (small mobile) ----- */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero__name {
        font-size: 1.75rem;
    }

    .skills__grid {
        grid-template-columns: 1fr;
    }

    .about__badge {
        flex-direction: column;
        text-align: center;
    }
}

/* ----- Print styles ----- */
@media print {
    .navbar,
    .hero__scroll,
    .hero__socials,
    .hero__cta,
    .project-card__actions,
    .contact .btn {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 24px 0;
    }

    .section {
        padding: 24px 0;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
