/* ============================================
   Brennan Mercer — Sound Design Portfolio
   Design: dark, editorial, film-credit inspired
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500&display=swap');

:root {
  --bg: #0b0b0a;
  --bg-raised: #121210;
  --fg: #ece8e0;
  --muted: #94897c;
  --accent: #c9793d;      /* tape amber */
  --accent-dim: #8a5a30;
  --teal: #3f5c58;        /* oscilloscope teal */
  --line: #2a2823;
  --line-soft: #1c1b17;

  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-body: 'Inter', -apple-system, sans-serif;

  --wrap: 1120px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */
header.site-head {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(11, 11, 10, 0.92);
  backdrop-filter: blur(6px);
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 34px 0 26px;
}

.site-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2.6rem;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin-left: 0.6em;
  display: inline-block;
}

.site-name .dot {
  color: var(--accent);
}

nav.site-nav {
  display: flex;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

nav.site-nav a {
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
}

/* ---------- Hero (generic, used by Newsletter etc.) ---------- */
.hero {
  padding: 64px 0 80px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  margin: 0 0 24px;
  max-width: 16ch;
}

/* ---------- About page split layout ---------- */
.about-split {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 130px);
  gap: 48px;
  padding: 48px;
}

.about-video {
  position: relative;
  flex: 1 1 50%;
  aspect-ratio: 4 / 3;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.about-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.about-text {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 40px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.about-text h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 24px;
  max-width: 18ch;
}

.bio {
  max-width: 52ch;
  font-size: 1.08rem;
  color: var(--fg);
}

.bio p {
  margin: 0 0 18px;
}

.bio em {
  color: var(--fg);
  font-style: italic;
}

.bio strong {
  color: var(--fg);
  font-weight: 500;
}

@media (max-width: 860px) {
  .about-split {
    flex-direction: column;
    min-height: auto;
    padding: 28px;
    gap: 32px;
  }

  .about-video {
    flex: none;
    width: 100%;
    aspect-ratio: 16/9;
  }

  .about-text {
    flex: none;
    padding: 0 16px;
  }
}

/* ---------- Section title on listing pages ---------- */
.page-head {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  margin: 0 0 8px;
}

.page-head .count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ---------- Filmography list ----------
   Stacked format to match the original site: title, then plain
   meta lines (category / bold role / year / italic dir / italic prod),
   then one large image or video underneath. */
.filmography {
  padding: 10px 0 80px;
}

.credit {
  padding: 44px 0;
  border-bottom: 1px solid var(--line-soft);
}

.credit:first-child {
  padding-top: 36px;
}

.credit-main h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0 0 14px;
  line-height: 1.2;
}

.credit-meta-list {
  margin: 0 0 26px;
  max-width: 46ch;
}

.credit-meta-list p {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: var(--fg);
}

.credit-meta-list .m-category {
  color: var(--muted);
}

.credit-meta-list .m-role {
  font-weight: 500;
  color: var(--accent);
}

.credit-meta-list .m-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.credit-meta-list .m-crew {
  font-style: italic;
  color: var(--muted);
}

.credit-media {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

.credit-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.credit:hover .credit-media img {
  transform: scale(1.02);
}

.credit-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.credit-media.video-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.credit-media.video-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dashed var(--line);
}

.credit-media.video-slot .video-slot-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* ---------- Thumbnail grid gallery (feature-film style) ----------
   Square thumbnails that reflow responsively; click opens a lightbox
   with the enlarged image and credit info. */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 28px;
  row-gap: 60px;
  padding: 50px 0 80px;
}

@media (min-width: 480px) {
  .thumb-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.thumb {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: transparent;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: center;
}

/* Padding-top trick: height is derived purely from the element's own
   width (100% = width), guaranteeing a perfect square regardless of
   image aspect ratio or grid auto-row sizing quirks. */
.thumb-frame {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-raised);
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.thumb:hover img,
.thumb:focus-visible img {
  transform: scale(1.05);
}

.thumb-title {
  display: block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.3;
  transition: color 0.2s ease;
}

.thumb:hover .thumb-title,
.thumb:focus-visible .thumb-title {
  color: var(--accent);
}

.thumb-frame.video-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-frame.video-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dashed var(--line);
  z-index: 1;
}

.thumb-frame.video-slot .video-slot-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 0 10px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 7, 0.96);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--header-height, 130px) + 20px) 24px 40px;
  overflow-y: auto;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  max-height: 90dvh;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  overflow: auto;
}

.lightbox-media {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  align-self: start;
}

.lightbox-media.multi {
  flex-direction: column;
  align-items: stretch;
}

.lightbox-media img,
.lightbox-media iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  aspect-ratio: 16/9;
}

.video-item {
  flex: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #000;
}

.video-item + .video-item {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 28px;
}

.video-item iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  outline: none;
  display: block;
  flex: none;
  flex-shrink: 0;
  background: #000;
}

.video-item-title {
  margin: 0;
  padding: 18px 16px 24px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--fg);
  background: var(--bg-raised);
  flex: none;
}

.lightbox-media .video-slot-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 40px;
}

.lightbox-info {
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.lightbox-info h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 18px;
  line-height: 1.2;
}

.lightbox-info p {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: var(--fg);
}

.lightbox-info .m-category { color: var(--muted); }
.lightbox-info .m-role { font-weight: 500; color: var(--accent); }
.lightbox-info .m-year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}
.lightbox-info .m-crew { font-style: italic; color: var(--muted); }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
  cursor: pointer;
  z-index: 210;
}

.lightbox-close {
  top: calc(var(--header-height, 100px) + 16px);
  right: 24px;
  font-size: 0.9rem;
  padding: 8px 14px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  padding: 10px 16px;
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

@media (max-width: 760px) {
  .lightbox {
    padding: calc(var(--header-height, 220px) + 16px) 16px 24px;
  }

  .lightbox-inner {
    grid-template-columns: 1fr;
    max-height: 85vh;
    max-height: 85dvh;
  }

  .lightbox-media {
    min-height: 200px;
  }

  .lightbox-prev, .lightbox-next {
    padding: 8px 12px;
    font-size: 1rem;
  }
}

/* ---------- Sound Art page ---------- */
.sound-art-hero {
  padding: 56px 0 20px;
}

.sound-art-pieces {
  padding: 20px 0 80px;
  display: grid;
  gap: 40px;
}

.piece {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.piece-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: block;
}

.piece p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 58ch;
  margin: 0;
  color: var(--fg);
}

.piece p strong {
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
}

/* ---------- Footer ---------- */
footer.site-foot {
  border-top: 1px solid var(--line);
  padding: 30px 0 50px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

footer.site-foot a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

footer.site-foot a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  nav.site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    display: none;
  }

  nav.site-nav.open {
    display: flex;
  }

  nav.site-nav a {
    padding: 16px 28px;
    border-bottom: 1px solid var(--line-soft);
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }

  footer.site-foot {
    flex-direction: column;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
