:root {
    --blue0: #F0F4FF;
    --blue1: #D0DAFE;
    --blue2: #3B5BDB;
    --blue3: #1A2B5E;
    --blue4: #0D1B4B;
    --nav-height: 56px;
    --section-spacing: 4rem;
    --radius: 8px;
    --shadow: 0 4px 20px rgba(13, 27, 75, 0.12);
    --shadow-hover: 0 8px 32px rgba(13, 27, 75, 0.18);
}

* {
    scroll-margin-top: var(--nav-height);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
    padding-top: var(--nav-height);
}

/* Navbar */
#navbar {
    background: var(--blue4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 1030;
    transition: box-shadow 0.2s ease;
}

#navbar:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#navbar .nav-pills {
    gap: 0.25rem;
}

#navbar .nav-link {
    color: var(--blue0);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background-color 0.2s ease, color 0.2s ease;
}

#navbar .nav-item:hover .nav-link {
    color: var(--blue0);
    background-color: var(--blue3);
}

#navbar .nav-link:focus-visible {
    outline: 2px solid var(--blue1);
    outline-offset: 2px;
}

/* Profile section */
#profile {
    scroll-margin-top: 0;
    min-height: calc(100vh - var(--nav-height));
    background: linear-gradient(160deg, var(--blue0) 0%, var(--blue1) 50%, #e8ecfc 100%);
    padding: 2rem;
}

#profile img {
    background-color: var(--blue0);
    width: 180px;
    height: 180px;
    object-fit: cover;
    box-shadow: var(--shadow);
    border: 4px solid white;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#profile img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

#profile h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--blue4);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

#profile h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue3);
    margin-bottom: 0.5rem;
}

#profile p {
    font-size: 1rem;
    color: var(--blue3);
    font-style: italic;
    margin: 0;
}

/* About section */
#about {
    padding: var(--section-spacing) 2rem;
    background: #fff;
}

#about h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue4);
    margin-bottom: 1rem;
}

#about p {
    max-width: 600px;
    text-align: center;
    color: #444;
    font-size: 1.05rem;
}

#about a.btn {
    color: var(--blue0);
    background-color: var(--blue4);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#about a.btn:hover {
    background-color: var(--blue2);
    color: var(--blue0);
    transform: translateY(-1px);
}

/* Education section */
#education {
    padding: var(--section-spacing) 2rem;
    background: var(--blue0);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

#education h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue4);
    margin-bottom: 1.5rem;
}

#education div div {
    border: 2px solid var(--blue2);
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#education div div:hover {
    box-shadow: var(--shadow);
    border-color: var(--blue3);
}

#education h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--blue4);
}

#education p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue3);
    margin-bottom: 0.25rem;
}

#education p span {
    font-weight: 500;
    color: #666;
    font-size: 0.95rem;
}

/* Skills section */
#skills {
    padding: var(--section-spacing) 2rem;
    background: #fff;
}

#skills h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue4);
    margin-bottom: 1rem;
}

#skills .col-sm-3 {
    border: 2px solid var(--blue1) !important;
    background: #fafbff;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

#skills .col-sm-3:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--blue2) !important;
}

#skills h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue4);
}

#skills p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}

/* Icon container: grid on small viewports so icons wrap instead of overflow */
#skills .col-sm-3 > div.d-flex {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(64px, 100%), 1fr));
    gap: 0.75rem;
    justify-items: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#skills img {
    max-width: 64px;
    max-height: 64px;
    width: 100%;
    height: auto;
    object-fit: contain;
    min-width: 0;
}

/* Experience section */
#experience {
    padding: var(--section-spacing) 2rem;
    background: var(--blue0);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

#experience h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue4);
    margin-bottom: 1.5rem;
}

#experience > div > div {
    border: 2px solid var(--blue2);
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#experience > div > div:hover {
    box-shadow: var(--shadow);
    border-color: var(--blue3);
}

#experience h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--blue4);
}

#experience p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue3);
    margin-bottom: 0.25rem;
    margin-bottom: 0;
}

#experience h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue4);
}

#experience .accomplishments {
    margin-top: 1rem;
}
#experience ul {
    padding-left: 1rem;
    margin-bottom: 0;
}

/* Projects section */
#projects {
    padding: var(--section-spacing) 2rem;
    background: linear-gradient(180deg, var(--blue0) 0%, #fff 100%);
}

#projects h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue4);
}

#projects .col-sm-3.btn {
    color: var(--blue0);
    background-color: var(--blue4);
    border: 2px solid var(--blue4);
    border-radius: var(--radius);
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#projects .col-sm-3.btn:hover {
    background-color: #fff;
    color: var(--blue4);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

#projects .col-sm-3.btn h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

#projects .col-sm-3.btn p {
    text-align: center;
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.95;
}

#projects h4.mt-4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue3);
}

/* Quotes section */
#quotes {
    padding: var(--section-spacing) 2rem;
    background: var(--blue0);
}

#quotes .quote-card {
    margin: 0;
    background: #fff;
    border: 2px solid var(--blue1);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

#quotes .quote-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--blue2);
}

#quotes .quote-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--blue4);
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

#quotes .quote-author {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--blue3);
    margin: 0;
}

/* Contacts section */
#contacts {
    background: linear-gradient(180deg, var(--blue3) 0%, var(--blue4) 100%);
    padding: var(--section-spacing) 2rem;
    box-shadow: 0 -4px 24px rgba(13, 27, 75, 0.2);
}

#contacts * {
    color: var(--blue0);
}

#contacts h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

#contacts h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

#contacts a {
    display: inline-block;
    margin: 0 0.75rem;
    padding: 0.5rem 1.25rem;
    color: var(--blue0);
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--blue0);
    transition: background-color 0.2s ease, color 0.2s ease;
}

#contacts a:hover {
    background-color: var(--blue0);
    color: var(--blue4);
}

/* Footer */
#quotes div div {
    padding: 1rem 2rem;
    font-size: 0.8rem;
    color: #666;
    background: #f5f5f5;
    text-align: center;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    #profile {
        flex-direction: column;
        text-align: center;
    }

    #profile .ms-3 {
        margin-left: 0 !important;
        margin-top: 1rem;
    }

    #skills .col-sm-3,
    #projects .col-sm-3 {
        margin-bottom: 1rem;
    }

    #skills img {
        max-width: 48px;
        max-height: 48px;
    }

    #skills .col-sm-3 > div.d-flex {
        grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    }
}