/* Keep the gallery on its own white surface above the testimonial decoration. */
#projects {
  isolation: isolate;
  gap: clamp(96px, 8vw, 128px) !important;
}

#projects .framer-1pjujsq-container {
  position: relative;
  z-index: 2;
  background: #fff;
  padding-bottom: clamp(56px, 6vw, 96px);
}

#projects .framer-pn4uvc {
  position: relative;
  z-index: 2;
}

#projects .framer-1yimtj1-container {
  pointer-events: none;
}

.project-gallery {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  margin-inline: auto;
  font-family: Inter, Arial, sans-serif;
  color: #171717;
}

.project-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 56px;
}

.project-gallery-header h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.06em;
}

.project-layout-switch {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 6px #00000008;
}

.project-layout-switch button {
  padding: 6px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #777;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.project-layout-switch button[aria-pressed="true"] { background: #ededed; color: #171717; }
.project-layout-switch button:focus-visible { outline: 2px solid #171717; outline-offset: 3px; }

.project-category {
  width: 100%;
  max-width: 704px;
  min-width: 0;
  margin: 0 auto;
  scroll-margin-top: 48px;
}

.project-category + .project-category { margin-top: clamp(64px, 7vw, 96px); }
.project-category--landscape { max-width: 1120px; }

.project-category-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid #e8e8e8;
}

.project-category-index {
  color: #999;
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.project-category-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -.035em;
}

.project-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  justify-items: center;
  align-items: start;
}

.project-video-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  min-width: 0;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
  background: #0f0f0f;
}

.project-video-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.project-category--landscape .project-category-grid { grid-template-columns: minmax(0, 1fr); }
.project-video-card--landscape { max-width: 100%; aspect-ratio: 16 / 9; }
.project-gallery[data-layout="list"] .project-category-grid { grid-template-columns: minmax(0, 1fr); }

.project-category--landscape .project-category-grid--youtube {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 32px;
}

.project-youtube-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.project-youtube-card:hover { border-color: #c8c8c8; box-shadow: 0 6px 20px #00000009; }
.project-youtube-card:focus-visible { outline: 2px solid #171717; outline-offset: 5px; }

.project-youtube-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}

.project-youtube-thumbnail > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project-youtube-thumbnail > img { position: absolute; inset: 0; }
.project-youtube-thumbnail > video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.project-youtube-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  border: 1px solid #ffffff66;
  border-radius: 50%;
  background: #0009;
  color: #fff;
}
.project-youtube-play svg { display: block; width: 26px; height: 26px; margin-left: 3px; }
.project-youtube-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #000c;
  color: #fff;
  font: 11px/1.2 "DM Mono", monospace;
}

.project-youtube-body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 20px; }
.project-youtube-client { margin: 0; color: #777; font-size: 12px; line-height: 1.4; }
.project-youtube-body h4 { margin: 0; font-size: 19px; font-weight: 500; line-height: 1.4; letter-spacing: -.025em; text-wrap: pretty; }
.project-youtube-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 8px; font-size: 12px; line-height: 1.4; }
.project-youtube-views { color: #737373; }
.project-youtube-action { color: inherit; font-weight: 500; text-decoration: none; }
.project-youtube-card:hover .project-youtube-action { text-decoration: underline; text-underline-offset: 3px; }
.project-views-note { margin: 16px 0 0; color: #888; font-size: 11px; line-height: 1.5; text-align: right; }

@media (max-width: 767.98px) {
  .project-category--landscape .project-category-grid--youtube { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .project-youtube-card { transition: none; }
}

@media (max-width: 599.98px) {
  .project-gallery-header { margin-bottom: 36px; }
  .project-gallery-header h2 { font-size: 27px; }
  .project-layout-switch { display: none; }
  .project-category-grid { grid-template-columns: minmax(0, 1fr); }
  .project-category-header { margin-bottom: 24px; }
  .project-category-header h3 { font-size: 19px; }
}

