/* ---- Pre-loader ---- */
#preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    height: 100dvh;
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 1.2s ease-in-out, visibility 1.2s ease-in-out;
    overflow: hidden;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#preloader-video {
    width: 62vw;
    max-width: 900px;
    height: auto;
    display: block;
    border-radius: 0;
}

@media (max-width: 767px) {
    #preloader-video {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: 0;
    }
}

/* ---- Global Styles ---- */

@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

html {
    scroll-padding-top: 80px;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: #f4f4f4;
    padding-top: 130px;
    overflow-x: hidden;
    position: relative;
}

:root {
    /* ── Core palette ── */
    --primary:        #3d0f75;
    --primary-light:  #5a1aa8;
    --primary-dark:   #280a4e;

    --secondary:       #E8760A;
    --secondary-light: #f08c2a;

    --accent-gold:    #FFB800;
    --accent-amber:   #E8760A;

    --dark-bg:        #0d1b3e;

    /* ── Neutrals ── */
    --text-dark:  #333333;
    --text-muted: #4a5568;
    --text-light: #ffffff;
    --bg-light:   #f4f4f4;
    --bg-white:   #ffffff;
    --bg-dark:    #0d1b3e;

    /* ── Feedback ── */
    --color-error:   #c0392b;
    --color-success: #27ae60;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);

    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 50px;

    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
    --spacing-xxl: 60px;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--dark-bg);
    color: var(--text-light);
    padding: 0 20px;
    position: fixed;
    top: 0;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    z-index: 1000;
    height: 130px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    user-select: none;
    font-family: 'Poppins', sans-serif;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    isolation: isolate;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.logo-link {
    display: block;
    margin-left: -40px;
    z-index: 1010;
    position: relative;
    cursor: pointer;
    outline: none;
}

.logo-link:focus,
.logo-link:active {
    outline: none;
    box-shadow: none;
    border: none;
}

.navbar .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 400px;
    height: 280px;
    overflow: visible;
    filter: drop-shadow(0 2px 8px rgba(255, 184, 0, 0.2));
    transition: filter 0.3s ease;
    position: relative;
    z-index: 1010;
    background: url("../assets/Images/logo.svg") no-repeat center center;
    background-size: contain;
    will-change: filter;
    contain: layout paint;
}

.navbar .logo:hover {
    filter: drop-shadow(0 3px 12px rgba(255, 184, 0, 0.45));
}

.nav-links-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
    text-align: center;
    padding-left: 200px;
    padding-right: 200px;
}

.navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: center;
}

.navbar li {
    margin: 0;
}

.navbar ul a {
    color: var(--text-light);
    font-size: 0.7em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar ul a:hover {
    color: var(--accent-gold);
}

.cv-button {
    background-color: rgba(255, 184, 0, 0.12);
    color: var(--text-light);
    padding: 12px 24px;
    border: 1px solid rgba(255, 184, 0, 0.35);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.cv-button:hover {
    background-color: rgba(255, 184, 0, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 184, 0, 0.2);
}

.download-cv {
    margin-right: 70px;
}

.hamburger {
    display: none;
    cursor: pointer;
    margin-right: 50px;
    margin-left: 24px;
    background: none;
    border: none;
    padding: 4px;
    -webkit-tap-highlight-color: transparent;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: white;
}

.navbar a:focus,
.cv-button:focus,
.logo-link:focus {
    outline: none;
}

.navbar *:focus,
.navbar *:active {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    background: var(--dark-bg);
}

/* ---- Navbar Media Queries ---- */
@media screen and (max-width: 299px) {
    body {
        padding-top: 80px;
    }

    .navbar {
        height: 80px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .hamburger {
        display: block;
        margin-right: 13px;
        margin-left: auto;
    }

    .nav-links-container {
        position: fixed;
        left: -100%;
        top: 80px;
        width: 100%;
        height: 0;
        overflow: hidden;
        background-color: var(--dark-bg);
        transition: left 0.3s ease, height 0.3s ease;
        flex-direction: column;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-links-container.active {
        left: 0;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        overflow: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo-link {
        margin-right: 0;
        margin-left: 0;
    }

    .navbar .logo {
        width: 150px;
        height: 75px;
        background-size: 140px;
        margin-left: -22px;
        margin-right: -18px;
    }

    .navbar ul {
        flex-direction: column;
        gap: 20px;
        margin: 0;
        padding: 0;
        width: 100%;
        text-align: center;
    }

    .navbar ul a {
        padding: 10px;
        display: block;
        text-align: center;
        font-size: 1.3em;
    }

    .download-cv {
        display: none;
    }

    .nav-links-container.active li {
        animation: slideIn 0.3s ease forwards;
        opacity: 0;
    }

    .nav-links-container.active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-links-container.active li:nth-child(2) { animation-delay: 0.2s; }
    .nav-links-container.active li:nth-child(3) { animation-delay: 0.3s; }
    .nav-links-container.active li:nth-child(4) { animation-delay: 0.4s; }
    .nav-links-container.active li:nth-child(5) { animation-delay: 0.5s; }
    .nav-links-container.active li:nth-child(6) { animation-delay: 0.6s; }
    .nav-links-container.active li:nth-child(7) { animation-delay: 0.7s; }

    .nav-links-container.active .download-cv-mobile {
        display: block;
        width: 80%;
        margin: 20px auto 0;
        animation: slideIn 0.3s ease forwards;
        animation-delay: 0.8s;
        opacity: 0;
    }
}

@media screen and (min-width: 300px) and (max-width: 399px) {
    body {
        padding-top: 80px;
    }

    .navbar {
        height: 80px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
        position: fixed;
    }

    .hamburger {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        order: 2;
    }

    .nav-links-container {
        position: fixed;
        left: -100%;
        top: 80px;
        width: 100%;
        height: 0;
        overflow: hidden;
        background-color: var(--dark-bg);
        transition: left 0.3s ease, height 0.3s ease;
        flex-direction: column;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-links-container.active {
        left: 0;
        height: 100vh;
        height: 100dvh;
        padding-top: 0;
        padding-bottom: 80px;
        overflow: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo-link {
        margin-left: 0;
        order: 1;
    }

    .navbar .logo {
        width: 150px;
        height: 75px;
        background-size: 140px;
        margin-left: -22px;
        margin-right: -18px;
    }

    .navbar ul {
        flex-direction: column;
        gap: 20px;
        margin: 0;
        padding: 0;
        width: 100%;
        text-align: center;
    }

    .navbar ul a {
        padding: 10px;
        display: block;
        text-align: center;
        font-size: 1.3em;
    }

    .download-cv {
        display: block;
        margin-right: 0;
        order: 3;
        margin-left: 20px;
    }

    .cv-button {
        padding: 8px 16px;
        font-size: 8px;
    }

    .nav-links-container.active li {
        animation: slideIn 0.3s ease forwards;
        opacity: 0;
    }

    .nav-links-container.active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-links-container.active li:nth-child(2) { animation-delay: 0.2s; }
    .nav-links-container.active li:nth-child(3) { animation-delay: 0.3s; }
    .nav-links-container.active li:nth-child(4) { animation-delay: 0.4s; }
    .nav-links-container.active li:nth-child(5) { animation-delay: 0.5s; }
    .nav-links-container.active li:nth-child(6) { animation-delay: 0.6s; }
    .nav-links-container.active li:nth-child(7) { animation-delay: 0.7s; }

    .nav-links-container.active .download-cv-mobile {
        display: none;
    }
}

@media screen and (min-width: 400px) and (max-width: 767px) {
    body {
        padding-top: 80px;
    }

    .navbar {
        height: 80px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
        position: fixed;
    }

    .hamburger {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        order: 2;
    }

    .nav-links-container {
        position: fixed;
        left: -100%;
        top: 80px;
        width: 100%;
        height: 0;
        overflow: hidden;
        background-color: var(--dark-bg);
        transition: left 0.3s ease, height 0.3s ease;
        flex-direction: column;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-links-container.active {
        left: 0;
        height: 100vh;
        height: 100dvh;
        padding-top: 0;
        padding-bottom: 80px;
        overflow: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo-link {
        order: 1;
    }

    .navbar .logo {
        width: 150px;
        height: 75px;
        background-size: 168px;
        margin-left: 38px;
        margin-right: 0px;
    }

    .navbar ul {
        flex-direction: column;
        gap: 20px;
        margin: 0;
        padding: 0;
        width: 100%;
        text-align: center;
    }

    .navbar ul a {
        padding: 10px;
        display: block;
        text-align: center;
        font-size: 1.3em;
    }

    .download-cv {
        display: block;
        margin-right: 0;
        order: 3;
        margin-left: 20px;
    }

    .cv-button {
        padding: 10px 18px;
        font-size: 10px;
    }

    .nav-links-container.active li {
        animation: slideIn 0.3s ease forwards;
        opacity: 0;
    }

    .nav-links-container.active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-links-container.active li:nth-child(2) { animation-delay: 0.2s; }
    .nav-links-container.active li:nth-child(3) { animation-delay: 0.3s; }
    .nav-links-container.active li:nth-child(4) { animation-delay: 0.4s; }
    .nav-links-container.active li:nth-child(5) { animation-delay: 0.5s; }
    .nav-links-container.active li:nth-child(6) { animation-delay: 0.6s; }
    .nav-links-container.active li:nth-child(7) { animation-delay: 0.7s; }

    .nav-links-container.active .download-cv-mobile {
        display: none;
    }
}

@media screen and (min-width: 768px) and (max-width: 980px) {
    body {
        padding-top: 80px;
    }

    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
        height: 90px;
    }

    .logo-link {
        order: 1;
    }

    .navbar .logo {
        width: 200px;
        height: 80px;
        background-size: 200px;
        margin-left: 40px;
        margin-right: 53px;
    }

    .hamburger {
        display: block;
        margin: 0;
        order: 2;
        margin-right: 120px;
    }

    .download-cv {
        margin: 0;
        order: 3;
    }

    .nav-links-container {
        position: fixed;
        left: -100%;
        top: 90px;
        width: 100%;
        height: 0;
        overflow: hidden;
        background-color: var(--dark-bg);
        transition: left 0.3s ease, height 0.3s ease;
        flex-direction: column;
        padding: 0;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-links-container.active {
        left: 0;
        height: 100vh;
        height: 100svh;
        padding: 0;
        overflow: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .navbar ul {
        flex-direction: column;
        gap: 20px;
        margin: 0;
        padding: 0;
    }

    .navbar ul a {
        padding: 10px;
        display: block;
        text-align: center;
        font-size: 1.4em;
    }

    .cv-button {
        padding: 12px 22px;
        font-size: 13px;
    }

    .nav-links-container.active li {
        animation: slideIn 0.3s ease forwards;
        opacity: 0;
    }

    .nav-links-container.active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-links-container.active li:nth-child(2) { animation-delay: 0.2s; }
    .nav-links-container.active li:nth-child(3) { animation-delay: 0.3s; }
    .nav-links-container.active li:nth-child(4) { animation-delay: 0.4s; }
    .nav-links-container.active li:nth-child(5) { animation-delay: 0.5s; }
    .nav-links-container.active li:nth-child(6) { animation-delay: 0.6s; }
    .nav-links-container.active li:nth-child(7) { animation-delay: 0.7s; }
}

@media screen and (min-width: 981px) {
    .hamburger {
        display: none;
    }

    .navbar {
        display: flex;
        padding: 0 30px;
        justify-content: space-between;
    }

    .logo-link {
        flex: 0 0 auto;
        margin-left: -40px;
        z-index: 1010;
    }

    .navbar .logo {
        width: 186px;
        height: 100px;
        background-size: 232px;
        margin-left: 40px;
    }

    .nav-links-container {
        flex: 0 1 auto;
        position: absolute;
        left: 0;
        right: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        width: 100%;
        z-index: 0;
        padding-left: 400px;
        padding-right: 400px;
    }

    .navbar ul {
        flex-direction: row;
        gap: 30px;
        justify-content: center;
        margin-left: 25px;
    }

    .navbar ul a {
        font-size: 0.7em;
    }

    .cv-button {
        padding: 12px 24px;
        font-size: 15px;
    }

    .download-cv {
        flex: 0 0 auto;
        margin-left: auto;
        margin-right: 20px;
        position: relative;
        z-index: 1010;
    }
}

@media screen and (min-width: 1201px) {
    .navbar .logo {
        width: 450px;
        height: 220px;
        margin-left: -60px;
    }

    .navbar ul {
        margin-left: 20px;
        gap: 30px;
    }

    .navbar ul a {
        font-size: 0.9em;
    }

    .cv-button {
        font-size: 16px;
    }

    .download-cv {
        margin-right: 30px;
    }

    .nav-links-container {
        padding-left: 500px;
        padding-right: 500px;
    }
}

*:focus {
    outline: none !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .cv-button:hover,
    .navbar .logo:hover,
    .hamburger.active .bar:nth-child(1),
    .hamburger.active .bar:nth-child(3),
    .nav-links-container.active li {
        transform: none !important;
        animation: none !important;
    }
}

/* ---- Home ---- */
#Home {
    width: 100%;
    height: 100vh;
    height: 100svh;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

#home-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

#home-container canvas {
    background-color: var(--dark-bg) !important;
    transition: background-color 15s ease-out;
}

#Home::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,.7));
    z-index: -1;
}

.jumbotron {
    background-color: transparent;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.centerize {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.jumbotron h1 {
    font-size: clamp(1.8em, 5vw, 3.5em);
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,.6);
    animation: fadeInDown 0.8s ease-out;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 1.5px;
    line-height: 1.3;
    text-transform: capitalize;
    text-align: center;
    position: relative;
}

.jumbotron h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 2px;
    transition: width .3s ease, box-shadow .3s ease;
}

.jumbotron h1:hover::after {
    width: 80px;
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.55);
}

.jumbotron p {
    font-size: clamp(.9em, 3vw, 1.3em);
    margin: 15px 0 30px 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,.5);
    animation: fadeIn 1s ease-out;
    color: #f0f0f0;
    font-weight: 300;
    line-height: 1.6;
    text-align: center;
    max-width: 800px;
}

.social {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2vw, 15px);
    margin-top: 20px;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 0.8s;
    flex-wrap: wrap;
}

[class^="icon-"] {
    width: clamp(35px, 5vw, 40px);
    height: clamp(35px, 5vw, 40px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 0.8s;
}

.icon-white-bg {
    background-color: white;
}

.icon-yellow-bg {
    background-color: #ffdc52;
}

[class^="icon-"]:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.35);
}

.social-icon {
    width: clamp(20px, 3vw, 24px);
    height: clamp(20px, 3vw, 24px);
    transition: transform .3s ease;
}

#typed-output {
    color: white;
    font-size: clamp(18px, 4vw, 24px);
    font-family: 'Poppins', sans-serif;
    text-align: center;
    min-height: 32px;
    letter-spacing: 0.5px;
    margin-top: 30px;
    margin-bottom: 8px;
}

#typed-output::after {
    content: '|';
    display: inline-block;
    animation: cursorBlink 0.7s step-end infinite;
    margin-left: 2px;
    color: var(--accent-gold);
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Home Media Queries ---- */
@media screen and (max-width: 1285px) {
    .jumbotron {
        max-width: 1000px;
    }
}

@media screen and (max-width: 980px) {
    .jumbotron {
        max-width: 800px;
    }

    #Home {
        margin-top: -40px;
    }
}

@media screen and (max-width: 768px) {
    #Home {
        background-position: center center;
        margin-top: -50px;
    }

    .jumbotron {
        max-width: 720px;
        padding: 15px;
    }

    .centerize {
        padding: 0 15px;
    }
}

@media (max-width: 576px) {
    #Home {
        height: 100vh;
        height: 100svh;
        min-height: 0;
        padding: 16px 0 56px;
        margin-top: -50px;
        position: relative;
    }

    #Home::after {
        content: "";
        display: block;
        height: clamp(24px, 8vh, 64px);
    }

    .jumbotron { padding: 0 12px; }

    .jumbotron h1 {
        margin: 6px 0 8px;
        font-size: clamp(1.4rem, 6.5vw, 2rem);
        white-space: nowrap;
        line-height: 1.2;
        letter-spacing: .5px;
    }

    .jumbotron p {
        margin: 13px 0 20px;
        font-size: clamp(0.7rem, 3vw, 0.9rem);
        line-height: 1.35;
        letter-spacing: .2px;
        max-width: 520px;
    }

    .social { margin-top: 10px; gap: 10px; }
    [class^="icon-"] { width: 32px; height: 32px; }

    #home-container { backface-visibility: hidden; transform: translateZ(0); }
    #home-container canvas { background-color: var(--dark-bg) !important; transition: none !important; }
}

:target { scroll-margin-top: 84px; }

@media screen and (max-width: 480px) {
    #Home {
        width: 100%;
        margin-top: -50px;
    }

    .jumbotron {
        max-width: 100%;
        padding: 10px;
    }

    .centerize {
        padding: 0 10px;
    }

    .social {
        gap: 8px;
    }
}

@media screen and (max-width: 400px) {
    #Home {
        margin-top: -60px;
    }
}

@media screen and (min-height: 1000px) {
    .centerize {
        justify-content: flex-start;
        padding-top: 5vh;
    }
}

@media screen and (max-height: 600px) {
    .jumbotron p {
        margin: 10px 0 20px 0;
    }

    .social {
        margin-top: 10px;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .jumbotron h1,
    .jumbotron p {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .jumbotron h1,
    .jumbotron p,
    .social,
    [class^="icon-"],
    [class^="icon-"]:hover {
        animation: none !important;
        transform: none !important;
    }

    .jumbotron h1:hover::after {
        width: 60px;
        box-shadow: none;
    }
}

/* ---- About ---- */
#about {
    padding: 80px 0;
    background: linear-gradient(135deg, #e8f0fe, #f5f9ff);
    min-width: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

#about::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(232,240,254,.8), rgba(245,249,255,.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#about::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 10% 30%, rgba(61,15,117,.05) 0, transparent 70px),
        radial-gradient(circle at 90% 70%, rgba(61,15,117,.05) 0, transparent 70px);
    pointer-events: none;
}

.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1000px;
    width: 90%;
    gap: 40px;
    padding: 0 30px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

.about-image {
    flex: 0.8;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    animation: fadeInUp 1s ease-out forwards;
    width: 40%;
    max-width: 380px;
}

.about-image::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    background: rgba(61,15,117,.1);
    border-radius: var(--radius-xl);
    z-index: -1;
    transition: all .3s ease;
}

.about-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border: 3px solid #fff;
    border-radius: var(--radius-xl);
    box-shadow: 0 15px 30px rgba(61,15,117,.1);
    transition: all .4s ease;
    position: relative;
    display: block;
}

.about-image img::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(61,15,117,0) 0%, rgba(61,15,117,.2) 100%);
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
    z-index: 1;
}

.about-image:hover img {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(61,15,117,.15);
}

.about-image:hover img::before {
    opacity: 1;
}

.about-image:hover::after {
    transform: translate(5px, 5px);
    background: rgba(61,15,117,.15);
}

.about-details {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: rgba(255,255,255,.95);
    padding: 35px;
    border-radius: var(--radius-xl);
    box-shadow: 0 15px 30px rgba(61,15,117,.08);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeInUp 1s ease-out .3s forwards;
    opacity: 0;
    transition: transform .3s ease, box-shadow .3s ease;
    max-width: 550px;
}

.about-details:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 35px rgba(61,15,117,.12);
}

.about-details h2 {
    font-size: clamp(2em, 4vw, 2.5em);
    color: var(--primary-dark);
    font-weight: 600;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 20px;
    text-align: center;
    margin: 0 0 40px 0;
    line-height: 1.3;
}

.about-details h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-dark);
    border-radius: 2px;
    transition: width .3s ease;
}

.about-details h2:hover::after {
    width: 100px;
}

.about-details p {
    font-size: clamp(.95em, 2vw, 1.1em);
    line-height: 1.6;
    margin-bottom: 15px;
    color: #445668;
    font-weight: 400;
    text-align: justify;
}

.about-details strong {
    color: var(--primary-dark);
    font-weight: 500;
    position: relative;
}

.about-details strong::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(61,15,117,.2);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform .3s ease;
}

.about-details strong:hover {
    transform: translateY(-1px);
}

.about-details p:first-of-type {
    border-bottom: 1px solid rgba(61,15,117,.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
    position: relative;
}

.about-details p:first-of-type::after {
    content: '';
    position: absolute;
    height: 1px;
    width: 60px;
    bottom: -1px;
    right: 0;
    background: linear-gradient(90deg, rgba(61,15,117,0), rgba(61,15,117,.3));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    0%   { transform: scale(0) translate(-50%, -50%); opacity: 1; }
    100% { transform: scale(40) translate(-50%, -50%); opacity: 0; }
}

/* ---- About Media Queries ---- */
@media screen and (min-width: 1100px) {
    .about-container {
        max-width: 1000px;
        gap: 50px;
    }

    .about-image {
        padding-right: 10px;
        width: 34%;
        max-width: 340px;
    }

    .about-details {
        flex: 1;
        max-width: 650px;
        max-height: 550px;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .about-container {
        max-width: 90%;
        width: 90%;
        padding: 0 20px;
        gap: 30px;
    }

    .about-image {
        width: 30%;
        max-width: 280px;
        padding-right: 0;
    }

    .about-details {
        width: 70%;
        max-width: none;
        padding: 30px;
        min-height: 480px;
    }

    .about-details h2 {
        font-size: 2.1em;
        margin-bottom: 30px;
    }

    .about-details p {
        font-size: 1em;
    }
}

@media screen and (max-width: 768px) {
    .about-container {
        flex-direction: column;
        align-items: center;
        max-width: 90%;
        width: 90%;
    }

    .about-image {
        width: 65%;
        max-width: 320px;
        margin-bottom: 30px;
        justify-content: center;
    }

    .about-image img {
        max-width: 100%;
    }

    .about-details {
        width: 100%;
        max-width: 100%;
        padding: 25px;
        font-size: 0.95em;
        margin: 0 auto;
    }

    .about-details h2 {
        font-size: 1.8em;
        margin-bottom: 25px;
        padding-bottom: 15px;
    }

    .about-details p {
        margin-bottom: 12px;
    }
}

@media screen and (min-width: 481px) and (max-width: 767px) {
    .about-container {
        max-width: 90%;
        width: 90%;
    }

    .about-image {
        width: 70%;
        max-width: 350px;
    }

    .about-details {
        width: 100%;
        max-width: 100%;
        padding: 25px;
    }
}

@media screen and (min-width: 300px) and (max-width: 480px) {
    #about {
        padding: 50px 0;
        min-width: auto;
    }

    .about-container {
        max-width: 95%;
        width: 95%;
        padding: 0 10px;
    }

    .about-image {
        width: 80%;
        max-width: 240px;
        margin-bottom: 25px;
    }

    .about-image::after {
        top: 12px;
        left: 12px;
        right: -12px;
        bottom: -12px;
    }

    .about-image img {
        border-width: 2px;
    }

    .about-details {
        width: 85%;
        max-width: 100%;
        padding: 20px;
        font-size: 0.9em;
    }

    .about-details h2 {
        font-size: 1.5em;
        margin-bottom: 18px;
        padding-bottom: 12px;
    }

    .about-details p {
        line-height: 1.5;
        margin-bottom: 12px;
        font-size: 0.95em;
    }
}

@media screen and (max-width: 380px) {
    #about {
        min-width: 100%;
        padding: 40px 0;
    }

    .about-container {
        max-width: 95%;
        width: 95%;
        padding: 0;
    }

    .about-image {
        width: 85%;
        max-width: 240px;
        margin-bottom: 25px;
    }

    .about-image::after {
        top: 10px;
        left: 10px;
        right: -10px;
        bottom: -10px;
    }

    .about-image img {
        border-width: 2px;
    }

    .about-details {
        width: 100%;
        padding: 18px;
        font-size: 0.9em;
    }

    .about-details h2 {
        font-size: 1.6em;
        margin-bottom: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .about-image,
    .about-details,
    .about-image:hover img,
    .about-details:hover {
        transform: none;
    }

    .about-image:hover::after,
    .about-details h2:hover::after,
    .about-details strong:hover {
        transform: none;
    }
}

/* ---- Experience ---- */
#experience {
    background-color: var(--bg-light);
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Poppins', sans-serif;
}

#experience h2 {
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 2.6em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    margin-top: 0;
    line-height: 1.3;
}

#experience h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: width .3s ease;
}

#experience h2:hover::after {
    width: 100px;
}

.timeline-past, .timeline-present {
    font-weight: bold;
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.timeline-past::before, .timeline-present::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary) 20%, var(--primary) 80%, transparent);
    opacity: .6;
}

.timeline {
    position: relative;
    list-style: none;
    padding-top: 40px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    height: calc(100% + 10px);
    width: 2px;
    background: linear-gradient(to bottom, transparent, #aaa 5%, #aaa 95%, transparent);
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin: 60px auto;
    padding: 15px 20px;
    background-color: var(--bg-white);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 40%;
    text-align: center;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    z-index: 2;
}

.timeline-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.timeline-item:before {
    content: attr(data-year);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-amber);
    color: var(--text-light);
    font-size: 1em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    box-shadow: var(--shadow-sm);
    transition: all .3s ease;
}

.timeline-item:hover::before {
    transform: translateX(-50%) scale(1.1);
    box-shadow: var(--shadow-md);
}

.timeline-item h3 {
    color: var(--primary);
    font-size: 1.2em;
    margin-bottom: 10px;
    transition: color .3s ease;
    font-weight: 600;
    line-height: 1.3;
}

.timeline-item:hover h3 {
    color: var(--primary-dark);
}

.timeline-item p {
    color: var(--text-muted);
    font-size: .9em;
    margin-top: 8px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.flag {
    font-size: 1.1em;
    display: inline-block;
    vertical-align: middle;
    margin-top: -3px;
    line-height: 1;
    transform: scale(1);
    transition: transform .2s ease;
}

.timeline-item:hover .flag {
    transform: scale(1.2);
}

.timeline-item p br { display: none; }

/* ---- Experience Media Queries ---- */
@media screen and (max-width: 1024px) {
    .timeline-item { width: 45%; }
}

@media screen and (max-width: 768px) {
    .timeline::before { left: 50%; }

    .timeline-item {
        width: 80%;
        margin: 60px auto;
    }

    .timeline-item:before,
    .timeline-item:hover:before {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media screen and (max-width: 500px) {
    #experience {
        padding: 50px 15px;
    }

    #experience h2 {
        font-size: 2.2em;
        margin-bottom: 25px;
    }

    .timeline-past, .timeline-present {
        font-size: 1.6em;
        margin-bottom: 15px;
    }

    .timeline {
        padding-top: 30px;
    }

    .timeline-item {
        width: 85%;
        padding: 15px;
        margin: 50px auto;
        font-size: 0.95em;
    }

    .timeline-item:before {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 0.95em;
        top: -35px;
    }

    .timeline-item h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }

    .timeline-item p {
        font-size: 0.85em;
        line-height: 1.4;
        margin-top: 6px;
        margin-bottom: 6px;
    }

    .flag { font-size: 1em; }
}

@media screen and (max-width: 380px) {
    #experience {
        padding: 40px 15px;
        min-width: auto;
    }

    #experience h2 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .timeline-past, .timeline-present {
        font-size: 1.5em;
        margin-bottom: 12px;
    }

    .timeline {
        padding-top: 25px;
    }

    .timeline-item {
        width: 80%;
        padding: 12px;
        margin: 45px auto;
        font-size: 0.9em;
        border-width: 1px;
    }

    .timeline-item:before {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 0.9em;
        top: -30px;
    }

    .timeline-item h3 {
        font-size: 1em;
        margin-bottom: 6px;
    }

    .timeline-item p {
        font-size: 0.8em;
        line-height: 1.3;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .flag { font-size: 0.9em; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .timeline-item:hover,
    .timeline-item:hover::before,
    .timeline-item:hover .flag {
        transform: none;
    }

    #experience h2:hover::after {
        width: 60px;
    }
}

/* ---- Education ---- */
#education {
    background: url('../assets/Images/clouds.webp') center/cover no-repeat fixed;
    width: 100%;
    margin: 0;
    padding: 60px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

#education::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(61,15,117,.90), rgba(61,15,117,.70));
    z-index: 0;
    transition: background .5s ease;
}

#education:hover::before {
    background: linear-gradient(135deg, rgba(61,15,117,.85), rgba(61,15,117,.75));
}

#education h2 {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: clamp(1.8em, 5vw, 2.6em);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    margin-top: 0;
    line-height: 1.3;
}

#education h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 2px;
    transition: width .3s ease, box-shadow .3s ease;
}

#education h2:hover::after {
    width: 80px;
    box-shadow: 0 0 8px rgba(255, 184, 0, 0.6);
}

.education-item {
    background-color: rgba(255,255,255,.95);
    border: 2px solid rgba(255,255,255,.1);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 30px);
    margin: 20px auto;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: all .3s ease;
    z-index: 1;
}

.education-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,.2);
    background-color: var(--bg-white);
    border-color: rgba(61,15,117,.3);
}

.education-item::before {
    content: '🎓';
    font-size: clamp(1.5em, 4vw, 2em);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    background-image: linear-gradient(145deg, var(--primary), var(--primary-light));
    color: var(--text-light);
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all .3s ease, background-image .3s ease;
}

.education-item:hover::before {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 6px 12px rgba(232, 118, 10, 0.4), 0 0 15px rgba(255, 184, 0, 0.3);
    background-image: linear-gradient(145deg, var(--accent-amber), var(--accent-gold));
}

.education-item h3 {
    color: var(--primary);
    font-size: clamp(1.1em, 3vw, 1.3em);
    margin-bottom: 10px;
    margin-top: 15px;
    font-weight: 600;
    transition: transform .3s ease;
    line-height: 1.3;
}

.education-item:hover h3 {
    transform: scale(1.02);
}

.education-item p {
    color: var(--text-muted);
    font-size: clamp(.9em, 2vw, 1em);
    line-height: 1.6;
    margin-bottom: 8px;
}

.education-item p:last-child {
    color: var(--primary-dark);
    font-weight: 500;
    font-size: clamp(.85em, 2vw, .95em);
    transition: color .3s ease;
}

.education-item:hover p:last-child {
    color: var(--primary);
}

/* ---- Education Media Queries ---- */
@media screen and (max-width: 768px) {
    #education {
        background-attachment: scroll;
        background-position: center center;
        padding: 40px 0;
    }

    .education-item { width: 80%; }
}

@media screen and (max-width: 480px) {
    #education {
        background-size: cover;
        padding: 30px 0;
    }

    .education-item {
        width: 90%;
        margin: 30px auto;
    }
}

@supports (-webkit-touch-callout: none) {
    #education { background-attachment: scroll; }
}

@media screen and (orientation: portrait) {
    #education { background-position: center center; }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    #education {
        min-height: auto;
        padding: 40px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #education::before,
    .education-item,
    .education-item::before,
    .education-item h3,
    .education-item p:last-child,
    #education h2::after {
        transition: none !important;
    }

    .education-item:hover,
    .education-item:hover::before,
    .education-item:hover h3 {
        transform: none !important;
        box-shadow: var(--shadow-lg) !important;
    }

    #education h2:hover::after {
        width: 60px !important;
        box-shadow: none !important;
    }
}

/* ---- Skills ---- */
#skills-modal {
    background-color: #fdfdfd;
    padding: 40px;
    width: 100%;
    max-width: 800px;
    margin: 80px auto 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    transition: transform .3s ease, box-shadow .3s ease;
    font-family: 'Poppins', sans-serif;
}

#skills-modal:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#skills-modal h2 {
    color: var(--primary);
    text-align: center;
    font-size: 2.6em;
    margin-bottom: 30px;
    text-transform: uppercase;
    position: relative;
    font-weight: bold;
    line-height: 1.3;
    margin-top: 0;
}

#skills-modal h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: width .3s ease;
}

#skills-modal h2:hover::after {
    width: 100px;
}

.skills-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.skills-filter .skill-filter-btn {
    padding: 10px 25px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary);
    background: none;
    color: var(--primary);
    font-weight: bold;
    cursor: pointer;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

.skills-filter .skill-filter-btn.active {
    background-color: var(--primary);
    color: var(--text-light);
}

.skills-filter .skill-filter-btn:hover:not(.active) {
    background-color: rgba(61,15,117,.08);
}

.skills-filter .skill-filter-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255,255,255,.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 0 0;
}

.skills-filter .skill-filter-btn:focus::after {
    animation: ripple .5s ease-out;
}

.skill-row {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform .3s ease, box-shadow .3s ease;
}

.skill-row:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 8px rgba(0,0,0,.08);
    border-left: 3px solid var(--primary);
}

.skill-name {
    flex: 2;
    font-weight: bold;
    color: var(--text-dark);
    min-width: 150px;
}

.language-skills { display: none; }
.language-skills .skill-level { color: var(--primary); font-weight: bold; }

.tech-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.tech-logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 18px 10px;
    box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease;
    gap: 10px;
    cursor: default;
}

.tech-logo-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.tech-logo-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.tech-logo-item span {
    font-size: .78em;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

/* ---- Skills Media Queries ---- */
@media (min-width: 900px) {
    #skills-modal {
        margin: 20px auto;
        padding: 40px;
        width: 800px;
    }

    .skill-row { margin-bottom: 15px; }
    .skill-name { flex: 2; min-width: 150px; }
}

@media (min-width: 769px) and (max-width: 899px) {
    #skills-modal {
        margin: 20px;
        width: auto;
        max-width: calc(100% - 40px);
    }
}

@media (max-width: 768px) {
    #skills-modal {
        padding: 20px;
        margin: 30px;
        background-color: #f5f5f5;
        width: auto;
        max-width: calc(100% - 60px);
    }

    .skill-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        margin-bottom: 10px;
        box-shadow: none;
    }

    .skill-name {
        font-weight: bold;
        min-width: auto;
        flex: none;
        margin: 0;
    }

    .skills-filter {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 20px;
    }

    .skills-filter .skill-filter-btn {
        padding: 8px 20px;
        font-size: 14px;
        flex: 1;
        max-width: 200px;
    }

    #skills-modal h2 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .language-skills .skill-row {
        flex-direction: row;
        justify-content: space-between;
    }

    .language-skills .skill-level { text-align: right; }

    .tech-logo-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 14px;
    }

    .tech-logo-item img { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #skills-modal:hover,
    .skill-row:hover,
    .skills-filter .skill-filter-btn:focus::after {
        transform: none !important;
        animation: none !important;
    }

    #skills-modal h2:hover::after {
        width: 60px !important;
    }

    .skill-row:hover {
        border-left: none !important;
    }
}

/* ---- Certifications ---- */
#certifications {
    background: var(--bg-light);
    padding: 40px 10px;
    margin: 0;
    margin-top: 20px;
    text-align: center;
    color: var(--text-dark);
    position: relative;
    font-family: 'Poppins', sans-serif;
}

#certifications h2 {
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 2.6em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    display: inline-block;
    z-index: 1;
}

#certifications h2::after {
    content: '';
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    display: block;
    margin: 10px auto 0;
    border-radius: 2px;
    transition: width .3s ease;
}

#certifications h2:hover::after {
    width: 100px;
}

.certifications-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 25px;
    position: relative;
    z-index: 1;
    row-gap: 25px;
}

.certification-item {
    background: var(--bg-white);
    border: none;
    border-radius: var(--radius-xl);
    padding: 25px 15px 15px;
    margin: 15px 5px;
    box-shadow: var(--shadow-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    width: calc(100% - 10px);
    height: 280px;
    justify-self: center;
    transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease;
    justify-content: space-between;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .certification-item {
        transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease, height .3s ease, max-width .3s ease;
    }
}

.certification-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background-color: #fefaf7;
}

.certification-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent-amber));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease;
}

.certification-item:hover::after {
    transform: scaleX(1);
}

.certification-item::before {
    content: '🏆';
    background: var(--accent-amber);
    color: var(--text-light);
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: background .3s ease, transform .3s ease;
    z-index: 2;
}

.certification-item:hover::before {
    background: var(--secondary-light);
    transform: translateX(-50%) rotate(10deg);
}

.certification-header {
    margin-top: 45px;
    margin-bottom: 5px;
}

.year {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--accent-amber);
    margin-bottom: 8px;
    letter-spacing: .5px;
    transition: transform .3s ease;
}

.certification-item:hover .year {
    transform: scale(1.05);
}

.certification-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    width: 100%;
    padding: 0 10px;
}

.certification-content h3 {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    transition: color .3s ease;
    line-height: 1.3;
    max-height: 4em;
    overflow: hidden;
}

.certification-item:hover .certification-content h3 {
    color: var(--accent-amber);
}

.provider {
    font-size: 1em;
    color: #555;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.4;
}

.validate-link {
    font-size: 1em;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--accent-gold);
    padding: 10px 0;
    border-radius: var(--radius-full);
    display: block;
    width: 90%;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: all .3s ease-in-out;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    margin: 0 auto 15px;
}

.validate-link::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.3) 0%, transparent 70%);
    transform: translate(-100%, -100%);
    opacity: 0;
    transition: transform .5s, opacity .5s;
    z-index: 1;
}

.validate-link:hover::before {
    transform: translate(0, 0);
    opacity: 1;
}

.validate-link:hover {
    background: var(--accent-amber);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(232, 118, 10, 0.35);
}

.certificate-filters {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 15px 10px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    overflow: hidden;
}

.certificate-filters h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 8px;
    padding-left: 5px;
    padding-right: 5px;
}

.filter-buttons::-webkit-scrollbar {
    height: 0;
    width: 0;
    display: none;
}

.filter-btn {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    padding: 6px 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    min-width: 55px;
    max-width: 55px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--accent-amber);
    color: var(--text-light);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--text-light);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 8px rgba(61, 15, 117, 0.3);
}

.certificate-pagination {
    max-width: 1200px;
    margin: 30px auto 0;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.pagination-info {
    font-size: 0.95em;
    color: var(--text-dark);
    font-weight: 500;
}

.pagination-nav {
    display: flex;
    gap: 10px;
}

.pagination-btn {
    background: var(--bg-light);
    color: var(--text-dark);
    border: none;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    min-width: 110px;
    position: relative;
    overflow: hidden;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--text-light);
    transform: translateY(-2px);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.no-certificates {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    font-size: 1.2em;
    color: var(--text-dark);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ---- Certifications Media Queries ---- */
@media screen and (max-width: 1024px) {
    .certifications-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .certification-item {
        width: 100%;
        max-width: 300px;
    }
}

@media screen and (max-width: 980px) {
    .certifications-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .certification-item {
        width: 90%;
        min-width: 280px;
        height: 260px;
        padding: 20px 12px 15px;
        margin: 0 auto;
    }

    .certification-item::before {
        width: 45px;
        height: 45px;
        font-size: 20px;
        top: 9px;
    }

    .certification-content h3 {
        font-size: 1.1em;
    }

    .provider {
        font-size: 0.9em;
        margin-bottom: 15px;
    }

    .validate-link {
        padding: 8px 0;
        font-size: 0.9em;
        margin-bottom: 10px;
    }
}

@media screen and (max-width: 930px) {
    .certifications-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .certification-item {
        width: 90%;
        height: 240px;
        max-width: 280px;
    }
}

@media screen and (max-width: 768px) {
    #certifications h2 { font-size: 1.8em; }

    .certifications-container {
        gap: 15px 20px;
        padding: 10px 15px;
    }

    .certification-item {
        width: 90%;
        height: 240px;
        max-width: 280px;
    }

    .certificate-pagination {
        flex-direction: column;
        gap: 10px;
    }

    .pagination-info {
        margin-bottom: 10px;
    }

    .pagination-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

@media screen and (max-width: 630px) {
    .certifications-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 10px 20px;
    }

    .certification-item {
        min-width: min-content;
        height: 200px;
        padding: 15px 10px 10px;
    }

    .year { font-size: 1em; }

    .certification-content h3 { font-size: 0.9em; }

    .provider { font-size: 0.8em; }

    .validate-link {
        padding: 6px 0;
        font-size: 0.8em;
    }

    .pagination-btn {
        padding: 5px 10px;
        font-size: 0.8em;
        min-width: 90px;
    }
}

@media (max-width: 576px) {
    #certifications h2 {
        color: var(--primary);
        font-size: 2em !important;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1px;
        line-height: 1.3;
        margin: 0 0 30px;
        position: relative;
        display: inline-block;
    }

    #certifications h2::after {
        content: '';
        width: 60px;
        height: 4px;
        background-color: var(--primary);
        display: block;
        margin: 10px auto 0;
        border-radius: 2px;
        transition: width .3s ease, box-shadow .3s ease;
    }

    #certifications h2:hover::after {
        width: 100px;
        box-shadow: 0 0 8px rgba(61, 15, 117, .3);
    }

    #certifications {
        min-height: auto !important;
        padding-bottom: 12px !important;
        margin-bottom: 0 !important;
    }

    .certificate-pagination {
        margin-top: 12px !important;
    }
}

@media screen and (max-width: 500px) {
    #certifications { padding: 20px 5px; }
    #certifications h2 { font-size: 2em !important; }

    .certifications-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 10px 20px;
    }

    .certification-item {
        padding: 12px 8px;
        margin: 0 auto;
        width: 90%;
        height: 175px;
        max-width: 220px;
    }

    .certification-item::before {
        width: 35px;
        height: 35px;
        font-size: 14px;
        top: 10px;
    }

    .certification-header { margin-top: 40px; }

    .year {
        font-size: 0.9em;
        margin-bottom: 3px;
    }

    .certification-content h3 {
        font-size: 0.7em;
        margin-bottom: 3px;
        line-height: 1.2;
    }

    .provider {
        font-size: 0.75em;
        margin-bottom: 8px;
        line-height: 1.2;
    }

    .validate-link {
        padding: 5px 0;
        font-size: 0.75em;
        letter-spacing: 0.5px;
        width: 85%;
        margin-bottom: 5px;
    }

    .certificate-filters h3 { font-size: 1.2em; }
    .filter-btn { padding: 5px 10px; font-size: 0.85em; }
    .certificate-pagination { flex-direction: column; gap: 10px; }
    .pagination-info { margin-bottom: 10px; }
}

@media screen and (max-width: 480px) {
    .pagination-btn {
        padding: 4px 8px;
        font-size: 0.75em;
        min-width: 80px;
    }
}

@media screen and (max-width: 400px) {
    .certification-item { height: 200px; }

    .certifications-container {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
        padding: 10px 20px;
    }

    .filter-buttons { gap: 0px; }

    .filter-btn {
        padding: 4px 8px;
        font-size: 0.75em;
        margin-bottom: 5px;
    }

    .pagination-btn { padding: 6px 12px; font-size: 0.85em; }
}

@media screen and (max-width: 399px) {
    .certification-item {
        height: 190px;
        padding: 10px 5px;
    }

    .certificate-filters {
        padding: 24px 15px 0 15px;
    }

    .certification-content h3 { font-size: 0.8em; }

    .provider {
        font-size: 0.7em;
        margin-bottom: 10px;
    }

    .validate-link {
        padding: 4px 10px;
        font-size: 0.65em;
    }

    .certificate-filters h3 { font-size: 1.1em; }

    .filter-btn {
        padding: 3px 6px;
        font-size: 0.7em;
        min-width: 20px;
        gap: 0px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .certification-item:hover,
    .filter-btn:hover,
    .pagination-btn:hover:not(:disabled),
    .validate-link:hover {
        transform: none;
    }

    .certification-item:hover::after,
    .certification-item:hover::before,
    .certification-item:hover .year,
    .validate-link:hover::before {
        transform: none;
    }
}

/* ---- Projects ---- */
.section {
    padding: 40px 0;
    text-align: center;
    background: var(--bg-light);
    position: relative;
    font-family: 'Poppins', sans-serif;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 20px 20px;
    opacity: .5;
    pointer-events: none;
}

#projects h2 {
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 2.6em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    z-index: 1;
    line-height: 1.3;
    margin-top: 0;
}

#projects h2::after {
    content: '';
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    display: block;
    margin: 10px auto 0;
    border-radius: 2px;
    transition: width .3s ease, box-shadow .3s ease;
}

#projects h2:hover::after {
    width: 100px;
    box-shadow: 0 0 8px rgba(61, 15, 117, .3);
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.project {
    text-decoration: none;
    color: inherit;
    display: grid;
}

.project div {
    background-color: var(--bg-white);
    padding: 15px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all .3s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 3px solid transparent;
    position: relative;
}

.project div::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 0;
    border-radius: var(--radius-md);
    background-color: rgba(61,15,117,.03);
    z-index: -1;
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
    transform: translateY(5px);
}

.project div:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--primary-light);
}

.project div:hover::before {
    opacity: 1;
    transform: translateY(8px);
}

.project h3 {
    margin: 0 0 5px;
    font-size: 1.1em;
    font-weight: 600;
    transition: color .3s ease;
    line-height: 1.3;
}

.project div:hover h3 { color: var(--primary); }

.project p {
    margin: 0;
    font-size: .85em;
    color: #666;
    line-height: 1.6;
}

/* ---- Projects Media Queries ---- */
@media screen and (max-width: 1024px) {
    .projects-container { grid-template-columns: repeat(3, 1fr); }
}

@media screen and (max-width: 768px) {
    .projects-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 15px;
    }

    #projects h2 { font-size: 2em; }

    .project div {
        padding: 12px;
        min-height: 70px;
    }
}

@media screen and (max-width: 480px) {
    .section { padding: 10px 0 50px; }

    .projects-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 10px;
        gap: 10px;
    }

    .project div {
        padding: 12px;
        min-height: 70px;
        width: 100%;
    }

    .project h3 { font-size: .85em; }
    .project p { font-size: .72em; }
}

@media (hover: hover) {
    .project div:hover { transform: translateY(-2px); }
}

/* ---- Projects Modal ---- */
.project-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow: hidden;
}

.modal-content {
    background-color: var(--dark-bg);
    padding: 42px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    text-align: center;
    transform: translateY(30px);
    opacity: 0;
    animation: modalSlideIn 0.4s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes modalSlideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 22px;
    top: 18px;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    padding: 10px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    transform: rotate(0deg);
}

.close-modal:hover {
    color: #ffffff;
    background-color: transparent;
    transform: rotate(90deg);
}

.modal-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.15);
    background-color: rgba(255,255,255,.08);
}

.modal-content h2 {
    margin: 0 0 24px 0;
    color: #ffffff;
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.modal-content p {
    margin-bottom: 34px;
    color: #cccccc;
    line-height: 1.7;
    text-align: left;
    font-size: 17px;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 14px;
}

.modal-body-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-body-row .modal-description {
    flex: 1;
    margin: 0;
    color: #cccccc;
    line-height: 1.65;
    font-size: 15px;
    text-align: left;
}

.modal-stack-box {
    flex-shrink: 0;
    width: 120px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-stack-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.modal-stack-tag {
    font-size: 12px;
    font-weight: 500;
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 500px) {
    .modal-body-row {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .modal-stack-box {
        width: 110px;
        flex-direction: column;
        flex-shrink: 0;
    }
}

.modal-btn {
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.demo-btn {
    background-color: var(--accent-amber);
    color: white;
}

.demo-btn:hover {
    background-color: #d4690a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(232, 118, 10, 0.35);
}

.coming-soon-btn {
    transition: opacity 0.2s ease, background-color 0.3s ease;
}

.download-btn {
    background-color: var(--accent-amber);
    color: white;
}

.download-btn:hover {
    background-color: #d4690a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(232, 118, 10, 0.35);
}

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

.readme-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(61, 15, 117, 0.35);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 28px 20px;
        max-width: 90%;
        margin: 0 16px;
    }

    .modal-buttons {
        flex-direction: row;
        gap: 12px;
    }

    .modal-btn {
        flex: 1;
        padding: 14px 10px;
    }

    .close-modal {
        right: 12px;
        top: 12px;
        font-size: 30px;
        padding: 8px;
    }

    .modal-content h2 {
        font-size: 24px;
        padding-right: 0;
        text-align: center;
    }
}

@media (max-width: 576px) {
    #projects.section {
        padding-top: 50px !important;
    }
}

@media (prefers-color-scheme: dark) {
    .modal-content {
        background-color: var(--dark-bg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .close-modal { color: #aaa; }

    .close-modal:hover {
        color: #fff;
        background-color: transparent;
    }

    .modal-content h2 { color: #f0f0f0; }
    .modal-content p { color: #bbb; }

    .demo-btn { background-color: var(--accent-amber); }
    .demo-btn:hover { background-color: #d4690a; }
}

.message-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-weight: 500;
    animation: slideInRight 0.3s cubic-bezier(0.19, 1, 0.22, 1), fadeOut 0.5s ease 2.5s forwards;
    max-width: 300px;
}

.message-popup.info    { background-color: var(--primary); color: white; }
.message-popup.success { background-color: var(--color-success); color: white; }
.message-popup.error   { background-color: var(--color-error); color: white; }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .project:hover,
    .modal-btn:hover,
    .close-modal:hover,
    .tech-logo-item:hover {
        transform: none !important;
    }

    #projects h2:hover::after {
        width: 60px !important;
        box-shadow: none !important;
    }
}

/* ---- Contact ---- */
.floating-contact-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1),
                background-color 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    -webkit-tap-highlight-color: transparent;
    isolation: isolate;
}

.floating-contact-btn::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.85);
    pointer-events: none;
    box-shadow: 0 10px 18px rgba(61, 15, 117, 0.3);
}

.floating-contact-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-light);
}

.floating-contact-btn:hover::after {
    border-color: rgba(0, 0, 0, 1);
    box-shadow: 0 12px 22px rgba(61, 15, 117, 0.35);
}

.floating-contact-btn:active {
    transform: scale(0.95);
    background-color: var(--primary-dark);
}

.floating-contact-btn svg,
.floating-contact-btn path {
    filter: none !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active {
    opacity: 1;
}

.contact-modal {
    background-color: #fff;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-overlay.active .contact-modal {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.close-modal {
    background-color: transparent !important;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.2s ease;
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: -10px;
    -webkit-tap-highlight-color: transparent;
}

.close-modal:hover,
.close-modal:active,
.close-modal:focus {
    color: #999;
    background-color: transparent !important;
    transform: rotate(90deg);
    outline: none;
    box-shadow: none;
}

.modal-body {
    padding: 30px;
}

#contact-form .form-group {
    margin-bottom: 20px;
}

#contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 15px;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(61, 15, 117, 0.1);
}

#contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background-color: var(--primary);
    color: var(--text-light);
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.submit-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(61, 15, 117, 0.3);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn:disabled {
    background-color: var(--primary-light);
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#form-status {
    text-align: center;
    margin: 15px 0;
    font-weight: 500;
    min-height: 24px;
    font-size: 14px;
}

.form-group .required {
    color: var(--color-error);
    margin-left: 2px;
}

input:invalid,
textarea:invalid {
    border-color: var(--color-error);
}

@media (min-width: 769px) {
    #contact-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 20px;
    }

    #contact-form .form-group:nth-child(1),
    #contact-form .form-group:nth-child(2) {
        grid-column: span 1;
    }

    #contact-form .form-group:nth-child(3) {
        grid-column: span 2;
    }

    #contact-form .form-group:nth-child(4) {
        grid-column: span 2;
    }

    #contact-form #form-status {
        grid-column: span 2;
    }

    #contact-form .form-group:last-child {
        grid-column: span 2;
    }

    #contact-form textarea {
        min-height: 90px;
    }
}

@media (max-width: 768px) {
    .floating-contact-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .modal-header { padding: 15px 20px; }
    .modal-body { padding: 20px; }

    #contact-form input,
    #contact-form textarea {
        padding: 10px 12px;
    }

    .submit-btn { padding: 12px 16px; }
}

@media (prefers-color-scheme: dark) {
    .contact-modal {
        background-color: #ffffff;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .modal-header {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        background-color: rgba(0, 0, 0, 0.02);
    }

    .modal-header h3 { color: var(--primary); }

    .close-modal:hover {
        background-color: transparent;
        color: #999;
    }

    #contact-form label { color: var(--text-dark); }

    #contact-form input,
    #contact-form textarea {
        background-color: #fafafa;
        border-color: #ddd;
        color: var(--text-dark);
    }

    #contact-form input:focus,
    #contact-form textarea:focus {
        background-color: #fff;
        border-color: var(--primary-light);
        box-shadow: 0 0 0 3px rgba(61, 15, 117, 0.1);
    }
}

/* ---- README Modal ---- */
.readme-modal {
    background-color: #131f40;
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
}

#readme-modal-overlay {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    overflow-x: hidden;
}

.modal-overlay.active .readme-modal {
    transform: translateY(0);
    opacity: 1;
}

.readme-modal .modal-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(13, 27, 62, 0.6);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.readme-modal .modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    text-align: center;
    grid-column: 2;
}

.readme-modal .close-modal {
    grid-column: 3;
    position: static;
    margin: 0;
    color: #999;
    justify-self: end;
    transform: rotate(0deg);
}

.readme-modal .close-modal:hover {
    transform: rotate(90deg);
    color: #ffffff;
    background-color: transparent;
}

.readme-modal-body {
    padding: 30px;
    overflow-y: auto;
    color: #cccccc;
    font-size: 15px;
    line-height: 1.7;
    flex: 1;
}

.readme-modal-body h1,
.readme-modal-body h2,
.readme-modal-body h3,
.readme-modal-body h4 {
    color: #ffffff;
    margin-top: 24px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.readme-modal-body h1 { font-size: 1.4em; }
.readme-modal-body h2 { font-size: 1.2em; }
.readme-modal-body h3 { font-size: 1.05em; }

.readme-modal-body p {
    margin-bottom: 14px;
    color: #cccccc;
}

.readme-modal-body a {
    color: var(--accent-gold);
    text-decoration: none;
}

.readme-modal-body a:hover {
    text-decoration: underline;
}

.readme-modal-body code {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.88em;
    color: #e0e0e0;
}

.readme-modal-body pre {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.readme-modal-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
}

.readme-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.9em;
}

.readme-modal-body th,
.readme-modal-body td {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.readme-modal-body th {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-weight: 600;
}

.readme-modal-body ul,
.readme-modal-body ol {
    padding-left: 24px;
    margin-bottom: 14px;
}

.readme-modal-body li {
    margin-bottom: 6px;
}

.readme-modal-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.readme-modal-body img {
    max-width: 80px;
    max-height: 80px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
    margin: 0 auto 20px;
    display: block;
}

.readme-modal-body div[align="center"] {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-bottom: 10px;
}

.readme-modal-body div[align="center"] img {
    margin: 0 auto;
}

.readme-modal-body div[align="center"] p {
    text-align: center;
    margin: 0;
    line-height: 1.8;
}

.readme-modal-body div[align="center"] p img {
    width: auto;
    height: 20px;
    max-width: none;
    max-height: 20px;
    border-radius: 0;
    border: none;
    background: none;
    display: inline;
    vertical-align: middle;
    margin: 2px 3px;
}

.readme-modal-body blockquote {
    border-left: 3px solid var(--accent-gold);
    padding-left: 16px;
    margin: 16px 0;
    color: #aaaaaa;
    font-style: italic;
}

.readme-modal-body div[align="center"] {
    text-align: center;
}

.readme-modal-body div[align="center"] h1,
.readme-modal-body div[align="center"] h2,
.readme-modal-body div[align="center"] h3,
.readme-modal-body div[align="center"] h4,
.readme-modal-body div[align="center"] p {
    text-align: center;
}

.readme-modal-body div[align="center"] img {
    margin: 0 auto;
}

@media (max-width: 768px) {
    .readme-modal {
        width: 95%;
        max-height: 80vh;
        height: 80vh;
        margin: 0;
    }

    .readme-modal .modal-header {
        padding: 15px 16px;
        grid-template-columns: 30px 1fr 30px;
    }

    .readme-modal .modal-header h3 {
        font-size: 1rem;
    }

    .readme-modal-body {
        padding: 16px;
        font-size: 13px;
        overflow-y: auto;
        flex: 1;
    }

    .readme-modal-body table {
        font-size: 0.8em;
    }

    .readme-modal-body th,
    .readme-modal-body td {
        padding: 6px 8px;
    }
}

/* ---- Footer ---- */
footer {
    background: var(--dark-bg);
    color: var(--text-light);
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
                transparent 0%,
                var(--accent-gold) 50%,
                transparent 100%);
    opacity: .45;
}

footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,.03) 0, transparent 60px);
    pointer-events: none;
    opacity: .5;
}

footer p {
    margin: 8px 0;
    font-size: clamp(.85em, 2vw, .95em);
    font-weight: 300;
    letter-spacing: .5px;
    color: var(--text-light);
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

footer a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all .3s ease;
    position: relative;
    display: inline-block;
}

footer a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-gold);
    transition: width .3s ease, box-shadow .3s ease;
}

footer a:hover {
    color: var(--accent-gold);
    transform: translateY(-1px);
}

footer a:hover::after {
    width: 100%;
    box-shadow: 0 0 5px rgba(255, 184, 0, 0.5);
}

/* ---- Footer Media Queries ---- */
@media screen and (max-width: 768px) {
    footer { padding: 25px 0; }
}

@media screen and (max-width: 480px) {
    footer { padding: 20px 0; }
    footer p { margin: 6px 0; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    footer a:hover {
        transform: none !important;
    }

    footer a:hover::after {
        transition: none !important;
        box-shadow: none !important;
    }
}