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

body { 
    font-family: Arial,
    sans-serif;
    line-height: 1.6;
}

header { 
    background: #333;
    color: #fff; 
    text-align: center;
    background-size: cover; 
    background-position: center; 
    background-attachment:inherit;
    width: 100%; 
    height: 100%; 
    overflow: hidden;
}

.HeaderText{
    background-color: rgba(128, 128, 128, 0.5);
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.HeaderTextMajor{
    background-color: rgba(128, 128, 128, 0.5);
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.HeaderTextMajor:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.HeadshotImg{
    width: 80%;
    max-width: 300px;
    height: auto;
    border-radius: 50px;
    padding: 2vw;
    animation: slideInFromTop 0.8s ease-out;
    transition: transform 0.2s, box-shadow 0.2s;
}

.HeadshotImg:hover {
    transform: scale(1.08);
}

nav { background: #444;
    padding: 0.5rem;
}

nav a { 
    color: #fff;
    margin: 0 1rem; 
    text-decoration: none; 
}

section { 
    padding: 2rem; 
    max-width: 1000px; 
    margin: 0 auto;
}

#projects {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

#projects h2 {
    grid-column: 1 / -1;
}

.project { 
    position: relative;
    display: flex;
    align-items: flex-end;
    aspect-ratio: 1;
    background-color: rgb(231, 231, 231);
    border-radius: 20px;
    padding: 0;
    margin: 1rem 0;
    box-shadow: #333 4px 4px 6px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project::before {
    content: "";
    position: absolute;
    inset: 0 0 3.5rem;
    background-image: var(--project-image);
    background-position: center;
    background-size: cover;
    border-radius: 20px 20px 0 0;
}

.project:hover,
.project:focus-visible {
    transform: translateY(-3px);
    box-shadow: #333 6px 7px 10px;
    outline: none;
}

.project h3 {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0.75rem 1rem;
    color: #333;
    background: rgb(231, 231, 231);
    text-align: center;
}

@media (max-width: 800px) {
    #projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    section {
        padding: 1rem;
    }

    #projects {
        grid-template-columns: 1fr;
    }
}

.project-header {
    position: relative;
    background-color: #333;
    background-image: url('./imgs/Banner.jpg');
    background-position: center;
    background-size: cover;
    color: #fff;
    padding: 2rem clamp(1rem, 5vw, 4rem);
}

.project-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
}

.project-header > * {
    position: relative;
}

.project-header h1 {
    margin-top: 1rem;
    text-align: center;
}

.back-link {
    display: inline-block;
    padding: 0.6rem 1rem;
    color: #333;
    background: #fff;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.back-link:hover,
.back-link:focus-visible {
    background: #e7e7e7;
    transform: translateY(-2px);
    outline: none;
}

.project-page {
    min-height: calc(100vh - 210px);
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 5vw, 3rem);
}

#project-description {
    max-width: 75ch;
    margin: 2rem auto 0;
    line-height: 1.8;
    text-align: center;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(1rem, 3vw, 1.5rem);
}

.project-gallery a {
    display: block;
}

.project-page-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.project-page-image:hover {
    transform: scale(1.03);
}

#image-modal {
    position: relative;
    width: min(94vw, 1100px);
    max-width: none;
    max-height: 92vh;
    margin: auto;
    padding: clamp(2.5rem, 5vw, 3rem) clamp(0.75rem, 2vw, 1.5rem) clamp(0.75rem, 2vw, 1.5rem);
    border: none;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

#image-modal::backdrop {
    background: rgba(0, 0, 0, 0.75);
}

#expanded-image {
    display: block;
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
}

#close-image {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    color: #333;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 520px) {
    #image-modal {
        width: 94vw;
        border-radius: 10px;
    }

    #expanded-image {
        max-height: 76vh;
    }
}

@media (max-width: 520px) {
    .project-gallery {
        grid-template-columns: 1fr;
    }
}

footer { 
    background: #333; 
    color: #fff; 
    text-align: center; 
    padding: 1rem; 
}

.carousel__viewport {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory; /* Forces snapping along the x-axis */
  scroll-behavior: smooth;
  -ms-overflow-style: none; /* Hide scrollbars for IE/Edge */
  scrollbar-width: none;    /* Hide scrollbars for Firefox */
}

.carousel__viewport::-webkit-scrollbar {
  display: none; /* Hide scrollbars for Chrome/Safari */
}

.carousel__slide {
  flex: 0 0 100%; /* Each slide takes 100% width */
  width: 100%;
  scroll-snap-align: center; /* Snaps the slide to the center of the viewport */
}

.carousel__slide img {
  width: 100%;
  height: auto;
  object-fit: cover;
}