/*
    styles.index.css - Unified stylesheet for Mohamed Badran portfolio site

    Structure:
      1. Theme variables & base reset
      2. Navigation & mobile drawer
      3. Buttons, tags & layout utilities
      4. Hero section
      5. Cards & services grid
      6. Service page shell & switcher
      7. Timeline layout
      8. Reusable components: Projects, Certifications, Media Gallery & Lightbox
      9. Contact form
     10. Footer & socials
     11. Animations & reduced-motion support
*/

/* ==========================================================================
   1. Theme Variables & Base Reset
   ========================================================================== */
:root {
    --bg-dark: #0a1128;
    --bg-card: #121e3f;
    --bg-elevated: #17264f;
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-alt: #10b981;
    --accent-alt-hover: #059669;
    --danger: #ef4444;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-input: rgba(255, 255, 255, 0.16);
}

html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 96px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: clip;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.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;
}

section {
    padding: 5.5rem 5% 3rem;
    max-width: 1200px;
    margin: auto;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-title--spaced {
    margin-top: 3rem;
}

/* ==========================================================================
   2. Navigation & Mobile Drawer
   ========================================================================== */
nav.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 17, 40, 0.92);
    backdrop-filter: blur(10px);
    padding: 0.9rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav.site-nav .logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-primary);
    transition: transform 320ms ease;
}

nav.site-nav .logo:hover {
    transform: translateY(-2px);
}

.logo-img {
    height: 40px;
    width: 40px;
    display: block;
    object-fit: contain;
}

.logo-name {
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
}

.logo-name::before {
    content: '|';
    color: var(--text-secondary);
    margin-right: 0.6rem;
    font-weight: 400;
}

nav.site-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.25s ease;
    position: relative;
}

nav.site-nav a:hover,
nav.site-nav a.active {
    color: var(--text-primary);
}

nav.site-nav ul a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.menu-toggle:hover {
    border-color: var(--border-input);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    nav.site-nav ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 100%;
        right: 0;
        background: rgba(10, 17, 40, 0.97);
        backdrop-filter: blur(12px);
        width: 230px;
        padding: 1.5rem;
        border-radius: 0 0 0 10px;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        gap: 1.25rem;
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.28s ease, visibility 0.28s ease;
    }

    nav.site-nav ul.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
}

/* ==========================================================================
   3. Buttons, Tags & Layout Utilities
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-input);
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent);
}

.btn-sm {
    padding: 0.48rem 0.95rem;
    font-size: 0.86rem;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.84rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.resume-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.resume-buttons .btn {
    flex: 1 1 0;
    min-width: 250px;
    text-align: center;
}

/* ==========================================================================
   3b. Career Profiles, Role Switcher & Cross-Domain Value Props
   ========================================================================== */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.track-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.track-tab {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-input);
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.track-tab:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.track-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.profiles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.4rem;
}

.profiles-grid > .profile-card {
    flex: 0 0 100%;
}

@media (min-width: 760px) {
    .profiles-grid > .profile-card {
        flex: 0 0 calc((100% - 1.4rem) / 2);
    }
}

.profile-role-resumes {
    padding-top: 0.55rem;
    border-top: 1px solid var(--border-subtle);
}

.profile-role-resumes .cert-pill-links {
    margin-top: 0;
}

.profile-role-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
    letter-spacing: 0.2px;
}

.domain-resume-bar {
    margin-top: 1.5rem;
    padding: 1.15rem 1.3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-alt);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.domain-resume-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.domain-resume-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
}

.profile-card.is-highlighted {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35), 0 12px 30px rgba(2, 6, 23, 0.45);
}

.profile-card.is-dimmed {
    opacity: 0.48;
}

.profile-card.is-dimmed:hover {
    opacity: 0.92;
}

.profile-badge {
    align-self: flex-start;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--accent-alt);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

.profile-card h3 {
    margin-bottom: 0;
    font-size: 1.22rem;
}

.profile-card .profile-summary {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.94rem;
}

.profile-highlights {
    padding-left: 1.15rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-actions {
    margin-top: auto;
    padding-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.strengths-strip {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.strengths-heading {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.strengths-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
}

.strengths-grid > .strength-item {
    flex: 0 0 100%;
}

@media (min-width: 640px) {
    .strengths-grid > .strength-item {
        flex: 0 0 calc((100% - 1rem) / 2);
    }
}

@media (min-width: 960px) {
    .strengths-grid > .strength-item {
        flex: 0 0 calc((100% - 2rem) / 3);
    }
}

.strength-item {
    background: rgba(18, 30, 63, 0.55);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
}

.strength-item h4 {
    color: var(--accent);
    font-size: 0.98rem;
    margin-bottom: 0.4rem;
}

.strength-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.domain-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(18, 30, 63, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.domain-filter-bar[hidden] {
    display: none;
}

.service-card.is-hidden {
    display: none;
}

.domain-track-label {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.35rem;
    letter-spacing: 0.3px;
}

.section-intro {
    text-align: center;
    margin-top: 0.25rem;
    margin-bottom: 1.75rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
}

.contact-copy {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.direct-email-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.direct-email-link:hover {
    text-decoration: underline;
}

.empty-state {
    background: rgba(18, 30, 63, 0.55);
    border: 1px dashed var(--border-input);
    border-radius: 10px;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==========================================================================
   4. Hero Section
   ========================================================================== */
#home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 90%;
}

.hero-subtitle {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.8px;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-title-inner {
    display: inline-block;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.08rem;
    max-width: 620px;
    margin-bottom: 1.5rem;
}

.hero-media {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    flex: 0 0 300px;
    align-items: center;
}

.hero-image {
    width: 320px;
    max-width: 40vw;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--accent);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.6);
    display: block;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.75rem;
}

.stat-item h3 {
    font-size: 1.4rem;
    color: var(--accent);
}

.stat-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@media (min-width: 900px) {
    #home {
        flex-direction: row;
        align-items: center;
    }

    #home .hero-subtitle,
    #home .hero-title,
    #home .hero-desc,
    #home .btn {
        max-width: 90%;
    }

    .hero-media {
        margin-left: 2rem;
    }
}

@media (max-width: 899px) {
    .hero-media {
        margin-top: 1.5rem;
    }

    .hero-image {
        width: 80%;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.35rem;
    }
}

/* ==========================================================================
   5. Cards & Services Grid
   ========================================================================== */
.grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
}

.grid-container > * {
    flex: 0 0 100%;
}

@media (min-width: 720px) {
    .grid-container > * {
        flex: 0 0 calc((100% - 1.5rem) / 2);
    }
}

.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1.25rem;
}

.services-grid > .service-card {
    flex: 0 0 100%;
}

@media (min-width: 900px) {
    .services-grid > .service-card {
        flex: 0 0 calc((100% - 1.25rem) / 2);
    }
}

.card {
    background: var(--bg-card);
    padding: 1.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    opacity: 0;
    transform: translateY(10px) scale(0.995);
    transition: opacity 480ms ease, transform 480ms cubic-bezier(.2, .9, .2, 1), border-color 240ms ease;
}

.card.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card.revealed:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.28);
}

.card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.service-card h3 {
    margin-bottom: 0.5rem;
}

.service-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.5rem;
    justify-content: flex-start;
    width: 100%;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.25s ease, transform 0.2s ease;
}

.toggle-btn::after {
    content: '▾';
    display: inline-block;
    font-size: 0.85em;
    transition: transform 0.25s ease;
}

.toggle-btn[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.toggle-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.service-body,
.timeline-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 340ms ease;
}

.service-body > :first-child,
.timeline-body > :first-child {
    margin-top: 1rem;
}

.service-card.open .service-body,
.timeline-card.open .timeline-body {
    max-height: 1600px;
}

.more-btn {
    display: none;
    margin-top: 1.2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.35rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.25s ease, transform 0.2s ease;
}

.more-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.service-card.open .more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ==========================================================================
   6. Service Page Shell & Service Switcher
   ========================================================================== */
.service-page-shell {
    padding: 6.5rem 5% 2.5rem;
    max-width: 960px;
    margin: auto;
}

.service-page-shell > section {
    padding: 3rem 0 0;
    max-width: none;
    margin: 0;
}

.service-page-shell .service-hero-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-page-shell .service-hero-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.service-page-shell .skills-heading {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--accent);
}

.service-switcher {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.service-switcher-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.9rem;
    font-weight: 600;
}

.service-switcher-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.service-pill {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.service-pill:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.service-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ==========================================================================
   7. Timeline Layout
   ========================================================================== */
.timeline {
    border-left: 2px solid var(--accent);
    padding-left: 2rem;
    margin-left: 0.75rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.25rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 4px;
    width: 16px;
    height: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-date {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
}

.timeline-card {
    padding: 1.5rem;
}

.timeline-role {
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.timeline-org {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.timeline-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.85rem;
}

.timeline-list {
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-list li {
    margin-bottom: 0.5rem;
}

.timeline-list li:last-child {
    margin-bottom: 0;
}

.timeline-list + p {
    margin-top: 0.65rem;
}

.timeline-body .timeline-subhead {
    color: var(--text-primary);
    font-weight: 700;
    margin-top: 0.85rem;
    margin-bottom: 0.35rem;
}

.timeline-body .timeline-subhead:first-child {
    margin-top: 1rem;
}

.cert-pill-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.cert-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.8rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-alt);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.32);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cert-pill:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-alt);
    transform: translateY(-1px);
}

/* Recommendations & Endorsements */
.recs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.35rem;
}

.recs-grid > .rec-card {
    flex: 0 0 100%;
}

@media (min-width: 720px) {
    .recs-grid > .rec-card {
        flex: 0 0 calc((100% - 1.35rem) / 2);
    }

    .recs-grid > .rec-card:only-child {
        flex: 0 1 min(680px, 100%);
    }
}

.rec-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    border-left: 3px solid var(--accent);
}

.rec-quote {
    color: var(--text-secondary);
    font-size: 0.94rem;
    font-style: italic;
    line-height: 1.65;
    margin: 0;
}

.rec-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rec-author {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.96rem;
}

.rec-role {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.project-card.is-hidden {
    display: none;
}

.timeline-body p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-body p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   8. Reusable Components: Projects, Certifications, Media Gallery & Lightbox
   ========================================================================== */

/* Projects Showcase */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
}

.projects-grid > .project-card {
    flex: 0 0 100%;
}

@media (min-width: 720px) {
    .projects-grid > .project-card {
        flex: 0 0 calc((100% - 1.5rem) / 2);
    }
}

.project-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-elevated);
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 360ms ease;
}

.project-card:hover .project-media img {
    transform: scale(1.04);
}

.project-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(10, 17, 40, 0.85);
    backdrop-filter: blur(6px);
    color: var(--accent-alt);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.85rem;
}

.project-content h3 {
    margin-bottom: 0;
}

.project-meta {
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 600;
}

.project-content p {
    margin-bottom: 0;
}

.project-links {
    margin-top: auto;
    padding-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Certifications & Courses */
.certs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.25rem;
}

.certs-grid > .cert-card {
    flex: 0 0 100%;
}

@media (min-width: 640px) {
    .certs-grid > .cert-card {
        flex: 0 0 calc((100% - 1.25rem) / 2);
    }
}

.cert-card {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cert-card h3 {
    margin-bottom: 0;
    font-size: 1.05rem;
}

.cert-issuer {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.cert-date {
    color: var(--text-secondary);
    font-size: 0.84rem;
    margin-bottom: 0;
}

.cert-link {
    margin-top: auto;
    padding-top: 0.4rem;
    color: var(--accent-alt);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.cert-link:hover {
    text-decoration: underline;
}

/* Media Gallery */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
}

.gallery-grid > .gallery-item {
    flex: 0 0 100%;
}

@media (min-width: 560px) {
    .gallery-grid > .gallery-item {
        flex: 0 0 calc((100% - 1rem) / 2);
    }
}

@media (min-width: 900px) {
    .gallery-grid > .gallery-item {
        flex: 0 0 calc((100% - 2rem) / 3);
    }
}

.gallery-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    margin: 0;
    cursor: pointer;
    transition: transform 240ms ease, border-color 240ms ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.35);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    padding: 0.7rem 0.9rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(5, 10, 24, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-dialog {
    position: relative;
    max-width: min(960px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.lightbox-img {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 8px;
    border: 1px solid var(--border-input);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

.lightbox-caption {
    color: var(--text-primary);
    font-size: 0.95rem;
    text-align: center;
}

.lightbox-close,
.lightbox-nav {
    background: rgba(18, 30, 63, 0.9);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
    border-radius: 999px;
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* ==========================================================================
   9. Contact Form
   ========================================================================== */
.contact-section {
    padding-top: 4rem;
    padding-bottom: 2rem;
}

.contact-form {
    background: var(--bg-card);
    padding: 1.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-field.full {
    flex: 1 1 100%;
}

.form-field label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    padding: 0.65rem 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.form-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.form-status {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--accent);
    display: none;
}

.form-status.is-visible {
    display: inline-block;
}

.form-status.is-success {
    color: var(--accent-alt);
}

.form-status.is-error {
    color: var(--danger);
}

.form-status a {
    color: inherit;
    text-decoration: underline;
}

@media (max-width: 700px) {
    .form-row {
        flex-direction: column;
    }
}

/* ==========================================================================
   10. Footer & Socials
   ========================================================================== */
footer.site-footer {
    background: var(--bg-card);
    padding: 3rem 5%;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid var(--border-subtle);
}

footer.site-footer p {
    color: var(--text-secondary);
    margin-top: 0.85rem;
    font-size: 0.9rem;
}

.footer-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-copy {
    margin-top: 0.85rem;
}

.socials {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1.25rem 0 1.5rem;
}

.social-btn {
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.social-btn.x { background: #0f1419; }
.social-btn.fb { background: #3b5998; }
.social-btn.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-btn.li { background: #0a66c2; }
.social-btn.gh { background: #24292e; }
.social-btn.yt { background: #ff0000; }

/* ==========================================================================
   11. Animations & Reduced-Motion Support
   ========================================================================== */
.animate-fade-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 480ms cubic-bezier(.2, .9, .2, 1), transform 480ms cubic-bezier(.2, .9, .2, 1);
}

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

@keyframes floatY {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.float {
    animation: floatY 6s ease-in-out infinite;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-fade-up,
    .card {
        opacity: 1 !important;
        transform: none !important;
    }
}
