/* drew.klonsky.com — recreation of the Squarespace "Brine" HeroWall design */
:root {
  --text: #525252;
  --link: #1f1f1f;
  --link-hover: #5c5c5c;
  --heading: #625b5b;
  --nav: #686a8d;
  --nav-active: #dede7d;
  --nav-hover: #f7f464;
  --btn-bg: #272727;
  --header-h: 132px;
  --body-font: "Figtree", "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display-font: "League Gothic", "Arial Narrow", Impact, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--text);
  font: 400 15px/1.47em var(--body-font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a, a:visited { color: var(--link); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .5s ease-out; }
a:hover { color: var(--link-hover); border-color: var(--link-hover); transition-duration: 0s; }
:focus-visible { outline: 2px solid #686a8d; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 9999; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
#topBar {
  position: sticky; top: 0; z-index: 8000; background: #fff;
  height: var(--header-h); padding: 0 35px;
  display: flex; align-items: center; justify-content: space-between;
}
#nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 1em; }
#nav li { margin: 0; }
#nav a, #nav a:visited {
  font: 400 20.9px/1 var(--display-font); text-transform: uppercase;
  color: var(--nav); padding: 0 0 2px; border-bottom: 1px solid transparent; transition: border-color .25s ease-out;
}
#nav .active-link a { color: var(--nav-active); border-color: var(--nav-active); transition: none; }
#nav a:hover { color: var(--nav-hover); border-color: var(--nav-hover); transition: none; }
.site-title { margin: 0; font: 400 27.55px/1 var(--display-font); text-transform: uppercase; text-align: right; }
.site-title a, .site-title a:visited, .site-title a:hover { color: #525252; border: 0; }

/* ---------- home grid ---------- */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.grid li { aspect-ratio: 1; position: relative; overflow: hidden; }
.grid a { display: block; width: 100%; height: 100%; border: 0; position: relative; overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease-out; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; background: rgba(15,15,15,.7); color: #fff; opacity: 0; transform: scale(1.3);
  transition: opacity .2s ease-out, transform .2s ease-out; padding: 8px;
}
.overlay .t { font-size: 26px; line-height: 1.4em; letter-spacing: -1px; }
.overlay .v { font-size: 16px; line-height: 1.4em; letter-spacing: .05em; }
@media (hover: hover) {
  .grid a:hover img { transform: scale(1.5); }
  .grid a:hover .overlay { opacity: 1; transform: scale(1); }
}
.grid a:focus-visible .overlay { opacity: 1; transform: scale(1); }
.grid a:focus-visible { outline-offset: -4px; }

/* ---------- body copy ---------- */
.body p { margin: 0 0 1.25em; padding: 0; white-space: pre-wrap; }
.body p:last-child { margin-bottom: 0; }
.body a { border-bottom-color: transparent; }

/* ---------- project page ---------- */
.project { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.project .meta {
  position: sticky; top: var(--header-h); padding: 47px 35px 47px 32px;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
}
.project h1 { margin: 0 0 .4em; font: 100 42px/1.2em var(--body-font); font-weight: 300; color: var(--heading); }
.gallery { margin: 52px 135px 50px 100px; max-width: 700px; width: 100%; }
.item { margin: 0 0 50px; text-align: center; }
.item:last-child { margin-bottom: 0; }
.item img { margin: 0 auto; height: auto; }
.item figcaption { margin-top: 10px; text-align: left; }
.video-frame { position: relative; width: 100%; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* wide project (slideshow) */
.project--wide { display: block; padding: 0 25px 60px; }
.project--wide .meta, .meta--wide { position: static; max-height: none; overflow: visible; padding: 40px 0 0; max-width: 960px; }

/* slideshow */
.slideshow { position: relative; max-width: 960px; margin: 0 auto; }
.slides { position: relative; aspect-ratio: 3 / 2; background: #fff; overflow: hidden; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; display: flex; align-items: center; justify-content: center; }
.slide.is-active { opacity: 1; }
.slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.arrow {
  position: absolute; top: calc(50% - 31px); width: 44px; height: 62px; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.55); transition: background .2s; transform: translateY(-50%);
  top: 40%;
}
.arrow:hover { background: rgba(255,255,255,.9); }
.arrow::after { content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; border: solid #525252; border-width: 2px 2px 0 0; }
.arrow.prev { left: 0; } .arrow.prev::after { transform: translate(-30%, -50%) rotate(-135deg); }
.arrow.next { right: 0; } .arrow.next::after { transform: translate(-70%, -50%) rotate(45deg); }
.thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.thumb { flex: 0 0 62px; width: 62px; height: 62px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .55; transition: opacity .2s; }
.thumb:hover, .thumb.is-active { opacity: 1; }
.thumb img { width: 62px; height: 62px; object-fit: cover; }

/* buttons */
.btns { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.btns + .btns { margin-top: 16px; }
.btns--thirds { display: grid; grid-template-columns: repeat(3, 1fr); }
.btn, .btn:visited {
  display: block; width: 100%; background: var(--btn-bg); color: #fff; border: 0; border-radius: 0; cursor: pointer;
  padding: 21px 34px; text-align: center; font: 600 15px/1.4em var(--body-font); letter-spacing: 1px; text-transform: uppercase;
  transition: opacity .2s;
}
.btn:hover { color: #fff; opacity: .8; border: 0; }
.meta--wide .btns { max-width: 960px; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0; max-width: 1010px; margin: 0 auto; padding: 30px 25px 80px; align-items: start; }
.about-text { padding-right: 25px; }
.about-photo { position: sticky; top: calc(var(--header-h) + 30px); padding: 0 38px; }
.about-photo img { width: 100%; height: auto; }
.about .body strong:first-child { color: #3d3d3d; }
.about-text .body p:first-child { font-weight: 700; }

/* contact dialog */
dialog#contact { border: 0; padding: 36px 32px 32px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; color: var(--text); box-shadow: 0 10px 50px rgba(0,0,0,.35); }
dialog#contact::backdrop { background: rgba(255,255,255,.9); }
.contact-close { position: absolute; top: 4px; right: 8px; margin: 0; }
.contact-close button { border: 0; background: none; font-size: 32px; line-height: 1; cursor: pointer; color: #525252; padding: 6px 10px; }
#contact h2 { font: 300 32px/1.2em var(--body-font); margin: 0 0 20px; color: var(--heading); }
#contact label { display: block; font-weight: 600; margin-bottom: 14px; }
#contact label span { font-weight: 400; font-size: 12px; color: #8a8a8a; }
#contact input:not(.hp), #contact textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: 400 15px/1.4 var(--body-font); color: var(--text); border: 1px solid #c9c9c9; border-radius: 0; background: #fff; }
#contact input:focus, #contact textarea:focus { outline: 2px solid #686a8d; outline-offset: 0; border-color: #686a8d; }
#contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-status { min-height: 1.5em; margin: 0 0 8px; }
.contact-status.is-error { color: #b3261e; }
.contact-status.is-ok { color: #2d6a3e; font-weight: 600; }
#contact .btn { width: auto; min-width: 160px; margin-top: 0; }

.notfound { padding: 60px 35px; } .notfound h1 { font: 300 42px/1.2em var(--body-font); color: var(--heading); margin: 0 0 .5em; }

/* ---------- previous / next project ---------- */
.switcher { position: fixed; top: 135px; right: 32px; width: 78px; z-index: 2; display: flex; gap: 2px; }
.switcher a, .switcher a:visited { display: block; width: 38px; height: 38px; background: #2e2e2e; color: #f0f0f0; border: 0; transition: opacity .2s; }
.switcher a:hover { opacity: .4; color: #f0f0f0; border: 0; }
.switcher svg { display: block; width: 38px; height: 38px; }
.switcher .projectHome { display: none; }
.switcher--static { position: static; width: 118px; margin: 30px auto; }
.switcher--static .projectHome { display: block; }
@media (max-width: 1024px) {
  .switcher { position: static; width: 118px; margin: 30px auto; }
  .switcher .projectHome { display: block; }
}

/* ---------- cross-page fade (supported browsers) ---------- */
@view-transition { navigation: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .project { display: block; }
  .project .meta { position: static; max-height: none; overflow: visible; padding: 40px; }
  .gallery { margin: 0; padding: 0 20px 50px; max-width: none; }
  .item { margin-bottom: 20px; }
  .project--wide .meta { padding: 40px 0 0; }
}
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; padding: 10px 20px 60px; }
  .about-photo { position: static; order: -1; margin-bottom: 24px; padding: 0; }
  .about-text { padding-right: 0; }
}
@media (max-width: 640px) {
  :root { --header-h: auto; }
  #topBar { flex-direction: column-reverse; justify-content: center; gap: 14px; padding: 28px 20px 20px; height: auto; position: static; }
  #nav { justify-content: center; }
  .site-title { text-align: center; font-size: 32px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .overlay .t { font-size: 18px; letter-spacing: -.5px; }
  .project .meta { padding: 20px 20px 0; margin: 20px 0 0; }
  .project h1 { font-size: 34px; }
  .gallery { padding: 20px 5px 40px; }
  .item { margin-bottom: 5px; }
  .project--wide { padding: 0 12px 40px; }
  .btns--thirds { grid-template-columns: 1fr; }
  .btn { padding: 18px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  @view-transition { navigation: none; }
}
