/* basic reset and root variables */
:root {
    --primary-color: #000000;
    --background-color: #f5f5f5; /* light grey background */
    --surface-color: #ffffff;
    --surface-color-footer: #333; /* dark footer */
    --on-surface-color-footer: #ccc;
    --container-hover-color: #800000;
    --container-active-color: #ff0000;
    --container-color-skills-ul: #e0e0e0; /* light grey chip background */
    --on-primary-color: #ffffff;
    --font-family: 'roboto', sans-serif;
    --border-radius: 18px; /* rounded corners */
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08); /* subtle shadow */
    --box-shadow-hover: 0 6px 10px rgba(0, 0, 0, 0.20), 0 2px 4px rgba(0, 0, 0, 0.12); /* hover shadow */
    --transition-speed: 0.3s;
}
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}
/* header and navigation */
header {
    background-color: var(--surface-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--on-primary-color);
    border-radius: var(--border-radius);
    padding: 0 20px; /* add padding inside container for header */
}
.logo {
	  user-select: none;
    font-size: 1.4rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--on-primary-color);
}
nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}
nav a {
	  user-select: none;
    color: var(--on-primary-color);
    text-decoration: none;
    font-weight: 400;
    transition: opacity var(--transition-speed) ease;
}
nav a:hover {
    opacity: 0.6;
}
/* main content area */
main {
    flex-grow: 1;
}
/* section styling */
section {
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}
section:last-of-type {
    border-bottom: none;
}
section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--primary-color);
}
/* hero section */
#hero {
    background-color: var(--surface-color);
    padding: 20px 0;
}
/* flex container */
.hero-container {
    display: flex;
    flex-direction: row; /* explicitly set default direction to row (side-by-side) */
    align-items: center; /* vertically center items in the columns */
    gap: 3rem;         /* space between text and image */
}
/* text column */
.hero-text {
    flex: 1; /* allows text block to take up available space (adjust ratio if needed) */
    text-align: left;
}
#hero h1 {
    font-size: 2.0rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 400;
}
#hero p {
    font-size: 1.2rem;
    color: var(--primary-color);
    opacity: 0.8;
    margin-bottom: 1.5rem;
}
/* image column */
.hero-image {
    flex: 1; /* allows image block to take up available space */
    text-align: center; /* center the image within its column */
}
.hero-image img {
	  user-select: none;
    max-width: 100%; /* makes image responsive */
    height: auto;   /* maintains aspect ratio */
    display: block; /* removes potential extra space below image */
    margin: 0 auto; /* ensure centering if flex basis is larger than image */
}
/* projects section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.project-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    transform: translatey(-5px);
    box-shadow: var(--box-shadow-hover);
}
.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    font-weight: 500;
}
.project-card p {
    margin-bottom: 1rem;
    flex-grow: 1; /* make description take available space */
    opacity: 0.9;
}
.project-link {
	  user-select: none;
    align-items: center; /* vertically align icon and text */
    justify-content: center;
    background-color: var(--primary-color);
    color: var(--on-primary-color);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background-color var(--transition-speed) ease;
    align-self: flex-start; /* align button to the start of the flex container */
    min-width: fit-content;
}
.project-link:hover {
    background-color: var(--container-hover-color);
}
.project-link:active {
    background-color: var(--container-active-color);
}
/* about section */
#about {
    background-color: var(--surface-color);
}
.about-content {
    display: grid;
    grid-template-columns: 1fr; /* single column for now */
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}
.about-content p {
    margin-bottom: 1rem;
}
.skills-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}
.skills-list li {
    background-color: var(--container-color-skills-ul); /* light grey chip background */
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 16px; /* pill shape */
    font-size: 0.9rem;
    align-items: center;
    gap: 0.4rem;
}
/* footer */
footer {
    background-color: var(--surface-color-footer);
    color: var(--on-surface-color-footer);
    padding: 1.5rem 0;
    margin-top: auto; /* push footer to the bottom */
}
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.copyright p {
    font-size: 0.9rem;
    margin: 0;
    text-align: left;
}
.social-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.social-links a {
    color: var(--on-surface-color-footer);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color var(--transition-speed);
}
.social-links a:hover {
    color: #fff;
    text-decoration: none;
}
/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltip-text {
    visibility: hidden;
    background-color: var(--primary-color);
    color: var(--on-primary-color);
    text-align: center;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    /* Position the tooltip */
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    /* Fade in animation */
    opacity: 0;
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
    /* Add slight shadow for depth */
    box-shadow: var(--box-shadow);
    /* Ensure it appears above other elements */
    z-index: 1;
}
/* Create a tooltip small arrow pointing down */
.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}
/* Show the tooltip when hovering over the container */
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
/* responsive design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 0.5rem;
    }
    nav ul {
        justify-content: center;
        margin-top: 0.5rem;
    }
    /* hero layout for smaller screens */
    .hero-container {
        flex-direction: column; /* stack items vertically */
        text-align: center;    /* center align text and image block */
        gap: 2rem;             /* adjust vertical gap */
    }
    .hero-text {
        order: 2;           /* place text below the image */
        width: 100%;        /* take full width */
    }
    .hero-image {
        order: 1;           /* place image above the text */
        width: 80%;         /* limit image width */
        max-width: 400px;   /* set a max width for the image */
        margin: 0 auto 1rem auto; /* add some bottom margin to image */
    }
    #hero h1 {
        font-size: 2.5rem;
        text-align: center;
    }
    #hero p {
        font-size: 1.1rem;
        max-width: 600px; /* optional: re-introduce max-width for readability */
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.5rem; /* ensure bottom margin is present */
    }
    .project-grid {
        grid-template-columns: 1fr; /* stack projects on smaller screens */
    }
    .footer-container {
        flex-direction: column;
        gap: 1rem;
    }
    .copyright {
        text-align: center;
    }
}
@media (max-width: 480px) {
    nav ul {
        flex-direction: row;
        align-items: center;
    }
    /* hero adjustments for very small screens */
    .hero-image {
        width: 90%; /* slightly wider image */
    }
    #hero h1 {
        font-size: 2rem;
        text-align: center;
    }
    #hero p {
        font-size: 1rem;
    }
    .project-card {
        padding: 1rem;
    }
    .project-card h3 {
        font-size: 1.2rem;
    }
}
