:root {
  --bg: #fff;
  --fg: #111;
  --muted: #7a7a7a;
  --line: #ebebeb;
  --tile: #111;
  --gap: 8px;
  --pad: 32px;
  color-scheme: light;
}

/* Dark theme: follows the device setting unless the visitor picked light,
   or applies when they picked dark (theme.js sets data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f;
    --fg: #ececec;
    --muted: #8c8c8c;
    --line: #262626;
    --tile: #1c1c1c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --fg: #ececec;
  --muted: #8c8c8c;
  --line: #262626;
  --tile: #1c1c1c;
  color-scheme: dark;
}

/* Logos that need a different version or backing in each theme. */
.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: inline !important; }
  :root:not([data-theme="light"]) .only-light { display: none !important; }
  :root:not([data-theme="light"]) .client img.mark { background: #fff; padding: 6px; }
}
:root[data-theme="dark"] .only-dark { display: inline !important; }
:root[data-theme="dark"] .only-light { display: none !important; }
:root[data-theme="dark"] .client img.mark { background: #fff; padding: 6px; }

.theme-toggle {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.6 'Work Sans', system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--muted); }
p a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }

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

h1, p { margin: 0; }

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

/* Header */

.site-header {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}

.logo { font-weight: 500; letter-spacing: 0.01em; }

.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 28px; font-size: 13px; }
.site-nav a { color: var(--muted); }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fg); }

/* Page intros */

.intro {
  padding: 56px 0 40px;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro h1 { font-size: 28px; font-weight: 400; line-height: 1.25; }
.intro p { color: var(--muted); }

.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
a.label:hover { color: var(--fg); }

.empty-note {
  padding: 96px 24px;
  border: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
}

/* Home */

.home { padding: 10vh 0 48px; }

.home .bio {
  max-width: 820px;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.4;
}

.home .cta {
  display: inline-block;
  margin-top: 36px;
  font-size: 15px;
  border-bottom: 1px solid var(--fg);
}
.home .cta:hover { border-color: var(--muted); }

.home-image { margin-top: 10vh; }
.home-image img { width: 100%; height: min(70vh, 760px); object-fit: cover; object-position: center 60%; }

/* About */

.about {
  padding-top: 48px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  align-items: center;
}
.about > img { grid-column: span 5; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about-text { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 16px; max-width: 600px; }
.about-text .lead { margin: 0 0 8px; font-size: 24px; font-weight: 400; line-height: 1.3; }
.about-text p:last-child { margin-top: 8px; }

/* Contact */

.contact { padding: 10vh 0 24px; }
.contact h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 400; line-height: 1.05; margin-bottom: 48px; }
.contact-links { list-style: none; margin: 0; padding: 0; max-width: 720px; border-top: 1px solid var(--line); }
.contact-links li { border-bottom: 1px solid var(--line); }
.contact-links a {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 20px 0;
  font-size: 18px;
}

/* Social: category cards */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.card { display: flex; flex-direction: column; gap: 12px; }
.card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: opacity 0.2s; }
.card:hover img { opacity: 0.88; }
.card:hover { color: var(--fg); }
.card span { font-size: 15px; }

/* Clips: video tiles on category pages and the Thirty Days calendar */

.clips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}
.clips.landscape { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.clip,
.day {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--tile);
  color: #fff;
  overflow: hidden;
}
.clips.landscape .clip { aspect-ratio: 16 / 9; }
.day { aspect-ratio: 4 / 5; }

.clip img,
.clip video,
.day img,
.day video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.clip,
.day.filled { cursor: pointer; }
.clip .tag,
.day.filled .tag { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.clip:hover,
.day.filled:hover { color: #fff; }
.clip:hover img,
.clip:hover video,
.day.filled:hover img,
.day.filled:hover video { opacity: 0.85; }
.day.empty .tag { color: #6e6e6e; }
.day.filled::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.day.filled .tag { z-index: 1; }

/* Photo sets: one row per group. Each photo's flex-grow is its aspect ratio
   (--r = width / height), so every photo in a row ends up the same height. */

.set-block + .set-block,
.clips:not(:empty) + .set-block { margin-top: 56px; }
.set-block > .label { display: block; margin-bottom: 14px; }
.set-title { margin: 0 0 16px; font-size: 18px; font-weight: 400; }

.client { display: inline-flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.client img { width: 72px; height: 72px; padding: 6px; background: var(--bg); }
.client .set-title { margin: 0; display: flex; align-items: center; gap: 10px; }
.client img.wordmark { width: auto; height: 30px; padding: 0; }
.client img.mark { width: auto; height: 48px; padding: 0; }

/* Two client sections side by side. Subgrid lines up their title, optional
   description and video rows so both videos start at the same height. */
.set-block + .pair,
.pair + .set-block { margin-top: 56px; }
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}
.pair > .set-block {
  margin-top: 0;
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  align-content: start;
}
.pair > .set-block > .client { grid-row: 1; align-self: start; min-height: 48px; }
.pair > .set-block > .set-lede { grid-row: 2; }
.pair > .set-block > .set { grid-row: 3; }

.set { display: flex; gap: var(--gap); align-items: flex-start; }
.set + .set { margin-top: var(--gap); }
.set > a { flex: var(--r, 1) 1 0%; min-width: 0; max-width: calc(620px * var(--r, 1)); cursor: zoom-in; }
.set img { width: 100%; height: auto; }
.set > a:hover img { opacity: 0.9; }
.set > a.play { position: relative; cursor: pointer; }
.set > a.play::after {
  content: '▶ Play';
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.set-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.set-lede { max-width: 560px; margin: -8px 0 16px; color: var(--muted); }
.client + .set-lede { margin-top: -12px; }

/* Hover previews (preview.js): fade the muted clip in once it's playing. */
video.preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.previewing > video.preview.ready { opacity: 1; }

.calendar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
}

/* Footer */

.site-footer {
  max-width: 1440px;
  margin: 96px auto 0;
  padding: 28px var(--pad) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a:hover { color: var(--fg); }
.site-footer .copy { margin-left: auto; }

/* Lightbox */

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
}
.lightbox::backdrop { background: transparent; }
.lb-stage { width: 100%; height: 100%; display: grid; place-items: center; padding: 56px; }
.lb-stage img,
.lb-stage video { max-width: 100%; max-height: calc(100dvh - 112px); object-fit: contain; }
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  padding: 16px 20px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
}
.lightbox button:hover { color: var(--muted); }
.lb-close { top: 0; right: 0; }
.lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev,
.lightbox.single .lb-next { display: none; }

/* Flyers: a uniform 4:5 grid so the columns line up */

.flyers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.flyer { display: block; cursor: zoom-in; }
.flyer img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--tile); transition: opacity 0.2s; }
.flyer:hover img { opacity: 0.9; }

/* Small screens */

@media (max-width: 760px) {
  :root { --pad: 16px; }
  .site-header { padding-top: 20px; padding-bottom: 20px; flex-direction: column; gap: 10px; }
  .site-nav { justify-content: flex-start; gap: 8px 20px; }
  .intro { padding: 32px 0 28px; }
  .intro h1 { font-size: 24px; }
  .home { padding-top: 6vh; }
  .home-image img { height: 56vh; }
  .cards { grid-template-columns: 1fr; gap: 32px; }
  .about { display: flex; flex-direction: column; gap: 32px; padding-top: 32px; }
  .contact-links a { grid-template-columns: 1fr; gap: 4px; font-size: 16px; }
  .clips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clips.landscape { grid-template-columns: 1fr; }
  .flyers { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .pair > .set-block { display: block; }
  .pair > .set-block + .set-block { margin-top: 56px; }
  .set { flex-wrap: wrap; }
  .set > a { flex: 1 1 calc(50% - var(--gap)); max-width: none; }
  .set > a.wide { flex-basis: 100%; }
  .calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .day .tag { flex-direction: column; gap: 0; font-size: 11px; line-height: 1.4; white-space: nowrap; }
  .site-footer .copy { margin-left: 0; width: 100%; }
  .lb-stage { padding: 48px 8px; }
}
