/* ============================================
   DARK ENERGY MEDIA — Portfolio Archive
   ============================================ */

:root {
  --bg: #f1f1f1;
  --bg-dark: #1a1a1a;
  --bg-elevated: #222;
  --bg-card: #2a2a2a;
  --text: #e0e0e0;
  --text-dark: #333;
  --text-muted: #999;
  --accent: #e8912a;
  --accent-dim: #c47a22;
  --border: #ddd;
  --border-dark: #333;
  --font-display: 'Montserrat', sans-serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --nav-max-width: 1400px;
  --grid-gap: 5px;
  --page-pad: 1.5rem;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

/* ---- HEADER / NAV ---- */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

/* Transparent header on project pages */
.page-project .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: none;
}

.page-project .nav-links a {
  color: rgba(255, 255, 255, 0.8);
}

.page-project .nav-links a:hover {
  color: #fff;
}

.page-project .nav-logo img {
  height: 43px;
}

.nav {
  max-width: var(--nav-max-width);
  margin: 0 auto;
  padding: 0.75rem var(--page-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo img {
  height: 40px;
  width: auto;
}



.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #666;
  text-transform: uppercase;
}

.nav-links a:hover { color: var(--text-dark); }

.nav-social {
  display: flex;
  gap: 1rem;
}

.nav-social a {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #666;
}

.nav-social a:hover { color: var(--text-dark); }

/* ---- PROJECT GRID ---- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--grid-gap);
  padding: var(--grid-gap);
}

.project-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-card);
  display: block;
  grid-column: span 3;
}

/*
 * Default (wide): 2+3 cycle on 6-col grid
 * Cards 1,2 = span 3 (half), Cards 3,4,5 = span 2 (third)
 */
.project-card:nth-child(5n+3),
.project-card:nth-child(5n+4),
.project-card:nth-child(5n+5) {
  grid-column: span 2;
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card__placeholder {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
}

.project-card:hover .project-card__image {
  transform: scale(1.05);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  padding: 1.25rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.05) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.project-card__categories {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.3rem;
}

.project-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  margin-bottom: 0.25rem;
}

/* Larger titles on the wide (half-width) cards */
.project-card:nth-child(5n+1) .project-card__title,
.project-card:nth-child(5n+2) .project-card__title {
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}

.project-card__date {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
}

/* ---- PROJECT HERO BANNER ---- */

.project-hero-banner {
  width: 100%;
  min-height: 90vh;
  background-size: cover;
  background-position: center;
  background-color: #111;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.project-hero-overlay {
  width: 100%;
  padding: 3rem clamp(1.5rem, 5vw, 4rem);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    transparent 100%
  );
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.project-hero-categories {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.5rem;
}

.project-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  margin-bottom: 0.5rem;
  max-width: 800px;
}

.project-hero-date {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
}

/* ---- PROJECT DETAIL ---- */

.project-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem var(--page-pad) 4rem;
}

/* Video embeds — full bleed */
.project-videos-fullbleed {
  margin-top: 2rem;
  margin-bottom: 2.5rem;
  padding: 0 var(--page-pad);
}

.project-videos-fullbleed .video-embed {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}

.project-videos-fullbleed .video-embed + .video-embed {
  margin-top: 2px;
}

.project-videos-fullbleed .video-embed iframe {
  width: 100%;
  height: 100%;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Bandcamp embed */
.bandcamp-embed {
  margin: 2rem auto;
  max-width: 400px;
  text-align: center;
}

.bandcamp-embed iframe {
  border: 0;
  width: 100%;
  height: 600px;
}

/* Content blocks */
.project-content {
  margin-bottom: 2rem;
}

.project-content p {
  margin-bottom: 1.5rem;
  line-height: 1.85;
  font-size: 0.95rem;
  color: #444;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

/* Caption-style paragraphs (paired with inline images) */
.project-content .inline-caption {
  font-size: 0.8rem;
  font-style: italic;
  color: #888;
  margin-top: -0.5rem;
  margin-bottom: 2.5rem;
  line-height: 1.5;
  max-width: none;
  text-align: center;
}

.project-figure {
  margin: 2.5rem 0 0.5rem;
  max-width: none;
  text-align: center;
}

.project-figure img {
  border-radius: 2px;
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.project-figure figcaption {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Inline video embeds (within content flow) */
.video-embed--inline {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 2rem 0;
}

/* Quote blocks */
.project-quote {
  text-align: center;
  margin: 2.5rem 0;
  padding: 2rem 1rem;
}

.project-quote blockquote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.5;
  color: #333;
  margin-bottom: 0.75rem;
}

.project-quote cite {
  font-size: 0.85rem;
  color: #888;
  font-style: normal;
}

/* Image gallery grid */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  margin: 2.5rem 0 0.5rem;
}

.project-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 2px;
  cursor: pointer;
}

/* Make inline/gallery images clickable */
.project-figure img {
  cursor: pointer;
}

/* ---- LIGHTBOX ---- */

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  line-height: 1;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  background: none;
  border: none;
  padding: 1rem;
  font-family: var(--font-sans);
  line-height: 1;
  user-select: none;
}

.lightbox-nav:hover {
  color: #fff;
}

.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

/* Crew & Technicals */
.project-info-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 3rem 0 2rem;
  border: 2px solid #333;
  background: #fafafa;
}

.project-info-box {
  padding: 1.5rem 1.75rem;
}

.project-info-box + .project-info-box {
  border-left: 2px solid #333;
}

.project-info-box h3 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.project-info-box pre {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  white-space: pre-wrap;
  color: #555;
  line-height: 1.9;
}

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

  .project-info-box + .project-info-box {
    border-left: none;
    border-top: 2px solid #333;
  }
}

/* Project nav */
.project-nav {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.back-link {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: #999;
}

.back-link:hover { color: var(--accent); }

/* ---- SERVICES PAGE ---- */

/* Transparent header on services page (same as project pages) */
.page-services .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: none;
}

.page-services .nav-links a {
  color: rgba(255, 255, 255, 0.8);
}

.page-services .nav-links a:hover {
  color: #fff;
}

.page-services .nav-logo img {
  height: 43px;
}

.services-hero-banner {
  width: 100%;
  min-height: 60vh;
  background-size: cover;
  background-position: center;
  background-color: #111;
  position: relative;
}

.services-hero-overlay {
  width: 100%;
  min-height: 60vh;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    transparent 100%
  );
}

.services-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem var(--page-pad) 4rem;
}

.services-content {
  max-width: 650px;
  margin: 0 auto;
}

.services-content p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: 1.05rem;
}

.services-link {
  color: var(--accent);
}

.services-link:hover {
  color: var(--accent-dim);
}

.services-signoff {
  color: var(--accent);
  font-size: 1rem;
  margin-top: 2rem;
}

/* ---- CONTACT PAGE ---- */

.page-contact {
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem var(--page-pad);
  text-align: center;
}

.page-contact h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.contact-email {
  display: block;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.contact-email:hover {
  color: var(--accent-dim);
}

.contact-phone {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.contact-social a {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
}

.contact-social a:hover { color: var(--accent); }

/* ---- FOOTER ---- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--nav-max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-social {
  display: flex;
  gap: 1.5rem;
}

.footer-social a {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
}

.footer-copy {
  font-size: 0.7rem;
  color: #999;
  letter-spacing: 0.1em;
}

/* ---- RESPONSIVE ---- */

/* Widest screens: 2+4 cycle on 4-col grid */
@media (min-width: 1400px) {
  .project-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Reset the 5n cycle */
  .project-card,
  .project-card:nth-child(5n+3),
  .project-card:nth-child(5n+4),
  .project-card:nth-child(5n+5) {
    grid-column: span 1;
  }

  /* 6-card cycle: first 2 = half, next 4 = quarter */
  .project-card:nth-child(6n+1),
  .project-card:nth-child(6n+2) {
    grid-column: span 2;
  }

  .project-card:nth-child(6n+1) .project-card__title,
  .project-card:nth-child(6n+2) .project-card__title {
    font-size: clamp(1.4rem, 3vw, 2.4rem);
  }
}

/* Medium screens: 1+2 cycle */
@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card,
  .project-card:nth-child(5n+3),
  .project-card:nth-child(5n+4),
  .project-card:nth-child(5n+5) {
    grid-column: span 1;
  }

  /* 3-card cycle: first full-width, next 2 half */
  .project-card:nth-child(3n+1) {
    grid-column: span 2;
  }

  .project-card:nth-child(3n+1) .project-card__title {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
  }

  .project-card__title {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
  }
}

/* Small screens: single column */
@media (max-width: 600px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    grid-column: span 1;
    aspect-ratio: 16 / 9;
  }

  .project-card__title {
    font-size: 1.3rem !important;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .nav-left {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav {
    flex-direction: column;
    gap: 0.5rem;
  }
}
