/* ===== 404 PAGE ===== */
.error-page {
    background-color: var(--body-color);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.error__container {
    max-width: 600px;
    width: 100%;
}

.error__title {
    font-size: 8rem;
    font-weight: var(--font-bold);
    color: var(--first-color);
    margin-bottom: 0.5rem;
    line-height: 1;
    animation: fadeInDown 1s ease;
}

.error__subtitle {
    font-size: 2rem;
    color: var(--title-color);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.error__description {
    color: var(--text-color);
    margin-bottom: 2.5rem;
    animation: fadeIn 1s ease 0.6s both;
}

.error__animation {
    position: relative;
    height: 200px;
    margin: 3rem 0;
    animation: fadeIn 1s ease 0.9s both;
}

.rocket {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--first-color);
    animation: float 3s ease-in-out infinite;
}

.planet {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background: var(--first-color);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(108, 99, 255, 0.3);
}

.planet::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.button {
    display: inline-flex;
    align-items: center;
    background-color: var(--first-color);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: var(--font-medium);
    transition: 0.3s;
    text-decoration: none;
    animation: fadeIn 1s ease 1.2s both;
}

.button:hover {
    background-color: var(--first-color-alt);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

.button__icon {
    margin-left: 0.5rem;
    transition: 0.3s;
}

.button:hover .button__icon {
    transform: translateX(5px);
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-20px);
    }
}

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

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

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

/* ===== VARIABLES ===== */
:root {
    /* Colors */
    --first-color: #6c63ff;
    --first-color-alt: #5a52d3;
    --title-color: #2d2e32;
    --text-color: #555;
    --text-color-light: #888;
    --body-color: #f9f9f9;
    --container-color: #fff;
    
    /* Typography */
    --body-font: 'Poppins', sans-serif;
    --big-font-size: 2.5rem;
    --h1-font-size: 2.25rem;
    --h2-font-size: 1.5rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: 0.875rem;
    --smaller-font-size: 0.75rem;
    
    /* Font Weight */
    --font-medium: 500;
    --font-semi-bold: 600;
    --font-bold: 700;
    
    /* Margins */
    --mb-0-5: 0.5rem;
    --mb-0-75: 0.75rem;
    --mb-1: 1rem;
    --mb-1-5: 1.5rem;
    --mb-2: 2rem;
    --mb-2-5: 2.5rem;
    --mb-3: 3rem;
    
    /* Z-index */
    --z-tooltip: 10;
    --z-fixed: 100;
    --z-modal: 1000;
}

/* Stronger desktop enforcement in case of odd cascades */
@media screen and (min-width: 992px) {
    .nav__menu {
        position: static !important;
        right: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
    }
    .nav__list { display: flex !important; }
}

/* Lock scroll while loading */
body.is-loading {
    overflow: hidden;
}

/* Hide content until loader finishes */
body.is-loading .header,
body.is-loading .main,
body.is-loading .footer {
    visibility: hidden;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* prevent horizontal overflow at root */
}

body {
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    background-color: var(--body-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    color: var(--title-color);
    font-weight: var(--font-semi-bold);
    line-height: 1.2;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--header-height); /* Account for fixed header */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    width: 100%;
    padding: 5rem 0;
    margin: 0 auto;
}

/* ===== HEADER & NAVIGATION ===== */
:root {
    --header-height: 2rem;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--container-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    z-index: var(--z-fixed);
    padding: 0; /* tighter header */
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav__logo {
    font-size: 1.25rem;
    font-weight: var(--font-semi-bold);
    color: var(--title-color);
    text-decoration: none;
}

/* Navigation Menu */
.nav__menu {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push menu to the right */
    position: relative; /* default inline in header */
    background: transparent;
    box-shadow: none;
    height: auto;
}

.nav__list {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav__link {
    color: var(--title-color);
    font-weight: var(--font-medium);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    font-size: 1rem;
    border-radius: 0.25rem;
    display: block;
}

.nav__link:hover,
.nav__link.active {
    color: var(--first-color);
    background-color: rgba(108, 99, 255, 0.1);
}

/* Mobile menu toggle buttons */
.nav__toggle,
.nav__close {
    display: none;
    font-size: 1.5rem;
    color: var(--title-color);
    background: none;
    border: none;
    cursor: pointer;
    z-index: var(--z-fixed);
}

/* Ensure navigation is visible on desktop */
@media screen and (min-width: 768px) {
    /* Ensure mobile-open state never affects desktop */
    .nav__menu.show-menu {
        right: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    .nav__menu {
        position: static !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        opacity: 1 !important;
        visibility: visible !important;
        gap: 0.5rem;
    }
    
    .nav__list {
        flex-direction: row;
        column-gap: 1rem;
        padding: 0;
        display: flex !important;
        align-items: center;
    }
    
    .nav__link {
        padding: 0.25rem 0.75rem; /* tighter links on desktop */
    }
    
    .nav__toggle,
    .nav__close {
        display: none !important;
    }
}

/* Scroll buttons common styles */
.scrollup,
.scrolldown {
    position: fixed;
    right: 1.5rem;
    background-color: var(--first-color);
    opacity: 0;
    padding: 0.5rem;
    border-radius: 0.5rem; /* Slightly more rounded corners to match scroll-up style */
    z-index: var(--z-tooltip);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--container-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Scroll button hover effects */
.scrollup:hover,
.scrolldown:hover {
    background-color: var(--first-color-alt);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

/* Icons */
.scrollup i,
.scrolldown i {
    font-size: 1.25rem;
    color: var(--container-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Show scroll up */
.scrollup.show-scroll {
    bottom: 5rem;
    opacity: 1;
}

/* Show scroll down */
.scrolldown.show-scroll {
    bottom: 1.5rem;
    opacity: 1;
}

/* Mobile adjustments */
@media screen and (max-width: 767px) {
    .scrollup,
    .scrolldown {
        right: 1rem;
        border-radius: 0.5rem; /* Match the desktop style */
    }
    
    .scrollup.show-scroll {
        bottom: 5rem;
    }
    
    .scrolldown.show-scroll {
        bottom: 1.5rem;
    }
}

/* Mobile menu toggle - hidden by default */
.nav__toggle,
.nav__close {
    display: none;
    font-size: 1.5rem;
    color: var(--title-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: var(--z-fixed);
}

/* Mobile styles */
@media screen and (max-width: 767px) {
    .container { padding: 0 1.5rem; }
    
    /* Adjust logo and toggle spacing */
    .nav__logo {
        margin-left: 1rem;
    }
    
    .nav__toggle {
        margin-right: 0.75rem;
    }
    .nav__menu {
        position: fixed;
        top: 0;
        right: 0; /* anchor to viewport edge */
        width: 80%;
        max-width: 300px;
        height: 100dvh; /* use dynamic viewport height for mobile */
        padding: 5rem 2rem;
        background-color: var(--container-color);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: transform 0.4s ease, opacity 0.3s ease, visibility 0.3s ease;
        transform: translateX(100%); /* keep off-canvas without affecting layout width */
        z-index: var(--z-fixed);
        flex-direction: column;
        align-items: flex-start;
        display: flex !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none; /* prevent hidden menu from capturing taps */
    }
    
    .nav__toggle,
    .nav__close {
        display: block;
        padding: 0.75rem; /* bigger touch target */
    }
    
    .nav__close {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
    }
    
    .show-menu {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav__list {
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
    }


    /* Adjust scroll up button for mobile */
    .scrollup {
        right: 1rem;
        bottom: 1rem;
    }

    .scrolldown {
        right: 1rem;
    }
}

/* ===== LOADER ===== */
.loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    display: grid;
    place-items: center;
    z-index: var(--z-modal);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(108, 99, 255, 0.2);
    border-top-color: var(--first-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader--hide {
    opacity: 0;
    visibility: hidden;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

button,
input,
select,
textarea {
    font: inherit;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.section__title {
    font-size: var(--h1-font-size);
    text-align: center;
    margin-bottom: var(--mb-2-5);
    color: var(--title-color);
}

.section__subtitle {
    display: block;
    font-size: var(--small-font-size);
    margin-bottom: var(--mb-3);
    text-align: center;
    color: var(--text-color-light);
}

/* ===== SKILLS ===== */
.skills__container {
    max-width: 100%;
    overflow: hidden;
}

.skills__content {
    background: var(--container-color);
    border-radius: 1.25rem;
    padding: 2rem 4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.skills__title {
    font-size: var(--h3-font-size);
    color: var(--title-color);
    margin-bottom: var(--mb-1-5);
    text-align: center;
}

.skills__box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.skills__group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    height: 100%;
    align-content: start;
}

.skills__data {
    display: flex;
    align-items: center;
    background: var(--body-color);
    padding: 1rem;
    border-radius: 0.5rem;
    transition: 0.3s;
    min-height: 60px;
}

.skills__data:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.skills__data i {
    font-size: 1.5rem;
    color: var(--first-color);
    margin-right: 1rem;
}

.skills__name {
    font-size: var(--normal-font-size);
    font-weight: var(--font-medium);
    margin-bottom: 0.25rem;
}

.skills__level {
    font-size: var(--smaller-font-size);
    color: var(--text-color-light);
}

/* ===== MEDIA QUERIES ===== */
/* ===== RESPONSIVE DESIGN ===== */
/* Base mobile-first styles */
html {
    font-size: 16px;
}

/* Fluid typography */
@media screen and (min-width: 320px) {
    html {
        font-size: calc(16px + (20 - 16) * ((100vw - 320px) / (1920 - 320)));
    }
}


/* Home section */
.home__container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    gap: 3rem;
}

.home__content {
    max-width: 600px;
    width: 100%;
    margin: 0;
    padding: 2rem 0 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    text-align: left;
}

.home__subtitle {
    display: block;
    color: var(--first-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: var(--font-medium);
}

.home__text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: left;
}

.home__profession {
    color: var(--first-color);
    font-size: 1.5rem;
    margin: 0;
    font-weight: var(--font-medium);
    width: 100%;
    text-align: left;
}

.home__description {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    padding: 0;
    width: 100%;
    max-width: 520px;
    text-align: left;
}

.home__buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin: 0;
    align-self: flex-start;
    width: 100%;
}

.home__buttons .button {
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: var(--font-medium);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    text-align: center;
}

.button {
    background-color: var(--first-color);
    color: white;
}

.button--ghost {
    background-color: transparent;
    border: 2px solid var(--first-color);
    color: var(--first-color);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.button--ghost:hover {
    background-color: rgba(108, 99, 255, 0.1);
}

.home__title {
    font-size: var(--h1-font-size);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    text-align: left;
}

.home__profession {
    font-size: var(--h3-font-size);
    color: var(--first-color);
    margin: 0;
    text-align: left;
}

.home__description {
    margin: 0 0 1.5rem 0;
    max-width: 520px;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.home__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1rem;
    margin: 0;
    padding: 0;
    width: auto;
}

/* Skills section */
.skills__content {
    padding: 1.5rem;
    background: var(--container-color);
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.skills__box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Experience section */
.experience__item {
    position: relative;
    padding: 1.5rem 0 1.5rem 2rem;
    border-left: 2px solid var(--first-color);
}

/* Contact section */
.contact__info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ===== FAQ ===== */
.faq .container {
    display: grid;
    grid-template-columns: 1fr; /* One question per row */
    gap: 1.5rem;
    max-width: 800px;
}

.faq__item {
    background: var(--container-color);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem; /* tighter outer padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq__item:hover {
    transform: none; /* keep card stable; color only on hovered portion */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.faq__item summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 1rem;
    outline: none;
    padding: 0.6rem 0.9rem; /* compact header padding */
    border-radius: 0.75rem;
    background: transparent; /* remove gradient */
    transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.12);
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__item[open] { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09); }

.faq__toggle i {
    transition: transform 0.25s ease;
    color: var(--first-color);
}

.faq__item[open] .faq__toggle i { transform: rotate(180deg); }

.faq__question {
    font-size: var(--h3-font-size);
    color: var(--title-color);
    margin: 0; /* equal top/bottom spacing handled by summary padding */
    transition: color 0.2s ease;
}

/* No extra bottom margin on open; keep spacing consistent */
.faq__item[open] .faq__question { margin: 0; }

/* Question text color on hover/open */
.faq__item summary:hover .faq__question { color: var(--first-color); }
.faq__item[open] summary .faq__question { color: var(--first-color); }

.faq__content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, background-color 0.25s ease;
    padding: 0; /* collapsed state: no padding */
    background: transparent;
}

.faq__item[open] .faq__content {
    max-height: 500px;
    opacity: 1;
    margin-top: 0.5rem;
    padding: 0.5rem; /* tighter content padding */
    background: transparent; /* no default background */
    border-left: 0;
    border-radius: 0.75rem;
}

/* Color only the exact area being hovered */
.faq__content:hover {
    background-color: rgba(108, 99, 255, 0.06);
    border-left: 3px solid var(--first-color);
    border-radius: 0.75rem;
}

.faq__answer {
    color: var(--text-color);
    line-height: 1.7;
}

.faq__answer a {
    color: var(--first-color);
    text-decoration: underline;
}

@media screen and (max-width: 480px) {
    .faq .container { grid-template-columns: 1fr; }
}

/* Focus styles for keyboard users */
.faq__item summary:focus-visible {
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.25);
    border-radius: 0.5rem;
}

.faq__item summary:hover {
    transform: translateY(-1px);
    background-color: rgba(108, 99, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.06);
}

.faq__item[open] summary {
    background-color: transparent; /* open state: no fill unless hovered */
    box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.2);
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: 0.5rem;
    font-weight: var(--font-medium);
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 140px;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    background-color: var(--container-color);
    margin-top: 4rem;
}

.footer__social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer__copy {
    font-size: var(--small-font-size);
    color: var(--text-color-light);
}

/* Media Queries for larger screens */
@media screen and (min-width: 768px) {
    .home__content {
        text-align: left;
        padding-top: 3rem;
    }
    
    .home__buttons {
        justify-content: flex-start;
    }
    
    .skills__content {
        padding: 2rem;
    }
    
    /* Navigation for desktop */
    .nav__menu {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }
    
    .nav__list {
        flex-direction: row;
        column-gap: 2.5rem;
        padding: 0;
    }
    
    .nav__toggle,
    .nav__close {
        display: none;
    }
}

/* For very large screens */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1200px;
        padding: 0;
    }
    
    .section {
        padding: 8rem 0 4rem;
    }
    
    .home__content {
        padding-top: 4rem;
    }
}

/* Ensure sections have proper spacing */
section {
    scroll-margin-top: 5rem;
}

/* Fix for active section highlighting */
.nav__link.active {
    color: var(--first-color) !important;
    font-weight: var(--font-semi-bold);
}

/*===== BUTTONS =====*/
.button {
    display: inline-block;
    background-color: var(--first-color);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: var(--font-medium);
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.button:hover {
    background-color: var(--first-color-alt);
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(108, 99, 255, 0.4);
}

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

.button--ghost {
    background-color: transparent;
    border: 2px solid var(--first-color);
    color: var(--first-color);
    margin: 0;
}

.button--ghost:hover {
    background-color: var(--first-color);
    color: #fff;
}

/*===== HEADER =====*/
.header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fixed);
    background-color: var(--container-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.nav {
    position: relative;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0;
}

.nav__logo {
    font-weight: var(--font-semi-bold);
    font-size: 1.5rem;
    color: var(--title-color);
    z-index: var(--z-fixed);
}

.nav__toggle,
.nav__close {
    font-size: 1.5rem;
    color: var(--title-color);
    cursor: pointer;
    z-index: var(--z-fixed);
}

/* Show menu on mobile */
.nav__menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    padding: 5rem 2rem 2rem;
    background-color: var(--container-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease-in-out;
    transform: translateX(100%);
    z-index: var(--z-fixed);
    overflow-y: auto;
}

.nav__list {
    display: flex;
    flex-direction: column;
    row-gap: 2.5rem;
    text-align: center;
}

.nav__link {
    color: var(--title-color);
    font-weight: var(--font-medium);
    transition: 0.3s;
}

.nav__link:hover {
    color: var(--first-color);
}

/* Show menu */
.show-menu {
    transform: translateX(0);
}

/* Active link */
.active-link {
    color: var(--first-color);
    font-weight: var(--font-semi-bold);
}

/*===== HOME =====*/
.home {
    padding: 9rem 0 2rem;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
}

.home__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.home__content {
    order: 1;
}

.home__subtitle {
    font-size: var(--h3-font-size);
    color: var(--first-color);
    margin-bottom: var(--mb-0-75);
}

.home__title {
    font-size: var(--big-font-size);
    margin-bottom: var(--mb-1);
    color: var(--title-color);
}

.home__description {
    margin-bottom: var(--mb-2);
    max-width: 400px;
}

.home__img {
    order: -1;
    justify-self: center;
    position: relative;
    width: 300px;
    height: 300px;
    max-width: 100%;
}

.home__blob {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--first-color) 0%, #8a7fff 100%);
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: morph 8s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.home__shape {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
    animation: morph 8s ease-in-out 1s infinite;
}

.home__data {
    color: white;
    text-align: center;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.home__data span {
    display: block;
    font-size: 2rem;
    font-weight: var(--font-bold);
}

.home__stat {
    font-size: 2.25rem;
}

.home__data span.home__label {
    font-size: 1rem;
    font-weight: var(--font-medium);
}

.home__data a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.95rem;
    font-weight: var(--font-medium);
    color: inherit;
    text-decoration: none;
}

.home__data a:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* Projects Call-to-Action */
.projects-cta {
    text-align: center;
}

.projects-cta__card {
    margin: 2rem auto 0;
    padding: 2.5rem 2rem;
    background: var(--container-color);
    border-radius: 1.25rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
    text-align: center;
    align-items: center;
}

.projects-cta__title {
    font-size: 1.5rem;
    font-weight: var(--font-semi-bold);
    color: var(--title-color);
    margin: 0 0 0.5rem 0;
}

.projects-cta__subtitle {
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
    max-width: 640px;
    line-height: 1.6;
}

.projects-cta__actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/*===== ABOUT =====*/
.about__container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.about__data {
    text-align: center;
    width: 100%;
}

.about__description {
    margin-bottom: var(--mb-2-5);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.about__info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 3rem auto 2.5rem;
    max-width: 600px;
}

.about__info-item {
    text-align: center;
    padding: 1.5rem 1rem;
    background-color: var(--container-color);
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

.about__info-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.about__info-title {
    font-size: 1.5rem;
    color: var(--title-color);
    margin-bottom: 0.25rem;
}

.about__info-name {
    font-size: var(--smaller-font-size);
    color: var(--text-color-light);
}

/*===== SKILLS =====*/
.skills__container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    padding: 0 1rem;
}

.skills__content {
    background-color: var(--container-color);
    padding: 2.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
    max-width: 900px;
    width: 100%;
}

.skills__content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.skills__title {
    font-size: var(--h3-font-size);
    text-align: center;
    margin-bottom: var(--mb-2);
    color: var(--title-color);
}

.skills__box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    justify-items: center;
}

.skills__group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
}

.skills__data {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--body-color);
    border-radius: 0.75rem;
    transition: 0.3s;
}

.skills__data:hover {
    transform: translateX(5px);
}

.skills__data i {
    font-size: 1.5rem;
    color: var(--first-color);
    margin-right: 1rem;
}

.skills__name {
    font-weight: var(--font-medium);
    color: var(--title-color);
}

.skills__level {
    font-size: var(--smaller-font-size);
    color: var(--text-color-light);
}

/*===== EXPERIENCE =====*/
.experience__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.experience__content {
    background-color: var(--container-color);
    padding: 2rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.experience__item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 2rem;
    border-left: 2px solid var(--first-color);
}

.experience__item:last-child {
    padding-bottom: 0;
}

.experience__item::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--first-color);
    left: -7px;
    top: 0;
}

.experience__header {
    margin-bottom: var(--mb-1);
}

.experience__position {
    font-size: var(--h3-font-size);
    color: var(--title-color);
    margin-bottom: 0.25rem;
}

.experience__company {
    font-size: var(--normal-font-size);
    color: var(--first-color);
    font-weight: var(--font-medium);
    margin-bottom: 0.25rem;
}

.experience__period {
    font-size: var(--small-font-size);
    color: var(--text-color-light);
    display: inline-block;
    margin-bottom: var(--mb-1);
    background-color: rgba(108, 99, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.experience__list {
    padding-left: 1.5rem;
}

.experience__list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.experience__list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--first-color);
}

/*===== SKILLS =====*/
.skills__container {
    max-width: 100%;
    overflow: hidden;
}

.skills__content {
    background: var(--container-color);
    border-radius: 1.25rem;
    padding: 2rem 4rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.skills__title {
    font-size: var(--h3-font-size);
    color: var(--title-color);
    margin-bottom: var(--mb-1-5);
    text-align: center;
}

.skills__box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.skills__group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.skills__data {
    display: flex;
    align-items: center;
    background: var(--body-color);
    padding: 1rem;
    border-radius: 0.75rem;
    transition: 0.3s;
}

.skills__data:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.skills__data i {
    font-size: 1.5rem;
    color: var(--first-color);
    margin-right: 1rem;
}

.skills__name {
    font-size: var(--normal-font-size);
    font-weight: var(--font-medium);
    margin-bottom: 0.25rem;
}

.skills__level {
    font-size: var(--smaller-font-size);
    color: var(--text-color-light);
}

/*===== CONTACT =====*/

.contact__container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.contact__content {
    display: flex;
    justify-content: center;
    width: 100%;
}

.contact__info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1000px;
}

.contact__card {
    background-color: var(--container-color);
    padding: 2rem 1.5rem;
    border-radius: 1.25rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0; /* Prevents flex items from overflowing */
    width: 100%;
    box-sizing: border-box;
}

.contact__card-data {
    word-break: break-word;
    width: 100%;
    overflow-wrap: break-word;
    padding: 0 0.5rem;
    margin: 0.5rem 0;
}

.contact__card-title {
    margin: 0.5rem 0;
    width: 100%;
}

.contact__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.contact__card i {
    font-size: 2rem;
    color: var(--first-color);
    margin-bottom: var(--mb-1);
}

.contact__card-title {
    font-size: var(--h3-font-size);
    margin-bottom: var(--mb-0-5);
    color: var(--title-color);
}

.contact__card-data {
    display: block;
    margin-bottom: var(--mb-1);
    color: var(--text-color);
}

.contact__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--first-color);
    font-size: var(--small-font-size);
    font-weight: var(--font-semi-bold);
    transition: 0.3s;
}

.contact__button:hover {
    color: var(--first-color-alt);
}

.contact__button i {
    margin-left: 0.5rem;
    font-size: 1rem;
    transition: 0.3s;
}

.contact__button:hover i {
    transform: translateX(0.25rem);
}

/*===== FOOTER =====*/
.footer {
    background-color: var(--container-color);
    padding: 3rem 0 2rem;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
}

.footer__container {
    text-align: center;
}

.footer__title {
    font-size: var(--h1-font-size);
    color: var(--title-color);
    margin-bottom: var(--mb-1);
}

.footer__social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: var(--mb-2);
}

.footer__social-link {
    display: inline-flex;
    background-color: var(--first-color);
    color: #fff;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: 0.3s;
}

.footer__social-link:hover {
    background-color: var(--first-color-alt);
    transform: translateY(-3px);
}

.footer__copy {
    font-size: var(--smaller-font-size);
    color: var(--text-color-light);
}

/*===== SCROLL UP =====*/
.scrollup {
    position: fixed;
    right: 1rem;
    bottom: -20%;
    background-color: var(--first-color);
    opacity: 0.8;
    padding: 0.5rem;
    border-radius: 0.5rem;
    z-index: var(--z-tooltip);
    transition: 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.scrollup:hover {
    background-color: var(--first-color-alt);
    transform: translateY(-0.5rem);
}

/* Show Scroll Up */
.show-scroll {
    bottom: 5rem;
}

/*===== SCROLL BAR =====*/
::-webkit-scrollbar {
    width: 0.6rem;
    background-color: #f1f1f1;
    border-radius: 0.5rem;
}

::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 0.5rem;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

/*===== BREAKPOINTS =====*/
/* For small devices */
@media screen and (max-width: 350px) {
    .container {
        margin-left: var(--mb-1);
        margin-right: var(--mb-1);
    }

    .home__buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .home__buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .button--ghost {
        margin: 0;
    }

    .about__info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skills__group {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .contact__info {
        grid-template-columns: 1fr;
        max-width: 300px;
    }
    
    .contact__card {
        width: 100%;
    }
}

@media screen and (max-width: 767px) {
    /* Prevent horizontal overflow on small screens */
    .home__img {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 1 / 1; /* keep blob square without overflowing */
        margin-inline: auto;
    }

    /* Keep the experience timeline dot inside the content area */
    .experience__item {
        padding-left: 1.25rem;
    }
    .experience__item::before {
        left: 0;
    }
}

/* For medium devices */
@media screen and (min-width: 576px) {
    .home__container,
    .about__container,
    .experience__container,
    .contact__container {
        grid-template-columns: 1fr;
    }

    .home__img {
        order: 0;
    }

    .home__data {
        order: 1;
    }

    .about__img {
        width: 350px;
        height: 350px;
    }

    .skills__box {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact__info {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
    }
}

@media screen and (min-width: 768px) {
    .section {
        padding: 8rem 0 4rem;
    }

    .section__subtitle {
        margin-bottom: 4rem;
    }

    .nav {
        height: calc(var(--header-height) + 1.5rem);
    }

    .nav__menu {
        width: initial;
    }

    .nav__list {
        flex-direction: row;
        column-gap: 0.5rem;
    }

    .nav__toggle,
    .nav__close {
        display: none;
    }
    
    .contact__info {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .home__container {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
        column-gap: 2rem;
    }

    .home__img {
        order: 1;
    }

    .home__content {
        order: 0;
    }

    .about__container {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
        column-gap: 5rem;
    }

    .about__img {
        width: 350px;
    }

    .skills__container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        max-width: 800px;
        margin: 0 auto;
    }

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

    .contact__content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For large devices */
@media screen and (min-width: 992px) {
    .container {
        margin-left: auto;
        margin-right: auto;
    }

    .section {
        padding: 10rem 0 5rem;
    }

    .section__title {
        font-size: 2.5rem;
        margin-bottom: 3.5rem;
    }

    .home__container {
        padding-top: 3rem;
    }

    .home__img {
        width: 400px;
        height: 400px;
    }

    .home__title {
        font-size: 3.5rem;
    }

    .home__subtitle {
        font-size: 1.5rem;
    }

    .about__container {
        column-gap: 8rem;
    }

    .about__img {
        width: 400px;
        height: 400px;
    }

    /* Skills container styles moved to the main skills section for better organization */

    .skills__content {
        padding: 2.5rem;
    }

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

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

    .contact__content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Preloader: removed unused .preloader block to avoid conflicts with actual .loader overlay */

/* Animation classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}