/* =========================================
   Design System & Global Styles
   ========================================= */
:root {
    --primary-color: #0d1b2a;
    --secondary-color: #e0e1dd;
    --accent-color: #ff6b6b;
    --font-headings: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

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

body {
    font-family: var(--font-body);
    color: var(--secondary-color);
    background-color: var(--primary-color);
    font-size: 1.6rem;
}

/* =========================================
   Animations & Accessibility
   ========================================= */
.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease-out;
}

.fade-in-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays */
.project-tile.fade-in-element:nth-child(1) {
    transition-delay: 0.1s;
}

.project-tile.fade-in-element:nth-child(2) {
    transition-delay: 0.2s;
}

.project-tile.fade-in-element:nth-child(3) {
    transition-delay: 0.3s;
}

.toolkit-grid.fade-in-element,
#contact>p.fade-in-element {
    transition-delay: 0.2s;
}

.social-links.fade-in-element {
    transition-delay: 0.3s;
}

:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 2px;
}

/* =========================================
   Main Layout & Sections
   ========================================= */
section[id] {
    scroll-margin-top: 8rem;
}

#navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    background-color: rgba(13, 27, 42, 0.85);
    backdrop-filter: blur(5px);
}

#welcome-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(rgba(13, 27, 42, 0.8), rgba(13, 27, 42, 0.8)), url('https://images.unsplash.com/photo-1644088379091-d574269d422f?q=80&w=1093&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG9otby1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
    padding: 0 2rem;
}

#projects,
#mytoolkit,
#contact {
    padding: 10rem 2rem;
    text-align: center;
}

#projects,
#contact {
    background-color: #1b263b;
}

#mytoolkit {
    background-color: var(--primary-color);
}

footer {
    font-weight: 300;
    display: flex;
    justify-content: center;
    padding: 2rem;
    border-top: 3px solid var(--accent-color);
}

/* =========================================
   Components & Typography
   ========================================= */
.section-title {
    font-family: var(--font-headings);
    font-size: 4.2rem;
    margin: 0 auto 6rem auto;
    padding-bottom: 1rem;
    max-width: 640px;
    border-bottom: 3px solid var(--accent-color);
    transition: color 0.3s ease-out, text-shadow 0.3s ease-out;
}

.section-title:hover {
    color: var(--accent-color);
    text-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

#welcome-section h1 {
    font-family: var(--font-headings);
    font-size: 6rem;
    font-weight: 700;
    text-align: center;
    max-width: 960px;
}

.hero-subtitle {
    color: var(--accent-color);
    font-size: 2.5rem;
    font-weight: 300;
    margin-top: 1rem;
    max-width: 90ch;
    text-align: center;
}

#navbar ul {
    list-style-type: none;
    display: flex;
    gap: 4rem;
}

#navbar a {
    display: block;
    text-decoration: none;
    padding: 2rem;
    color: var(--secondary-color);
    transition: color 0.2s ease-in-out;
}

#navbar a:hover {
    color: var(--accent-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    gap: 4rem;
}

.project-tile {
    display: block;
    background: var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    color: var(--secondary-color);
}

.project-tile:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5);
}

.project-tile img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.project-info {
    padding: 2rem;
    text-align: left;
}

.project-info h3 {
    font-family: var(--font-headings);
    font-size: 2.2rem;
    color: var(--secondary-color);
}

.project-info p {
    font-size: 1.6rem;
    margin-top: 1rem;
    line-height: 1.5;
}

.toolkit-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.toolkit-item {
    background-color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.8rem;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    transition: box-shadow 0.3s ease-out;
}

.toolkit-item:hover,
.toolkit-item:focus-within {
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

#contact {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#contact p {
    font-size: 1.8rem;
    font-style: italic;
    max-width: 60ch;
    margin-top: -3rem;
    margin-bottom: 3rem;
}

.email-address {
    color: var(--accent-color);
    font-weight: 700;
    user-select: all;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    font-size: 2.4rem;
}

.social-links a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: transform 0.3s ease-out, color 0.3s ease-out;
}

.social-links a:hover {
    transform: translateY(-4px);
    color: var(--accent-color);
}

/* =========================================
   Media Queries
   ========================================= */
@media (max-width: 768px) {
    #navbar {
        justify-content: center;
    }

    #navbar ul {
        gap: 2rem;
    }

    #welcome-section h1 {
        font-size: 4.5rem;
    }
}

@media (max-width: 480px) {
    .project-info h3 {
        font-size: 1.8rem;
    }

    .project-info p {
        font-size: 1.4rem;
    }

    .toolkit-item {
        font-size: 1.6rem;
        padding: 1rem 1.5rem;
    }

    .hero-subtitle {
        font-size: 2rem;
    }

    .projects-grid {
        gap: 2rem;
    }
}