:root {
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-sub: #4b5563;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-main);
  background: #f7f8fb;
}

.projects-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.projects-title {
  margin: 0 0 1rem;
  font-size: 1.8rem;
}

/* One project per row: thumbnail | copy (not a multi-column grid of cards) */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-divider {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid var(--border);
  height: 0;
}

.project-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.project-body {
  flex: 1;
  min-width: 0;
}

.project-media-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  flex-shrink: 0;
  width: fit-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: var(--text-sub);
  text-align: left;
}

.project-media-open--image {
  cursor: zoom-in;
}

.project-media-poster {
  position: relative;
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.project-media-poster--image .project-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.project-media-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.1) 45%,
    transparent 100%
  );
  pointer-events: none;
}

.project-media-poster .project-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.project-media-caption {
  font-size: 0.7rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-sub);
}

/* Inline walkthrough: up to 480p frame (854×480 @ 16:9); native controls = seek/play/pause/fullscreen */
.project-media--inline-video {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  max-width: 854px;
  align-self: flex-start;
}

/* Fixed frame: layout does not grow when the video is focused or playback starts; true fullscreen uses the native control only. */
.project-video-frame {
  position: relative;
  width: 100%;
  max-width: 854px;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.project-walkthrough-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: #000;
}

/* Fullscreen: fill the screen; object-fit keeps aspect ratio. Decoded video uses the file’s native resolution, not the inline layout size. */
.project-walkthrough-video:fullscreen,
.project-walkthrough-video:-webkit-full-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.project-media-open:hover .project-media-poster,
.project-media-open:focus-visible .project-media-poster {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.project-media-open:focus {
  outline: none;
}

.project-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
}

.project-name {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.project-desc {
  margin: 0;
  color: var(--text-sub);
  line-height: 1.45;
  font-size: 0.95rem;
}

/* Same idea as photography-gallery lightbox: dark scrim, centered media */
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.88);
  display: grid;
  place-items: center;
  padding: min(2rem, 4vw);
}

.media-lightbox[hidden] {
  display: none;
}

.media-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  border: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.media-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.media-lightbox-panel {
  max-width: min(96vw, 1280px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-lightbox-img {
  display: block;
  max-width: min(95vw, 1300px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

@media (max-width: 540px) {
  .project-media-open {
    flex-direction: row;
    width: auto;
    justify-content: flex-start;
    align-items: center;
  }
}
