* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Ubuntu Sans Mono", monospace;
    background: #f6f6f6;
    color: #222;
}

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    font-size: 0.7rem;
    text-align: left;
    background: #000000;
    color: white;
}

/* Remove default margin */
.header h1,
.header p {
    margin: 0;
}

.title {
    padding: 2rem 2rem;
}

.home-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.home-link:hover {
    opacity: 0.8;
}

.project-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    font-size: 1rem;
    background: #f6f6f6;
}

.filter-button {
    border: none;
    padding: 0.6rem 1rem;
    background: transparent;
    color: #979797;
    cursor: pointer;
    font: inherit;
}

.filter-button:hover,
.filter-button.active {
    color: #222;
}

.gallery-section {
    padding: 0 2rem 2rem;
    margin: 0 auto;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 2vw, 2rem);
    margin: 0 2rem;
}

.project-card {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.project-card-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Title */
.project-card-overlay h3 {
  color: white;
  margin: 0;
  padding: 0 1rem;
  text-align: center;
  font-size: 1.2rem;
}

/* Hover effects */
.project-card:hover img {
  transform: scale(1.05);
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-card h3 {
    margin-top: 0;
}

.project-card a {
    display: inline-block;
    margin-top: 0.25rem;
    color: #005fcc;
    text-decoration: none;
}

/* Project Page */

.project-detail {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 5rem;
}

.project-hero {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.project-hero-image {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: block;
}

.project-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.35),
        transparent
    );
}

.project-hero-content {
    padding: clamp(2rem, 6vw, 5rem);
    color: white;
}

.project-hero-content h1 {
    margin: 0;
    margin-bottom: 0.5rem;
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
}

.project-hero-content p {
    max-width: 650px;
    margin-top: 1rem;
    margin-left: 2rem;
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.project-media {
    margin-top: 1rem;
    display: grid;
    gap: 5rem;
}

.media-group {
    display: grid;
    gap: 1.5rem;
}

.media-group.single {
    grid-template-columns: 1fr;
    justify-items: center;
}

.media-group.single .project-media-item {
    width: 100%;
    text-align: center;
}

.media-group.single .project-media-item figcaption {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.media-group.side-by-side .project-media-item {
    height: 100%;
    aspect-ratio: 16/9;
    text-align: center;
}

.media-group.side-by-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
    text-align: center;
}

.project-media-item img,
.project-media-item video {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    object-fit: contain;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.project-gif {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-media-item {
    margin: 0;
    width: 100%;
    min-width: 0;
    text-align: center;
}

.project-media-item img,
.project-media-item video {
    display: block;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.project-media-item video {
    background: black;
    text-align: center;
}

.project-media-item figcaption {
    max-width: 720px;
    margin: 0.5rem auto 0.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    text-align: center;
}

.project-embed {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    align-items: center;
}

/* ↓ Large tablets / small desktops */
@media (max-width: 1100px) {
  .project-gallery {
        grid-template-columns: repeat(2, 1fr);
        margin: 0 1rem;
  }
}

/* ↓ Tablets */
@media (max-width: 800px) {
  .project-gallery {
        grid-template-columns: repeat(1, 1fr);
  }
}

/* Responsive: stack on small screens */
@media (max-width: 700px) {
    .media-group.side-by-side {
        grid-template-columns: 1fr;
    }

    .project-gallery {
        grid-template-columns: 1fr;
        margin: 0;
    }

      .project-detail {
        padding: 0 1rem 3rem;
    }

    .project-hero,
    .project-hero-image {
            min-height: 420px;
            height: 420px;
    }

    .project-hero-content {
            padding: 2rem;
    }

    .media-group.side-by-side {
            grid-template-columns: 1fr;
            text-align: center;
    }
}