/* Jonah Hughes. One big photo, then a plain page: black, cream, Franklin Gothic. The photos and clips bring the colour. */

@font-face {
  font-family: 'Libre Franklin';
  src: url('fonts/libre-franklin-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Franklin';
  src: url('fonts/libre-franklin-latin-wght-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0e0c0b;
  --lift: #1a1715;
  --ink: #efe9df;
  --soft: #a59c8f;
  --line: rgb(239 233 223 / 0.18);
  --accent: #e8743b;
  --edge: clamp(20px, 5vw, 80px);
  --text: 'Libre Franklin', 'Franklin Gothic Medium', 'Helvetica Neue', Arial, sans-serif;
  --display: var(--text);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
  padding: 0;
  font-weight: inherit;
}
ol,
ul {
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
img,
video,
svg,
iframe {
  display: block;
  max-width: 100%;
}
:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}
::selection {
  background: var(--ink);
  color: var(--bg);
}
.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
}
.skip:focus {
  top: 12px;
}

/* Links in the page are underlined words, nothing more */
main a,
.arrows button {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgb(239 233 223 / 0.5);
  transition: color 0.2s, text-decoration-color 0.2s;
}
main a:hover,
.arrows button:hover:not(:disabled) {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Photos fade in as they come up the page. Words are just there. */
.js [data-reveal] {
  opacity: 0;
  transition: opacity 1.1s ease;
}
.js [data-reveal].in {
  opacity: 1;
}

.prose {
  display: grid;
  gap: 0.85em;
  max-width: 33em;
  text-wrap: pretty;
}
.prose:empty {
  display: none;
}
.prose.lead p:first-child {
  font-size: clamp(21px, 1.9vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* A photo or clip. Clips play silently in place; a tap opens either full size. */
.frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ratio, 9 / 16);
  overflow: hidden;
  background: var(--lift);
  cursor: zoom-in;
}
.frame > img,
.frame > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border: 6px solid transparent;
  border-left: 10px solid var(--ink);
  border-right: 0;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.6));
  opacity: 0.85;
}

/* ---------- the bar at the top ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--edge) 12px;
  transition: transform 0.4s var(--ease), background 0.3s;
}
.nav.solid {
  background: rgb(14 12 11 / 0.92);
}
.nav.away {
  transform: translateY(-110%);
}
.nav-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s;
}
/* The name is already large on the photo, so the small one waits until that has gone */
.nav.solid .nav-name {
  opacity: 1;
}
.nav nav {
  display: flex;
  gap: clamp(14px, 2.2vw, 30px);
  font-size: 16px;
}
.nav nav a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.nav nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* ---------- the top of the page: one photo, with his name on it ---------- */

.hero {
  position: relative;
}
.hero-media {
  position: relative;
  overflow: hidden;
  background: #000;
}
.hero-media .frame {
  max-height: 100svh;
  min-height: 64svh;
}
/* The picture moves a little slower than the page */
.hero-media .frame > img,
.hero-media .frame > video {
  transform: translate3d(0, var(--y, 0px), 0);
}
.hero-media .play {
  display: none;
}
/* The bottom of the photo goes out of focus, more the lower it gets, so the name reads cleanly on it */
.hero-media::before {
  content: '';
  position: absolute;
  inset: 44% 0 0;
  z-index: 1;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  mask-image: linear-gradient(to bottom, transparent, #000 62%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 62%);
  pointer-events: none;
}
/* Darker at the top for the menu and at the bottom for the name */
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgb(14 12 11 / 0.55), rgb(14 12 11 / 0) 20%, rgb(14 12 11 / 0) 44%, rgb(14 12 11 / 0.72) 78%, rgb(14 12 11 / 0.94));
  pointer-events: none;
}
.hero-text {
  position: absolute;
  z-index: 3;
  left: var(--edge);
  right: var(--edge);
  bottom: clamp(20px, 3.4vw, 48px);
  pointer-events: none;
}
.hero-text a {
  pointer-events: auto;
}
.name {
  font: 800 clamp(46px, 9vw, 160px) / 0.9 var(--display);
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.intro {
  margin-top: 0.7em;
  font-size: clamp(18px, 1.5vw, 23px);
  line-height: 1.35;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin-top: 8px;
  font-size: clamp(17px, 1.3vw, 19px);
}
.hero.bare .hero-text {
  position: static;
  padding: 28vh var(--edge) 0;
}

/* ---------- four strings. They move when the page does, and sound if you pluck one ---------- */

.strings {
  height: 100px;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.strings svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.strings path {
  fill: none;
  stroke: rgb(239 233 223 / 0.4);
  vector-effect: non-scaling-stroke;
}
.strings path:nth-child(1) {
  stroke-width: 2.6;
}
.strings path:nth-child(2) {
  stroke-width: 2;
}
.strings path:nth-child(3) {
  stroke-width: 1.5;
}
.strings path:nth-child(4) {
  stroke-width: 1;
}

/* ---------- the sections ---------- */

.sec {
  margin: 0 var(--edge);
  padding-top: clamp(64px, 8.5vw, 132px);
}
.sec h2 {
  margin-bottom: clamp(14px, 1.6vw, 24px);
  font: 800 clamp(28px, 2.9vw, 46px) / 1.05 var(--display);
  letter-spacing: -0.03em;
}

/* About: his photo, with the words beside it */
.about {
  display: grid;
  grid-template-columns: minmax(180px, 340px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  padding-top: clamp(36px, 4.5vw, 72px);
}

/* Projects: one line each, in the same three columns: what it is, a sentence about it, where to find it */
.projects {
  border-bottom: 1px solid var(--line);
}
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) 7.5em;
  gap: 6px clamp(18px, 3vw, 48px);
  align-items: baseline;
  padding: clamp(16px, 1.6vw, 22px) 0;
  border-top: 1px solid var(--line);
}
.project h3 {
  font: 700 clamp(19px, 1.6vw, 23px) / 1.2 var(--display);
  letter-spacing: -0.015em;
}
.kind {
  margin-top: 2px;
  font-size: 15px;
  color: var(--soft);
}
.project .prose {
  max-width: none;
}
.more {
  text-align: right;
}

.listen-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 40px;
  margin-bottom: clamp(18px, 2vw, 28px);
}
.listen-top .more {
  text-align: left;
}
/* The player is the point of this section, so it gets the room: tall enough to list every track */
.player {
  --tall: clamp(440px, 62vh, 620px);
  border-radius: 12px;
  overflow: hidden;
  background: var(--lift);
  min-height: var(--tall);
}
.player iframe {
  width: 100%;
  height: var(--tall);
  border: 0;
}

.live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 28px;
}
.live-head .prose {
  flex: 1 1 16em;
}
.arrows {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-left: auto;
}
.arrows button:disabled {
  opacity: 0.35;
  text-decoration: none;
  cursor: default;
}
.reel {
  display: flex;
  align-items: flex-start;
  gap: clamp(6px, 0.7vw, 10px);
  margin-top: clamp(8px, 1vw, 14px);
  padding: 0 var(--edge);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
  cursor: grab;
}
.reel::-webkit-scrollbar {
  display: none;
}
.reel.dragging {
  scroll-snap-type: none;
  cursor: grabbing;
}
.reel.dragging .frame {
  pointer-events: none;
}
.shot {
  flex: none;
  scroll-snap-align: start;
}
.shot .frame {
  width: auto;
  height: clamp(320px, 62vh, 580px);
  cursor: inherit;
}
.shot figcaption {
  margin-top: 7px;
  font-size: 14px;
  color: var(--soft);
}

.mail {
  display: inline-block;
  margin-top: clamp(14px, 1.6vw, 22px);
  font: 700 clamp(21px, 2.8vw, 40px) / 1.2 var(--display);
  letter-spacing: -0.02em;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin-top: clamp(12px, 1.4vw, 18px);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 28px;
  margin: clamp(72px, 9vw, 140px) var(--edge) 0;
  padding: 16px 0 26px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--soft);
}
.foot span:last-child {
  display: flex;
  gap: 24px;
}
.foot a:hover {
  color: var(--ink);
}

/* ---------- the Media page: every photo and clip, in rows of one height ---------- */

.media-page {
  padding-top: clamp(84px, 9vw, 130px);
}
.back {
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--soft);
}
.media-page h1 {
  font: 800 clamp(40px, 6vw, 88px) / 0.95 var(--display);
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.media-page > .prose {
  margin-top: clamp(12px, 1.4vw, 20px);
}
.media-grid {
  --cols: 4;
  --gap: clamp(10px, 1.2vw, 18px);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(26px, 3vw, 44px) var(--gap);
  margin-top: clamp(28px, 3.4vw, 52px);
  container-type: inline-size;
}
.media-item.wide {
  grid-column: span 2;
}
/* One column's width, times five-fourths: the same height whether a picture takes one column or two */
.media-item .frame {
  aspect-ratio: auto;
  height: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols) * 1.25);
}
.media-item h2 {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.media-item .prose {
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--soft);
}

/* ---------- a photo or clip opened full size ---------- */

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(8 7 6 / 0.96);
  color: var(--ink);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
}
.lightbox::backdrop {
  background: rgb(8 7 6 / 0.6);
}
.stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 56px 16px 8px;
}
.stage img,
.stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* Phone clips are small, so they're scaled up to fill; photos are shown at their own shape */
.stage video {
  min-height: min(70dvh, 100%);
  background: #000;
}
.cap {
  padding: 8px 20px 20px;
  font-size: 15px;
  color: var(--soft);
  text-align: center;
}
.cap:empty {
  padding-bottom: 10px;
}
.close {
  position: absolute;
  right: 14px;
  top: 6px;
  z-index: 2;
  width: 44px;
  height: 44px;
  font: 200 40px/1 var(--display);
  color: var(--soft);
}
.close:hover {
  color: var(--ink);
}

.lost {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  min-height: 100svh;
  padding: var(--edge);
}
.lost h1 {
  font: 800 clamp(36px, 6vw, 80px) / 1 var(--display);
  letter-spacing: -0.03em;
}
.lost a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- smaller screens ---------- */

@media (max-width: 860px) {
  body {
    font-size: 17px;
  }
  .nav nav {
    gap: 14px;
    font-size: 15px;
  }
  .nav-name {
    display: none;
  }
  /* The photo with the name under it. Taller than a wide photo would naturally be, so it isn't a thin strip. */
  .hero-media .frame {
    min-height: 42svh;
    max-height: 76svh;
  }
  .hero-media::after {
    background: linear-gradient(to bottom, rgb(14 12 11 / 0.6), rgb(14 12 11 / 0) 34%);
  }
  .hero-text {
    position: static;
    padding: 18px var(--edge) 0;
  }
  .name {
    font-size: clamp(44px, 13.5vw, 100px);
  }
  .strings {
    height: 80px;
  }
  .hero-media::before {
    display: none;
  }
  .arrows button {
    display: none;
  }
  .shot .frame {
    height: clamp(280px, 52vh, 440px);
  }
}

@media (max-width: 1000px) {
  .media-grid {
    --cols: 2;
  }
}

/* Phones: one column */
@media (max-width: 640px) {
  .media-grid {
    --cols: 1;
  }
  .media-item.wide {
    grid-column: auto;
  }
  /* Full width, so each keeps its own shape (tall ones capped so they fit the screen) */
  .media-item .frame {
    height: auto;
    aspect-ratio: var(--ratio);
    max-height: 78svh;
  }
  .about {
    grid-template-columns: 1fr;
  }
  .about-text {
    order: -1;
  }
  .about-photo {
    max-width: 78%;
  }
  .project {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .more {
    text-align: left;
  }
  .more:empty {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js [data-reveal] {
    opacity: 1 !important;
  }
  .hero-media .frame > * {
    transform: none !important;
  }
}
