/* Evan Sherman — site styles */
:root {
  --ink: #111;
  --muted: #9a9a9a;
  --link: #0006ff;
  --side: 230px;          /* left column */
  --edge: 32px;           /* page margin */
  --cell: 200px;          /* thumbnail box */
  --gap: 25px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Left column: handwritten name, the three links, and on work pages the list of works */
.site-header {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--side);
  padding: 30px 0 30px var(--edge);
  overflow-y: auto;
}
.site-header .logo { display: inline-block; margin-bottom: 18px; }
.site-nav {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  font-size: 16px;
}
.site-nav a { transition: color .2s; }
.site-nav a:hover, .site-nav a.current { color: var(--muted); }
.site-header .work-list { margin-top: 48px; font-size: 14px; }

/* Year list (home page) */
.years {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  margin-top: 40px;
  font-size: 15px;
  color: var(--muted);
}
.years a { transition: color .2s; }
.years a:hover, .years a.current { color: var(--ink); }
.cell[hidden] { display: none; }

main { margin-left: var(--side); padding: 30px var(--edge) 80px 0; }

/* Home: thumbnails, each fitted whole inside the same box */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr));
  gap: var(--gap);
  align-items: center;
  justify-items: center;
}
.cell { width: var(--cell); height: var(--cell); display: flex; align-items: center; justify-content: center; }
.cell img, .cell video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.cell:hover img, .cell:hover video { opacity: .75; }

/* List of works */
.work-list h2 { font-size: 1em; font-weight: 700; margin: 0 0 6px; }
.work-list ul { list-style: none; margin: 0 0 22px; padding: 0; }
.work-list li { font-style: italic; }
.work-list a:hover, .work-list a.current { color: var(--muted); }
.gallery-list .work-list { font-size: 18px; }
.gallery-list .work-list h2 { font-size: 28px; margin-bottom: 10px; }

/* Work pages */
.work-body { max-width: 860px; font-style: italic; }
.work-body p { margin: 0; }
.work-body .slideshow, .work-body .video, .work-body .single, .work-body .loop-video { margin: 0 0 40px; font-style: normal; }

/* Slideshows */
.slideshow { position: relative; }
.slide-controls { font-size: 14px; margin-bottom: 8px; color: var(--ink); }
.slide-controls button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.slide-controls button:hover { color: var(--muted); }
.slide-controls .count { color: var(--muted); }
.slide { display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.slide img { max-height: 78vh; width: auto; object-fit: contain; }
.js .slides { display: grid; }
.js .slide { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transition: opacity .4s ease; }
.js .slide.active { opacity: 1; visibility: visible; }

/* Embedded videos */
.video { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Text pages */
.text-page { max-width: 760px; }
.text-page.about .center { color: #666; font-size: 20px; margin: 40px auto 64px; }
.text-page.about .about-photo { margin: 0 auto; width: 100%; max-width: 440px; }
.text-page hr { border: 0; border-top: 1px solid #ddd; margin: 8px 0 24px; }
.contact-info { margin: 54px 0 44px; }   /* first line level with About in the left column */
.contact-info p { margin: 0 0 4px; }
.contact-info a { color: var(--link); }
.contact-info a:hover { text-decoration: underline; }
.cv p { margin-bottom: 1.2em; }

/* Phones and small tablets: the left column becomes a header */
@media (max-width: 760px) {
  :root { --edge: 16px; --gap: 12px; }
  .site-header { position: static; width: auto; padding: 22px var(--edge) 8px; overflow: visible; }
  .site-header .logo { margin-bottom: 12px; }
  .site-nav { flex-direction: row; flex-wrap: wrap; gap: 4px 22px; }
  .site-header .work-list { display: none; }
  .years { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; }
  main { margin-left: 0; padding: 20px var(--edge) 60px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cell { width: 100%; height: auto; aspect-ratio: 1; }
  .text-page.about .center { font-size: 18px; }
  .contact-info { margin-top: 0; }
}

/* Intro: just the video; on entering, it zooms into the white in the frame and opens onto the grid */
.intro {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; cursor: pointer; overflow: hidden; outline: none;
}
.no-intro .intro { display: none; }
.intro-frame { width: min(38vh, 60vw); aspect-ratio: 1; will-change: transform; }
.intro-frame video { width: 100%; height: 100%; object-fit: cover; }
.intro::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.intro.zooming { cursor: default; }
.intro.zooming .intro-frame { transform: scale(11); transition: transform 1.3s cubic-bezier(.45, 0, .25, 1); }
.intro.zooming::after { opacity: 1; transition: opacity .5s ease .75s; }
@media (prefers-reduced-motion: reduce) {
  .intro.zooming .intro-frame { transform: none; transition: none; }
  .intro.zooming::after { transition: opacity .4s ease; }
}
.intro.leaving { opacity: 0; transition: opacity .7s ease; pointer-events: none; }
.intro-open { overflow: hidden; }
