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

:root {
  --text:   #1a1a1a;
  --grey:   #888888;
  --bg:     #ffffff;
  --pad:    30px;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: -0.01em;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  text-transform: lowercase;
}

/* ── Nav ─────────────────────────────────────────────── */
nav {
  padding: 24px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 15px;
  font-weight: 300;
  color: var(--text);
}

nav a {
  font-size: 15px;
  font-weight: 300;
  color: var(--text);
  text-decoration: none;
}

/* ── Main container ───────────────────────────────────── */
main {
  padding: 0 var(--pad) 80px;
}

main.project-main {
  padding-top: 48px;
}

main.grid-main {
  padding-top: 40px;
}

/* ── Work grid ────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 10px;
  row-gap: 32px;
}

.grid-item {
  display: block;
  text-decoration: none;
  color: inherit;
}

.grid-item:hover .thumb {
  opacity: 0.85;
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: opacity 150ms ease;
  background: #ebebeb;
}

.grid-item-title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 300;
  color: #666666;
}

/* ── Project detail ───────────────────────────────────── */
.project-title {
  font-size: 32px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 32px;
  line-height: 1.2;
}

/* Project body — wraps layout rows + credits */
.project-body {
  display: flex;
  flex-direction: column;
}

.project-body--sidebar {
  flex-direction: row;
  align-items: flex-start;
  gap: 48px;
}

.project-body--sidebar .layout-rows {
  flex: 0 0 auto;
}

.project-body--sidebar .credits-section {
  flex-shrink: 0;
  width: 200px;
  margin-top: 0;
}

/* Layout rows */
.layout-rows {
  /* container — no extra styles needed */
}

.layout-row {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

/* Responsive embed wrapper.
   width + aspect-ratio are set inline per block via JS.
   width: min(100%, calc(72vh * ratio)) keeps height ≤ 72vh at any viewport size. */
.embed-wrapper {
  position: relative;
  background: #ebebeb;
}

.embed-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Image block */
.image-block {
  width: 100%;
  height: auto;
  display: block;
  background: #ebebeb;
}

/* Video block — custom player */
.video-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
}

.video-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 150ms;
}
.video-btn:hover { opacity: 0.4; }

.video-progress {
  flex: 1;
  height: 14px; /* tall hit area */
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
}
.video-progress::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: #d8d8d8;
}
.video-progress-fill {
  position: absolute;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--text);
  pointer-events: none;
}

.video-time {
  font-size: 11px;
  color: var(--grey);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Text block */
.text-block {
  font-size: 15px;
  font-weight: 300;
  color: var(--grey);
  line-height: 1.8;
}

/* Credits */
.credits-section {
  margin-top: 48px;
}

.credits {
  font-size: 14px;
  font-weight: 300;
  line-height: 2;
  color: var(--grey);
}

.production-note {
  font-size: 15px;
  font-weight: 300;
  color: var(--grey);
  font-style: italic;
  margin-top: 8px;
  display: none;
}

.next-link {
  display: block;
  text-align: right;
  font-size: 15px;
  color: #555555;
  text-decoration: none;
  font-weight: 300;
  margin-top: 48px;
  padding: 12px 0 12px 40px;
}

/* ── Contact ──────────────────────────────────────────── */
.contact-info {
  font-size: 15px;
  font-weight: 300;
  color: var(--grey);
  line-height: 2.4;
}

.contact-info a {
  color: var(--grey);
  text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .project-body--sidebar {
    flex-direction: column;
  }

  .project-body--sidebar .layout-rows {
    flex: unset;
    width: 100%;
  }

  .project-body--sidebar .embed-wrapper {
    width: 100% !important;
  }

.project-body--sidebar .credits-section {
    width: auto;
    margin-top: 0;
  }

  .project-body--sidebar {
    gap: 20px;
  }
}

@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Collapse all multi-column layout rows to single column on tablet/mobile */
  .layout-row {
    grid-template-columns: 1fr !important;
  }
}

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