:root {
    --bg: #ffffff;
    --bg-section: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --indigo: #4a6fa5;
    --sky: #2e86c1;
    --card-bg: #f1f5f9;
    --card-border: #e2e8f0;
    --white: #ffffff;
    --orange: #c2702f;
    --gradient: linear-gradient(135deg, #4a6fa5, #2e86c1);
    --font-size: 1.3rem;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Sora', sans-serif;
}

/* border box model: https://css-tricks.com/box-sizing/ */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
    overflow-x: clip;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* generic styles for the page */
body {
    padding: 0;
    margin: 0;
    font-family: var(--sans);
    background-color: var(--bg);
    overflow-x: clip;
    color: var(--text);
    font-size: var(--font-size);
    text-align: center;
}

h1,
h2,
h3 {
    margin: 0;
}

.orange-point {
    color: var(--lightorange);
}

a {
    color: var(--indigo);
}

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

.section-orange-div {
    background: var(--gradient);
    color: var(--white);
    max-width: 1200px;
    margin: 3.5rem auto;
    border-radius: 12px;
}

.section-darkblue-div {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.seperator {
    background: linear-gradient(90deg, #4a6fa5 0%, #2e86c1 100%);
    height: 5px;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 3px;
}

/* Intro Styles */
#intro {
    max-width: 1200px;
    margin: 2rem auto 4.5rem;
    padding: 2rem;
    background-color: #fafafa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#intro p {
    font-size: 1rem;
    line-height: 1.5;
    /* text-align: justify; */
}

#intro .name {
    font-family: var(--mono);
}

.name span {
    font-family: var(--sans);
    font-size: 4rem;
    color: var(--orange);
    display: block;
}

#intro h2 {
    font-size: 3rem;
    font-weight: normal;
}

/* contact section */

#contact-me {
    width: 400px;
    padding-bottom: 20px;
    margin: 0 auto;
    /* text-align: center; */
}

#contact-me p {
    font-size: 1rem;
}

#contact-me a {
    text-decoration: none;
}

.contact-me-button {
    font-size: 150%;
    padding: 10px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background: white;
    border: none;
    color: var(--indigo);
    border-radius: 10%;
}

.contact-me-button:hover {
    background: var(--card-bg);
}

/* nav section */

nav {
    font-family: var(--mono);
    font-size: 80%;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

nav h1 a {
    font-family: var(--sans);
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

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

nav a:hover {
    color: var(--indigo);
}

nav li:first-child {
    flex-basis: 100%;
    text-align: center;
}

nav [class*='fa-'] {
    font-size: 150%;
}

nav li:first-child i {
    color: var(--orange);
}

.cv-button {
    padding: 10px;
    font-size: 1.2rem;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 3%;
}

.cv-button:hover {
    opacity: 0.9;
    color: white;
}

nav h1 [class*='fa-'] {
    font-size: 100%;
    padding-bottom: 10px;
}

@media (min-width: 1000px) {
    nav ul {
        max-width: 1200px;
        margin: 0 auto;
    }

    nav li:first-child {
        flex-basis: auto;
        text-align: left;
        margin-right: auto;
    }
}

/* footer */

footer {
    padding: 2rem 0;
    text-align: center;
}

.footer-links {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    font-size: 150%;
}

.latest-badge {
    display: inline-block;
    background: var(--orange);
    color: white;
    -webkit-text-fill-color: white;
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    font-size: 0.75rem;
    font-family: var(--mono);
    margin-bottom: 0.25rem;
}

.hero-cta {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.75rem 1.75rem;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.3);
}

.hero-cta + .hero-cta {
    margin-left: 0.75rem;
}

.hero-cta:hover {
    opacity: 0.9;
    color: white;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 1rem;
    font-family: var(--mono);
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.tech-group {
    text-align: center;
}

.tech-group h4 {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Portfolio */
#portfolio-section {
    background-color: var(--bg-section);
}

.portfolio {
    padding: 2rem 1rem 2rem 1rem;
}

.portfolio h1 {
    margin: 0;
    font-size: 3rem;
}

.portfolio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 3rem 0 1rem;
}

.carousel-btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.carousel-btn-label {
    font-size: 0.7rem;
    font-family: var(--mono);
    color: var(--text-muted);
}

h3 {
    font-family: var(--mono);
    font-size: 1rem;
}

.project-name {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tech {
    padding: 0;
    font-size: 1rem;
    list-style-type: none;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 0.6rem;
}

.tech li {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    font-size: 0.8rem;
    font-family: var(--mono);
}

.project-description {
    font-size: 1rem;
    text-align: justify;
    text-justify: inter-word;
}

img {
    margin: 1rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.image-align {
    display: flex;
    justify-content: center;
}

.aproject {
    margin-bottom: 1rem;
}

.portfolio section {
    background-color: #fafafa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Carousel */
.carousel {
    display: block;
}

.carousel-track {
    overflow: hidden;
}

.carousel-slide {
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide > section {
    margin-bottom: 0;
}

.carousel-btn {
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.carousel-btn:hover {
    opacity: 0.8;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: none;
    background: var(--card-border);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.dot.active {
    background: var(--indigo);
}

.portfolio .about {
    margin: auto;
}

.heroImage {
    width: 100%;
    max-width: 900px;
    height: auto;
}

@media (min-width: 1000px) {
    .portfolio {
        max-width: 1200px;
        margin: 0 auto;
    }

    img {
        width: 80%;
    }

    .about img {
        width: 400px;
        height: 400px;
        object-fit: cover;
    }

    .about {
        display: flex;
        /* flex-flow: row; */
        flex-direction: row;
        gap: 1rem;
    }

    .align-left {
        text-align: left;
        color: var(--orange);
    }
}

@media (max-width: 767px) {
    #intro {
        margin: 0.5rem auto;
        width: calc(100% - 1rem);
        padding: 1.25rem;
        border-radius: 8px;
    }

    .portfolio {
        padding: 1rem 0.5rem;
        margin: 0 auto;
        width: 100%;
    }

    .portfolio section {
        padding: 1rem;
        border-radius: 8px;
    }

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

    nav ul {
        gap: 1rem;
    }

    #intro h2 {
        font-size: 1.6rem;
    }

    .portfolio h1 {
        font-size: 1.8rem;
    }

    .carousel-btn {
        width: 2rem;
        height: 2rem;
        font-size: 1.2rem;
    }
}
