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

:root {
    --primary-color-light: #FFFFFF;
    --secondary-color-light: #9747FF;
    --primary-background-color-light: #0A090D;
    --secondary-background-color-light: #9747FF;

    --primary-color-dark: #000000;
    --secondary-color-dark: #6A00FF;
    --primary-background-color-dark: #0d1117;
    --secondary-background-color-dark: #6A00FF;

    --primary-color: var(--primary-color-light);
    --secondary-color: var(--secondary-color-light);
    --primary-background-color: var(--primary-background-color-light);
    --secondary-background-color: var(--secondary-background-color-light);

    --padding-inline-section: 20px;
    --transition: all 0.3s ease-in-out;
    --header-height: 80px;
    --footer-height: 100px;
    --body-font: "Kanit", sans-serif;
    --section-height: 110px;
}

.light-mode {
    --primary-color: var(--primary-color-dark);
    --primary-background-color: var(--primary-background-color-dark);
    --secondary-background-color: var(--secondary-background-color-dark);
}

body {
    font-family: var(--body-font);
    color: var(--primary-color);
    background-color: var(--primary-background-color);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.8rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    font-size: 1rem;
    color: var(--primary-color);
    line-height: 1.5rem;
    opacity: 0.7;
}

a {
    text-decoration: none;
    display: inline-block;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

.container {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: var(--padding-inline-section);
    overflow: hidden;
}

.flex {
    display: flex;
    align-items: center;
}

.hover-link {
    color: var(--primary-color);
    transition: var(--transition);
}

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

.hover-link,
.hover-link.active {
    position: relative;
    text-decoration: none;
}

.hover-link::after,
.hover-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    text-decoration-skip-ink: none;
    transition: width 0.5s;
}

.hover-link:hover::after,
.hover-link.active::after {
    width: 80%;
}

.heading {
    text-align: center;
}

.heading-title {
    position: relative;
    display: inline-block;
    text-decoration: none;
    text-transform: uppercase;
}

.heading-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 80%;
    height: 3px;
    background-color: var(--primary-color);
    text-decoration-skip-ink: none;
}

.heading p {
    margin-top: 20px;
    opacity: 1;
}

.heading-line {
    width: 50px;
    height: 5px;
    background-color: var(--secondary-color);
    margin: 10px auto;
}

.primary-button {
    background-color: var(--secondary-color);
    border-radius: 100px;
    font-weight: 700;
    color: var(--primary-color);
    padding: 15px 24px;
    box-shadow: 0 0 5px var(--secondary-color);
    transition: var(--transition);
}

.primary-button:hover {
    background-color: var(--secondary-color-dark);
}

/* Main Styling */

header {
    background-color: var(--primary-background-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--primary-color);
}

.navbar {
    margin-top: 30px;
    justify-content: space-between;
    height: var(--header-height);
    position: relative;
}

.logo {
    color: var(--primary-color);
}

.logo h2 span {
    color: var(--secondary-color);
}

.nav-links ul {
    gap: 40px;
}

.theme-icon {
    font-size: 20px;
    margin-right: 30px;
    cursor: pointer;
}

.nav-toggle {
    display: none;
}

.hero-section {
    /* height: calc(100vh - var(--header-height) - var(--footer-height)); */
    justify-content: space-between;
}

.left-hero {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-right: var(--padding-inline-section);
    max-width: 50%;
    margin-top: 50px;
}

.hero-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.resume-button {
    margin-top: 20px;
}

.right-hero img {
    width: 35vw;
    margin-top: 20px;
}

/* About Section */

.about-section {
    margin-top: var(--section-height);
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
}

.about-info {
    padding: 30px 0;
}

.about-info p {
    margin-bottom: 10px;
    opacity: 1;
}

.info-para a {
    color: var(--secondary-color);
}

.skills-container {
    padding: 30px 0;
    width: 100%;
}

.skills-section {
    /* padding: 30px 0; */
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 30px;
}

.skill-box {
    flex-direction: column;
    justify-content: center;
    height: 275px;
    width: 23%;
    border: solid var(--primary-color) 1px;
    border-radius: 30px;
    cursor: pointer;
}

.skill-box i {
    font-size: 50px;
}

.skill-box h4 {
    padding: 10px 0;
    font-weight: 300;
}

.skill-box p {
    line-height: 1rem;
}

.skill-box:hover {
    background-color: var(--secondary-color);
    transition: var(--transition);
}

/* Services Section */

.service-section {
    margin-top: var(--section-height);
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
}

.service-info {
    padding: 30px 0;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.service-box {
    flex-direction: column;
    justify-content: center;
    min-height: 500px;
    width: 32%;
    border: solid var(--primary-color) 1px;
    border-radius: 30px;
    margin: 30px 0;
    padding: 20px 20px;
    cursor: pointer;
}

.service-box i {
    font-size: 50px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    padding: 20px;
    margin-bottom: 15px;
}

.service-box h3 {
    font-weight: 700;
    text-align: center;
}

.service-box p {
    text-align: center;
    padding: 20px 0;
}

.service-box:hover {
    background-color: var(--secondary-color);
    transition: var(--transition);
}

/* Projects Section */

.project-section {
    margin-top: var(--section-height);
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
}

.project-list {
    padding: 30px 0;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.project-box {
    flex-direction: column;
    height: 475px;
    width: 32%;
    border: solid var(--primary-color) 1px;
    border-radius: 10px;
    margin: 30px 0;
    overflow: hidden;
}

.project-box img {
    flex: 0 0 auto;
    height: auto;
    width: 100%;
    max-height: 60%;
    object-fit: contain;
    transition: var(--transition);
}

.project-box img:hover {
    transform: scale(1.1);
}

.project-info {
    flex-direction: column;
}

.project-box h3 {
    font-weight: 700;
    margin-top: 20px;
    text-align: center;
    padding: 0 20px;
}

.project-box a {
    text-align: center;
    padding: 20px 0;
}

.project-box a:hover {
    color: var(--secondary-color);
    transition: var(--transition);
}

.project-box p {
    text-align: center;
    padding: 0 20px;
}

/* Blogs Section */

.blog-section {
    margin-top: var(--section-height);
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
}

.blog-list {
    padding: 30px 0;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.blog-box {
    flex-direction: column;
    height: 550px;
    width: 32%;
    border: solid var(--primary-color) 1px;
    border-radius: 10px;
    margin: 30px 0;
    overflow: hidden;
    position: relative;
}

.blog-img {
    flex: 0 0 auto;
    height: auto;
    width: 100%;
    max-height: 60%;
    object-fit: contain;
    transition: var(--transition);
}

.blog-img:hover {
    transform: scale(1.1);
}

.blog-info {
    flex-direction: column;
    align-items: flex-start;
}

.blog-box h3 {
    font-weight: 700;
    margin-top: 20px;
    padding: 10px 15px;
}

.blog-box a:hover {
    color: var(--secondary-color);
    transition: var(--transition);
}

.blog-box p {
    padding: 10px 15px;
}

.blog-footer {
    justify-content: space-between;
    margin-top: 20px;
    width: 100%;
    padding: 10px;
    position: absolute;
    bottom: 0;
    border-top: 1px solid var(--primary-color);
}

.post-date {
    font-size: 14px;
    opacity: 0.7;
}

.avatar {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    overflow: hidden;
    border-radius: 50% !important;
}

/* Contact Section */

.contact-section {
    margin-top: var(--section-height);
    justify-content: space-between;
    align-items: flex-start;
}

.contact-form {
    min-width: 45%;
    margin-right: 5%;
}

.contact-form form {
    margin: 50px 0;
}

.contact-form form button {
    font-size: 1rem;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-group label {
    position: absolute;
    top: 9px;
    left: 10px;
    transition: var(--transition);
    pointer-events: none;
    font-size: 15px;
    color: #888;
}

.form-group input:focus+label,
.form-group input:valid+label {
    top: -20px;
    left: 0;
    font-size: 15px;
    color: var(--secondary-color);
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
}

.form-group input:focus {
    border-color: var(--secondary-color);
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    resize: vertical;
}

.form-group textarea:focus {
    border-color: var(--secondary-color);
}

.form-group textarea:focus+label,
.form-group textarea:valid+label {
    top: -20px;
    left: 0;
    font-size: 15px;
    color: var(--secondary-color);
}

.contact-desc h2 {
    margin-bottom: 50px;
}

.contact-desc p {
    margin-bottom: 10px;
}

.contact-info {
    margin: 30px 0;
}

.contact-info a {
    margin: 10px 10px;
}

.socials {
    margin: 30px 0;
}

.socials a {
    margin-right: 25px;
    font-size: 25px;
}

/* Footer CSS */

.footer {
    justify-content: center;
    height: var(--footer-height);
    border-top: 1px solid var(--primary-color);
}

.footer-text {
    color: var(--primary-color);
    opacity: 1;
    cursor: pointer;
}

.footer-text span {
    color: var(--secondary-color);
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.loader:after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 3px solid var(--secondary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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