/* =====================================================
   RESET & GLOBAL STYLES
   ===================================================== */

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

:root {
    color-scheme: light dark;
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    font-family: Verdana, Geneva, sans-serif;
    line-height: 1.6;
    color: CanvasText;
    background-color: Canvas;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fadeInPage {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =====================================================
   HEADER & NAVIGATION
   ===================================================== */

header {
    background-color: #005086;
    color: #fff;
    padding: 1rem;
    background-image: url(img/circuit-background.svg);
    background-size: cover;
    background-position: top;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    padding-left: 0;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

nav ul li img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInPage 0.4s ease-in forwards;
    transition: color 0.4s, background-color 0.4s;
}

main h3 {
    margin-bottom: 1.5em;
}

main p {
    margin-bottom: 1.5em;
}

/* =====================================================
   PROJECTS PAGE LAYOUT
   ===================================================== */

.container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.content-box {
    display: flex;
    flex-direction: column;
    border-top: 4px solid #005086;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* Desktop alternating layout */
@media (min-width: 768px) {
    .content-box {
        flex-direction: row;
        align-items: center;
    }

    .image-wrapper,
    .text-wrapper {
        flex: 1;
        padding: 20px;
    }

    .content-box:nth-child(even) .image-wrapper {
        order: 2;
    }

    .content-box:nth-child(even) .text-wrapper {
        order: 1;
    }
}

/* =====================================================
   HOME PAGE ELEMENTS
   ===================================================== */

.circle-frame {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid CanvasText;
    float: left;
    margin-right: 20px;
    margin-bottom: none;
}

.circle-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.two-column-list {
    column-count: 2;
    column-gap: 40px;
    list-style-position: inside;
}

.two-column-list li {
    break-inside: avoid;
    margin-bottom: 8px;
}

.modern-quote {
    border-left: 5px solid #005086;
    margin: 1.5em 0;
    padding: 1em 1.5em;
    font-size: 1.1rem;
    font-style: italic;
}

.modern-quote cite {
    display: block;
    margin-top: 0.5em;
    font-size: 0.9rem;
    color: #666;
    font-style: normal;
    font-weight: bold;
}

ul, ol {
    padding-left: 40px;
}

/* =====================================================
   GALLERY PAGE LAYOUT
   ===================================================== */

.collage-container {
    display: grid;
    grid-auto-rows: 400px;
    grid-auto-flow: dense;
    gap: 15px;
    width: 100%;
    max-width: 1200px;
}

.collage-item {
    position: relative;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collage-item img {
    z-index: 10;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.collage-item:hover {
    z-index: 100;
    transform: scale(1.25);
    box-shadow: 0 8px 20px rgba(255,255,255,0.1);
}

@media (min-width: 600px) {
    .item-wide {
        grid-column: span 2;
    }

    .item-tall {
        grid-row: span 2;
    }

    .item-big {
        grid-column: span 2;
        grid-row: span 2;
    }
}

/* =====================================================
   FOOTER
   ===================================================== */

footer {
    padding: 2rem;
    margin: 0 auto;
    color: #fff;
    animation: fadeInPage 1.2s ease-in forwards;
    background-color: #005086;
    background-image: url(img/circuit-background.svg);
    background-size: cover;
    background-position: bottom;
}

/* =====================================================
   RESPONSIVE MEDIA QUERIES
   ===================================================== */

/* Mobile phones */
@media (max-width: 480px) {
    header {
        padding: 0.75rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav h1 {
      width: 100%;
      text-align: center;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        margin-top: 0.75rem;
        gap: 0.25rem 0.5rem;
    }

    nav ul li {
        margin: 0;
    }

    nav ul li a {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }

    main {
        padding: 1rem;
    }

    .circle-frame {
        width: 180px;
        height: 180px;
        float: none;
        display: block;
        margin: 0 auto 1.5rem;
    }

    .two-column-list {
        column-count: 1;
    }

    .collage-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        grid-auto-rows: 400px;
        display: grid;
        grid-auto-rows: 400px;
        grid-auto-flow: dense;
        gap: 15px;
        width: 100%;
        max-width: 480px;
    }

    .content-box {
        flex-direction: column;
    }

    footer {
        padding: 1rem;
        text-align: center;
    }
}

/* Tablet range */
@media (min-width: 481px) and (max-width: 760px) {
    main {
        padding: 1.5rem;
    }
}

/* Desktop Range */
@media (min-width: 761px) {
    .collage-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* =====================================================
   CONTACT FORM STYLES
   ===================================================== */
/* NOTE: These styles are placeholders for the contact page TBD */

.contact-section {
    width: 100%;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
    padding: 3rem 1rem;
}

.contact-intro > * + * {
    margin-top: 1rem;
}

.contact-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
}

.contact-description {
    color: CanvasText;
}

.form-group-container {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.form-input::placeholder,
.form-textarea:focus-visible {
    color: #6b7280;
}

.form-input:focus-visible,
.form-textarea:focus-visible {
    outline: 2px solid #005086;
    outline-offset: 2px;
}

.form-textarea {
    min-height: 120px;
}

.form-submit {
    width: 100%;
    margin-top: 1.2rem;
    background-color: #005086;
    color: #fff;
    padding: 13px 5px;
    border-radius: 0.375rem;
}