/* CSS Variables for Colors */

:root {
    --background-color: #f4f4f4; /* Light gray for a newspaper-like background */
    --text-color: #111; /* Dark near-black for primary text */
    --faint-text-color: #555; /* Dark near-black for primary text */
    --accent-color: #b22222; /* Deep red for accents */
    --accent-color-hover: #800000; /* Darker red for hover effects */
    --border-color: #ccc; /* Soft gray for borders and subtle outlines */
    --code-bg: #2d2d2d; /* Dark background for code blocks */
    --code-text: #f8f8f2; /* Light text for contrast */
}

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

body {
    font-family: 'Fira Code', monospace;
    line-height: 1.6;
    background-color: var(--background-color); /* Off-white background for the whole site */
    color: var(--text-color);
}

section, header, footer {
    padding: 0 20px; /* Adds padding on smaller screens, almost to the edge */
}

/* Centered content for larger screens */
@media (min-width: 1024px) {
    section, header, footer {
        max-width: 75%; /* Adjust this width as needed */
        margin: 0 auto; /* Centers content on larger screens */
    }
}

/* Navbar */
header {
    background: var(--background-color);
    padding: 10px 20px;
}

nav {
    display: flex;
    justify-content: space-between; /* Aligns logo left, menu right */
    align-items: center;
}

/* Logo styling */
.logo {
    font-weight: bold;
    font-size: 2em;
    color: var(--accent-color);
}

/* Navigation links styling */
nav ul {
    list-style: none;
    display: flex;
    gap: 20px; /* Space between menu items */
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.25em;
    font-weight: bold;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--accent-color);
}


.hamburger {
    display: none; /* Hidden by default, shown on smaller screens */
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 4px;
    transition: 0.4s;
}

/* Responsive styles */
@media (max-width: 1000px) {
    nav ul {
        display: none; /* Hidden by default on smaller screens */
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Center links vertically */
        height: 100vh; /* Full height */
        width: 100%;
        position: fixed; /* Fixed position to cover entire screen */
        top: 0;
        left: 0;
        background-color: #f8f8f8; /* Off-white background */
        z-index: 999; /* Make sure it appears above other elements */
        transform: translateY(-100%); /* Hide off-screen initially */
        transition: all 100ms ease-in-out;
    }

    nav ul li {
        text-align: center;
    }

    nav ul li a {
        color: #333;
        font-size: 1.2em;
        text-decoration: none;
    }

    .hamburger {
        display: flex;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1000;
        cursor: pointer;
        background-color: transparent;
    }

    .hamburger span {
        background-color: #333;
        width: 32px;
        height: 3px;
        margin: 4px;
    }

    .hamburger.active span:nth-child(1) {
        transition: all 100ms ease-in-out;
        transform: rotate(45deg);
        transform-origin: top left;
    }
    
    .hamburger.active span:nth-child(2) {
        transition: all 100ms ease-in-out;
        transform-origin: center;
        width: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transition: all 100ms ease-in-out;
        transform: rotate(-45deg);
        transform-origin: bottom left;    
    }

    /* Toggle styles for the active state */
    nav ul.active {
        display: flex;
        transform: translateY(0);
    }
}

/* Hero Section */
#hero {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background-color);
    padding: 4em;
    text-align: center;
}

.hero-content {
    font-size: 1.8rem;
    line-height: 1.6;
    margin: 0 auto;
    font-weight: bold;
    max-width: 700px;
    color: var(--text-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.highlight {
    color: var(--accent-color);
    font-weight: bold;
}

/* Projects Section */
#projects {
    padding: 0 4em;
    background: var(--background-color);
    text-align: center;
}

#projects h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1444px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.projects-grid a {
    text-decoration: none;
}

/* Project Card Styling */
.project-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: left;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Project Image Styling */
.project-card img {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}

.project-card h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.project-card p {
    font-size: 1rem;
    color: var(--faint-text-color);
    line-height: 1.6;
}

/* Contact Section */
#contact {
    padding: 50px 20px;
    background: var(--background-color);
    text-align: center;
}

#contact h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

/* Contact Form Styling */
#contact-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact-form label {
    font-weight: bold;
    color: var(--text-color);
    text-align: left;
}

#contact-form input, #contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    color: var(--text-color);
    font-family: Arial, sans-serif;
    transition: border-color 0.3s;
}

#contact-form input:focus, #contact-form textarea:focus {
    border-color: var(--accent-color);
    outline: none;
}

#contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

#contact-form button {
    padding: 12px 20px;
    background-color: var(--accent-color);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#contact-form button:hover {
    background-color: var(--accent-color-hover);
}

/* Footer */
footer {
    text-align: center;
    padding: 15px 20px;
    font-size: 0.9rem;
}

footer p {
    margin: 0;
}

/* Detail View Styling */
#detail {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
    background-color: var(--background-color);
    color: var(--text-color);
}

.project-title {
    font-size: 2.5rem;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    text-align: center;
    margin-bottom: 10px;
}

.project-subtitle {
    font-size: 1.2rem;
    text-align: center;
    color: var(--text-color);
    margin-bottom: 20px;
}

.project-content {
    margin-top: 30px;
    line-height: 1.8;
}

.project-image {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.project-description {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

.project-description h1, h2, p, ul{
    margin-top: 1em;
    margin-bottom: 1em;
}

.project-description ul {
    list-style: inside;
}

.project-section-title {
    font-size: 1.5rem;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    margin-top: 20px;
    margin-bottom: 10px;
}

.project-tech ul {
    list-style: inside;
}

.project-tech ul li {
    font-size: 1rem;
    color: var(--text-color);
    font-style: italic;
}

.back-button {
    display: inline-block;
    margin-top: 30px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.back-button:hover {
    color: var(--accent-color-hover);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    margin-top: 1.2em;
    margin-bottom: 0.8em;
}

h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    letter-spacing: 1px;
}

h2 {
    font-size: 2rem;
    color: var(--text-color);
    padding-bottom: 5px;
}

h3 {
    font-size: 1.75rem;
    color: var(--text-color);
}

h4, h5, h6 {
    font-size: 1.5rem;
    color: var(--faint-text-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 1rem;
    text-align: left;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

table th, table td {
    padding: 12px;
    border: 1px solid var(--border-color);
}

table th {
    background: var(--accent-color);
    color: #fff;
    font-weight: bold;
}

table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

table tbody tr:hover {
    background: var(--background-color);
}