/* ==========================================================================
   Jason B. Kohl — jasonbkohl.com
   Edit this file, then run:  python3 build/build.py
   ========================================================================== */

:root {
  /* Light, warm paper — set these five and the whole site follows. */
  --bg:        #f3ebe7;   /* page background        */
  --bg-soft:   #e7ddd8;   /* tiles before an image loads */
  --fg:        #16151a;   /* headings, primary text */
  --fg-dim:    #5d5852;   /* body copy              */
  --fg-faint:  #948d86;   /* labels, meta           */
  --rule:      rgba(22, 21, 26, 0.16);
  --rule-soft: rgba(22, 21, 26, 0.09);


  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --grid-gap: clamp(16px, 2.2vw, 40px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

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

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

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

::selection { background: var(--fg); color: var(--bg); }

/* --------------------------------------------------------------- header -- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* wordmark | nav (centred) | spacer */
  align-items: center;
  gap: 24px;
  padding: 26px var(--gutter);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule-soft);
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 23px);
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
}

.nav {
  grid-column: 2;
  display: flex;
  justify-content: center;
  gap: clamp(20px, 3vw, 44px);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.01em;
  font-weight: 400;
  color: var(--fg-dim);
}

.nav a { position: relative; padding-bottom: 3px; transition: color .25s var(--ease); }
.nav a:hover { color: var(--fg); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ----------------------------------------------------------------- work -- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2.4vw, 34px);
  padding: clamp(34px, 6vw, 70px) var(--gutter) clamp(22px, 3vw, 34px);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 500;
}

.filters button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0 4px;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--fg-faint);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.filters button:hover { color: var(--fg-dim); }
.filters button[aria-pressed="true"] { color: var(--fg); border-bottom-color: var(--fg); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap) var(--grid-gap);
  max-width: 1720px;
  margin: 0 auto;
  padding: clamp(30px, 4vw, 56px) clamp(14px, 1.6vw, 28px) clamp(56px, 8vw, 104px);
}
.grid--inset { padding-top: 0; }

.tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
  isolation: isolate;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96);
  transition: transform 1.1s var(--ease), filter .5s var(--ease), opacity .5s var(--ease);
}

.tile:hover img,
.tile:focus-visible img { transform: scale(1.03); filter: saturate(1) brightness(0.48); }

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 55%);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }

.tile__caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: clamp(14px, 1.6vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.tile:hover .tile__caption,
.tile:focus-visible .tile__caption { opacity: 1; transform: none; }

.tile__caption { color: #fff; }

.tile__title {
  font-family: var(--serif);
  font-size: clamp(19px, 1.9vw, 27px);
  line-height: 1.12;
}

.tile__meta {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.75);
}

/* tiles with no still yet — typographic fallback */
.tile--type {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--rule-soft);
}
.tile--type .tile__fallback {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-size: clamp(21px, 2.2vw, 32px);
  line-height: 1.15;
  color: var(--fg);
  transition: transform .5s var(--ease), opacity .4s var(--ease);
}
.tile--type .tile__fallback span {
  display: block;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
}
/* the fallback already states the title — don't repeat it in the caption */
.tile--type .tile__caption { display: none; }
.tile--type:hover .tile__fallback { transform: translateY(-2px); }
.tile--type::after { background: rgba(22,21,26,.05); }

/* ------------------------------------------------------------- project -- */

.page { padding: 0 var(--gutter); }

.wrap { max-width: 1180px; margin: 0 auto; }
.wrap--narrow { max-width: 760px; margin: 0 auto; }

.backlink {
  display: inline-block;
  margin: clamp(26px, 4vw, 48px) 0 clamp(20px, 3vw, 30px);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
  transition: color .25s var(--ease);
}
.backlink:hover { color: var(--fg); }

.project__head { margin-bottom: clamp(26px, 4vw, 44px); }

.project__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6.2vw, 76px);
  line-height: 1.03;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--fg-dim);
}
.project__meta span + span::before {
  content: "";
  display: inline-block;
  width: 3px; height: 3px;
  margin-right: 18px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--fg-faint);
}
.project__meta .status { color: var(--fg); }

.media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  margin-bottom: clamp(30px, 4.5vw, 56px);
}
.media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media img { width: 100%; height: 100%; object-fit: cover; }

.media__note {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 18px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
}

.project__body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(34px, 6vw, 90px);
  padding-bottom: clamp(48px, 8vw, 110px);
}

.lede {
  font-family: var(--serif);
  font-size: clamp(22px, 2.5vw, 31px);
  line-height: 1.34;
  margin: 0 0 26px;
  color: var(--fg);
}

.project__body p { color: var(--fg-dim); margin: 0 0 16px; }
.project__body p:last-child { margin-bottom: 0; }

.sidebar h2, .section-label {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
  font-weight: 400;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.sidebar + .sidebar, .sidebar__block + .sidebar__block { margin-top: 38px; }

.press { margin: 0; }
.press blockquote { margin: 0 0 26px; }
.press blockquote:last-child { margin-bottom: 0; }
.press q {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.4;
  quotes: "\201C" "\201D";
  color: var(--fg);
}
.press cite {
  display: block;
  margin-top: 9px;
  font-style: normal;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
}

.credits { font-size: 13px; line-height: 1.85; color: var(--fg-dim); }

.laurels { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.laurels img { height: 74px; width: auto; opacity: .8; }

.linklist { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.linklist a {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  transition: border-color .25s var(--ease), color .25s var(--ease);
  color: var(--fg-dim);
}
.linklist a:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* --------------------------------------------------------------- pager -- */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(26px, 4vw, 40px) 0;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
}
.pager a { transition: color .25s var(--ease); }
.pager a:hover { color: var(--fg); }

/* ---------------------------------------------------------- text pages -- */

.page-head {
  padding: clamp(50px, 9vw, 120px) 0 clamp(30px, 4vw, 50px);
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.01em;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(30px, 5vw, 80px);
  padding-bottom: clamp(50px, 8vw, 110px);
}

.prose p { margin: 0 0 20px; color: var(--fg-dim); }
.prose p:last-child { margin-bottom: 0; }

.portrait { width: 100%; filter: grayscale(1) contrast(1.02); }

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.taglist li {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--fg-dim);
  border: 1px solid var(--rule);
  padding: 6px 12px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: clamp(28px, 4vw, 52px);
  padding-bottom: clamp(50px, 8vw, 110px);
}
.contact-card h2 {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
  font-weight: 400;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.contact-card p { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.45; }
.contact-card p span { display: block; font-family: var(--sans); font-size: 14px; color: var(--fg-dim); }

.reel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: clamp(22px, 3vw, 44px);
  padding-bottom: clamp(50px, 8vw, 110px);
}
.reel h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 16px 0 4px; }
.reel p { margin: 0; font-family: var(--serif); font-size: 13px; color: var(--fg-faint); }
.reel .media { margin-bottom: 0; }

/* -------------------------------------------------------------- footer -- */

.footer {
  border-top: 1px solid var(--rule-soft);
  padding: clamp(28px, 4vw, 44px) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  justify-content: center;
  align-items: baseline;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
}
.footer a { transition: color .25s var(--ease); }
.footer a:hover { color: var(--fg); }

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .project__body, .cols { grid-template-columns: 1fr; }
  .cols > .portrait-wrap { max-width: 380px; }
}

@media (max-width: 640px) {
  .masthead { grid-template-columns: 1fr; justify-items: center; gap: 12px; padding: 18px var(--gutter); }
  .nav { grid-column: 1; gap: 20px; }
  .grid { grid-template-columns: 1fr; }
  /* captions always visible on touch — there is no hover */
  .tile__caption { opacity: 1; transform: none; }
  .tile::after { opacity: 1; }
  .reel-grid { grid-template-columns: 1fr; }
}

@media (hover: none) {
  .tile__caption { opacity: 1; transform: none; }
  .tile::after { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* editing page: tile grid sits inside the page gutter, not edge-to-edge */
.grid--inset { padding-left: 0; padding-right: 0; }

/* self-hosted video sits in the same 16:9 frame as the embeds */
.media video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }

/* ------------------------------------------------------------- social -- */

.social {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}
.social a {
  display: inline-flex;
  color: var(--fg-faint);
  transition: color .25s var(--ease);
}
.social a:hover { color: var(--fg); }
.social svg { width: 15px; height: 15px; fill: currentColor; display: block; }

@media (max-width: 640px) {
  .social { grid-column: 1; justify-self: center; }
}

/* *stars* in content JSON become italics — film and show titles */
.prose em, .project__body em, .press em { font-style: italic; }

/* ------------------------------------------- festivals & awards lists -- */

.creditlist {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
}
.creditlist li + li { margin-top: 9px; }
.creditlist li span {
  display: block;
  font-size: 13px;
  color: var(--fg-faint);
}
