/* Rudolph Makhoul, the Ink Room direction. A dark room: lit piece in the hero, a photo grid with a full-screen viewer, serif type.
   Sizes in cqw are percent of the page width (.room is the container), as in the design. */

:root {
  --ink: #0b0a09;
  --ink-3: #121110;
  --bone: #ece7de;
  --ash: #9a958b;
  --hair: rgba(236, 231, 222, .09);
  --serif: 'Noto Serif Display', serif;
  --sans: 'Archivo', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gut: clamp(20px, 4.4cqw, 56px);
  --maxw: 1280px;
  color-scheme: dark;
}

html {
  background: var(--ink);
  scroll-padding-top: 70px; /* the 65 px header plus the 5 px focus ring: a control focused from below never sits under the header */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.menu-open, html.box-open { overflow: hidden; }
body { margin: 0; background: var(--ink); }
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }

.room {
  position: relative;
  min-height: 100vh;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  container-type: inline-size;
  overflow: clip;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible { outline: 1px solid var(--bone); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }

@keyframes a-grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-61px, 37px); } 50% { transform: translate(43px, -89px); } 75% { transform: translate(-29px, -53px); } 100% { transform: translate(0, 0); } }
@keyframes a-drift { 0%, 100% { transform: translate3d(-5%, 0, 0) scale(1); } 50% { transform: translate3d(6%, -5%, 0) scale(1.18); } }
@keyframes a-fade { from { opacity: 0; } }

/* Small caps-style labels used across the page */
.meta {
  margin: 0;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-stretch: 82%;
  color: var(--ash);
}

/* ---------- Header ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gut);
  background: rgba(11, 10, 9, .74);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.brand {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  font-stretch: 80%;
  white-space: nowrap;
}
.nav {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-stretch: 82%;
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 2.6cqw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a { color: var(--ash); }
.nav-list a:hover { color: var(--bone); }
.nav-n, .nav-foot { display: none; }
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: clamp(680px, 100vh, 940px);
  margin-top: -64px;
  overflow: hidden;
  isolation: isolate;
}
.fog { position: absolute; inset: 0; pointer-events: none; }
.fog > div { position: absolute; }
.fog > :first-child {
  left: 35%; top: 0%; width: 70%; height: 90%;
  background: radial-gradient(closest-side, rgba(236, 231, 222, .07), transparent);
  animation: a-drift 23s ease-in-out infinite;
}
.fog > :last-child {
  left: -15%; top: 35%; width: 75%; height: 80%;
  background: radial-gradient(closest-side, rgba(236, 231, 222, .045), transparent);
  animation: a-drift 31s ease-in-out -11s infinite reverse;
}
.hero-img {
  position: absolute;
  right: 9%;
  top: 50%;
  width: clamp(290px, 36cqw, 470px);
  aspect-ratio: 504 / 612;
  transform: translateY(-46%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
}
.hero-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-bright img { filter: grayscale(1) contrast(1.12) brightness(1.04); }
/* The piece and its two lines, fully lit. (The design showed them only inside a light that followed the cursor.) */
.lit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.whisper {
  position: absolute;
  left: 39%;
  top: 29%;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
}
.vert {
  position: absolute;
  right: clamp(16px, 2.2cqw, 30px);
  top: 26%;
  margin: 0;
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  font-stretch: 82%;
}
.hero-grain {
  position: absolute;
  inset: -120px;
  z-index: 4;
  pointer-events: none;
  background-image: url(assets/grain.png);
  background-size: 256px 256px;
  opacity: .11;
  animation: a-grain 1s steps(4) infinite;
}
.hero-meta { position: absolute; left: var(--gut); top: 112px; display: grid; gap: 8px; }
.name {
  position: absolute;
  left: var(--gut);
  right: var(--gut);
  bottom: clamp(44px, 5.5cqw, 72px);
  z-index: 5;
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(56px, 13cqw, 172px);
  line-height: .86;
  letter-spacing: -.012em;
  white-space: nowrap;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}
.name .l1, .name .l2 { display: block; }
.name .l2 { text-align: right; }
.hero.is-away .fog > div, .hero.is-away .hero-grain { animation-play-state: paused; }

/* ---------- Shared section frame ---------- */
.sec {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(88px, 10cqw, 150px) var(--gut);
  box-sizing: border-box;
}
.about, .contact { border-top: 1px solid var(--hair); }
main > section { scroll-margin-top: -6px; } /* with the 70 px scroll padding, a #link lands the section 64 px down, as the nav does */

/* ---------- Work: photos only, two across on phones, three from 720 px ---------- */
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1.25cqw, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.shot {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ink-3);
  overflow: hidden;
  cursor: zoom-in;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 504 / 612;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  transition: transform 1.2s var(--ease);
  -webkit-user-drag: none;
  user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .shot:hover img { transform: scale(1.03); }
}

/* ---------- Full-screen viewer ---------- */
.box {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--bone);
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom; /* a sideways swipe is the page's: next or previous piece */
}
.box::backdrop { background: transparent; }
.box[open] {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 76px;
  grid-template-rows: 76px minmax(0, 1fr) 76px;
  place-items: center;
  animation: a-fade .35s ease;
}
.box-img {
  grid-area: 2 / 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1) contrast(1.08);
  -webkit-user-drag: none;
  user-select: none;
}
.box-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(236, 231, 222, .28);
  border-radius: 50%;
  background: rgba(11, 10, 9, .5);
  color: var(--bone);
  cursor: pointer;
  transition: border-color .3s;
}
.box-btn:hover { border-color: var(--bone); }
.box-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.box-x { grid-area: 1 / 3; }
.box-prev { grid-area: 2 / 1; }
.box-next { grid-area: 2 / 3; }

/* ---------- About ---------- */
.about-in {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(48px, 7cqw, 104px);
  align-items: center;
}
.about-fig { margin: 0; }
.about-fig img {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  filter: invert(1) grayscale(1) contrast(1.1);
  mix-blend-mode: screen;
}
.about-h {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 5.2cqw, 70px);
  line-height: 1.02;
  letter-spacing: -.012em;
  text-wrap: balance;
}

/* ---------- Contact and footer ---------- */
.contact { padding: clamp(100px, 12cqw, 180px) var(--gut) 0; text-align: center; }
.contact-h { font-weight: 400; }
.handle {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 200;
  /* the design's size, held below the width of the page on small phones */
  font-size: min(clamp(44px, 9cqw, 124px), calc((100cqw - 2 * var(--gut)) / 7.7));
  line-height: 1.05;
  letter-spacing: -.02em;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
  text-decoration-color: rgba(236, 231, 222, 0);
  transition: text-decoration-color .4s;
}
.handle:hover { text-decoration-color: rgba(236, 231, 222, .8); }
.contact-p { margin-top: 28px; }
.foot { padding: clamp(88px, 10cqw, 140px) var(--gut) clamp(36px, 4cqw, 56px); }
.foot-in {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: calc(var(--maxw) - 112px);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-stretch: 82%;
  color: var(--ash);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background-image: url(assets/grain.png);
  background-size: 256px 256px;
  opacity: .045;
}

/* ---------- Motion off: everything holds still ---------- */
.no-motion .fog > div, .no-motion .hero-grain, .no-motion .box[open] { animation: none; }
.no-motion .shot img, .no-motion .nav { transition: none; }
.no-motion .shot:hover img { transform: none; }

/* ---------- Touch screens: 44 px targets ---------- */
@media (hover: none), (pointer: coarse) {
  .brand { display: inline-flex; align-items: center; min-height: 44px; }
  .handle { position: relative; }
  .handle::after { content: ''; position: absolute; inset: -6px 0; }
}
/* Touch tablets keep the desktop nav: give its 12 px links a 44 px hit area (the gaps between them are 18 px or more) */
@media (min-width: 720px) and (hover: none), (min-width: 720px) and (pointer: coarse) {
  .nav-list a { position: relative; }
  .nav-list a::after { content: ''; position: absolute; inset: -16px -8px; }
}

/* ---------- Wide screens: the room grows a little ---------- */
@media (min-width: 1440px) {
  :root { --maxw: clamp(1280px, 87.5cqw, 1520px); }
  .hero { height: clamp(680px, 100vh, 1040px); }
  .hero-img { width: clamp(290px, 36cqw, 540px); }
  .name { font-size: clamp(56px, 13cqw, 216px); }
  .about-fig img { max-width: clamp(440px, 31cqw, 520px); }
}

/* ---------- Tablets and up ---------- */
@media (min-width: 720px) {
  .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 720px) and (max-width: 1099.98px) {
  .hero-img { width: clamp(290px, 46cqw, 470px); }
  .whisper { left: 22%; top: 27%; }
}

/* ---------- Below 720 px: the nav folds into a menu ---------- */
@media (max-width: 719.98px) {
  .bar { gap: 12px; }
  .brand { margin-right: auto; }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-right: -6px;
    padding: 0 6px;
    background: none;
    border: 0;
    color: var(--bone);
    font-family: inherit;
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    font-stretch: 82%;
    cursor: pointer;
  }
  .nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    height: calc(100vh - 65px);
    height: calc(100dvh - 65px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 8px var(--gut) 28px;
    background: var(--ink);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease, visibility 0s linear .3s;
  }
  .nav::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url(assets/grain.png) 0 0 / 256px 256px;
    opacity: .045;
  }
  .bar.is-open .nav { visibility: visible; opacity: 1; transition: opacity .3s ease; }
  .nav-list { display: block; }
  .nav-list li { border-bottom: 1px solid rgba(236, 231, 222, .1); }
  .nav-list a {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: baseline;
    gap: 16px;
    padding: 18px 0;
    color: var(--bone);
  }
  .nav-list a:focus-visible { outline-offset: 2px; }
  .nav-n { display: block; font-size: 11px; letter-spacing: .16em; font-stretch: 100%; font-variant-numeric: tabular-nums; color: var(--ash); }
  .nav-t {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(36px, 11cqw, 52px);
    line-height: 1;
    letter-spacing: -.01em;
    text-transform: none;
    font-stretch: 100%;
  }
  .nav-foot {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 32px;
  }
  .nav-ig { display: inline-flex; align-items: center; min-height: 44px; color: var(--bone); }
}

/* ---------- Phones ---------- */
@media (max-width: 599.98px) {
  .hero { height: max(560px, 100vh); height: max(560px, 100svh); }
  .hero-img {
    left: 50%;
    right: auto;
    top: 47%;
    width: min(76cqw, 360px);
    transform: translate(-50%, -50%);
  }
  .whisper { left: var(--gut); top: 21%; font-size: 20px; }
  .vert { top: 30%; }
  .hero-meta { top: 96px; }
  .name { font-size: clamp(44px, 17.2cqw, 100px); bottom: 40px; }

  /* The viewer: the piece uses the full width, the arrows sit under it. */
  .box[open] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr) 96px;
  }
  .box-img { grid-area: 2 / 1 / 3 / 3; padding: 0 12px; box-sizing: border-box; }
  .box-x { grid-area: 1 / 2; justify-self: end; margin-right: 12px; }
  .box-prev { grid-area: 3 / 1; justify-self: end; margin-right: 14px; }
  .box-next { grid-area: 3 / 2; justify-self: start; margin-left: 14px; }
}
