:root {
  --paper: #ffffff;
  --ink: #201d19;
  --ink-soft: #4a453d;
  --rule: rgba(32, 29, 25, 0.14);
  --dot-red: #8a3630;

  /* Fluid edge offsets: hold their mobile value at/below 640px width and
     their desktop value at/above 1440px, ramping smoothly between so
     nothing snaps at a single breakpoint. */
  --edge-left: clamp(1.4rem, calc(1.4rem + (100vw - 640px) * 0.014), 2.1rem);
  --edge-top: clamp(1.5rem, calc(1.5rem + (100vw - 640px) * 0.012), 2.1rem);
  --edge-bottom: clamp(1.3rem, calc(1.3rem + (100vw - 640px) * 0.008), 1.7rem);
  --edge-left-back: clamp(1.5rem, calc(1.5rem + (100vw - 640px) * 0.014), 2.2rem);
  --edge-left-title: clamp(1.3rem, calc(1.3rem + (100vw - 640px) * 0.012), 1.9rem);
  --fs-label: clamp(0.7rem, calc(0.7rem + (100vw - 640px) * 0.001), 0.75rem);

  /* Homepage composition: the slideshow photo centers within the "main
     zone" to the right of the fixed left-side nav column rather than the
     full viewport. --photo-margin is the guaranteed empty space on each
     side of the (viewport-)centered photo (see .photo's max-width); the
     shift is capped at that margin so the photo can never be pushed past
     the right edge. */
  --photo-margin: max(9vw, calc(50vw - 450px), 90px);
  --photo-shift: min(50px, calc(var(--photo-margin) - 40px));

  /* Shooting-star hover cursor for nav links (Gallery, Home): a small
     5-point star with a short fading tail, hotspot on the star itself.
     SVG first for crispness; a rasterized PNG of the same design as a
     fallback, since some browsers (Safari included) don't reliably
     support SVG cursor images and silently drop to the plain pointer. */
  --cursor-shooting-star:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='32' viewBox='0 0 36 32'%3E%3Cpath d='M16,13 Q22,18 27,23' fill='none' stroke='%23baa05e' stroke-width='1.1' stroke-linecap='round' opacity='0.55'/%3E%3Ccircle cx='27' cy='23' r='0.9' fill='%23baa05e' opacity='0.5'/%3E%3Ccircle cx='30' cy='26' r='0.6' fill='%23baa05e' opacity='0.35'/%3E%3Cpath d='M12.00,2.50 L13.47,6.98 L18.18,6.99 L14.38,9.77 L15.82,14.26 L12.00,11.50 L8.18,14.26 L9.62,9.77 L5.82,6.99 L10.53,6.98 Z' fill='%23baa05e'/%3E%3C/svg%3E") 12 9,
    url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAADcUlEQVR4nO1XXWgUVxQ+596ZzRrj+kOrGEghKLYkPkmf2kqiNWi19C3Smt3ZNC15EUEf2gZKGQdB7ENRxCLRktkfa+nmIfShcXezbZIXaSF9sxQsltJSLBRpjXWz2Zl7TzlrNqg0ZqM7WqofzMyZc87M+eY7M3fuBVgCCACJAJdyzWMD5N2IG181+VlvC9tEFIhSopakTKa7kteE6rXZkj7I9sTEYRkEoYWeEqskGG3QJtu7HS+fsEYIYNPOn1s3f9d8Vf60+k9dSQCAvXuH2SZ4QNQs+7gbX+UL+s0QomHWg9ZdfYlfH7R4LYT4nEbTPZFGYXb4nv67TEqEUGoF+uVwyHyfk0qz/lEg+kohIccMUzQVtTe5O/bpdPUedSNk2za+sOHKMqHFoZWR8BHP1+B5CoRAJlKpFA4Z/FKDaUowDQHXp0sfaKGPX7yyYcZxHKonoTswloztkFKcN6R8uljyfIFosF8T+Y1h0/CV+kMpva8rni5A0F/Z+HiHwYVmiqWXfKW/CYcMCQSKN7bZxzHO4dzACW3bNulPTfWbe/o/v1wuq18MQxAgIQqQpik1+zh26ZId6uycVPUitGDL+BeBCJT/5PVmNEI/LF/eELlxo1RCxOkVTQ1rbxbL0yUNz776ZvL3W/mEiEiBKTQxYVcGPjTNrvXrVkTKZf+iBP2ir+Xm4kz5wrqnmiImqF1jbnzPl8nYJiZj23ZNA+19KmSLM2euytbwzBch0/j+4xF3YHgY5lvzdcp6z1PQhwgFTfSXFJDsiqcvMynHceYHzKViwSdCdHRL481lgnCgc5/7DpMh2xbcSj5ut1IfKlJRTfgjglittTiQTUU3MhmOQ5DIZLrl3WrO+SoopKJd+YR1KufGjo0lY8+wrx7t+1fY97gxK1GN55Ox5/Ou9VEuYZ0upHva7ib9UJGZK3wh3bM+68YHckPWyfz5vuZAlVoM1cJTg/1mLmFFc27sRODtWwy3T9oKQ71bcwnLGRvsXvlIScGtH3SlePZsdGMuFd+fPfvWmmps0YuDYkVkCx46skO9LQRqizCosNM6V6zHJO6+UVVqdPRAQ86NvptP9Lxt2x0Gr14WEiPQvjqOo5nUK9+u8STANVQo2tvXEmtEj06nefx313PZwTee443tufbN46F+ivRk1VsjKjOGJ2r9X/APbguGyn857PwAAAAASUVORK5CYII=") 12 9,
    pointer;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  text-transform: lowercase;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='-8 -9 44 44'%3E%3Cpath d='M14.0,4.5 L16.1,10.5 L22.6,10.7 L17.5,14.6 L19.3,20.8 L14.0,17.1 L8.7,20.8 L10.5,14.6 L5.4,10.7 L11.9,10.5 Z' fill='%23baa05e'/%3E%3C/svg%3E") 16 16, auto;
}

/* subtle printed / ink paper grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame {
  position: relative;
  height: 100%;
  max-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translateX(var(--photo-shift));
}

.photo {
  display: block;
  /* the last term keeps the centered photo from ever growing wide enough
     to reach the "Gallery" label, which sits vertically centered on the
     left edge at every viewport width */
  max-width: min(82vw, 900px, calc(100vw - 180px));
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* click zones covering left / right halves of the stage */
.zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 20;
  cursor: none;
}

.zone-prev {
  left: 0;
}

.zone-next {
  right: 0;
}

.zone-prev,
.zone-next {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='-8 -9 44 44'%3E%3Cpath d='M14.0,4.5 L16.1,10.5 L22.6,10.7 L17.5,14.6 L19.3,20.8 L14.0,17.1 L8.7,20.8 L10.5,14.6 L5.4,10.7 L11.9,10.5 Z' fill='%23baa05e'/%3E%3C/svg%3E") 16 16, pointer;
}

.wordmark {
  position: fixed;
  top: var(--edge-top);
  left: var(--edge-left);
  z-index: 10;
  pointer-events: none;
  margin: 0;
  font-size: clamp(0.8rem, calc(0.8rem + (100vw - 640px) * 0.004), 1rem);
  letter-spacing: normal;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0.85;
}

.colophon {
  position: fixed;
  left: var(--edge-left);
  bottom: var(--edge-bottom);
  z-index: 10;
  margin: 0;
  font-size: 0.64rem;
  line-height: 1.6;
  color: var(--ink-soft);
  opacity: 0.85;
}

.colophon p {
  margin: 0;
}

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

.colophon a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .stage {
    /* center the photo within the band left between the wordmark and the
       colophon (both fixed, rem-based, so this band is stable regardless
       of screen height) instead of the full viewport — keeps it visually
       centered between the two text blocks for any photo's aspect ratio */
    top: 3.5rem;
    bottom: 4.6rem;
  }
  .frame {
    max-height: 66vh;
    /* the desktop rightward shift balances the photo against a spacious
       left nav column; on a phone-width screen that same offset reads as
       off-center rather than balanced, so keep the photo truly centered */
    transform: none;
  }
  .photo {
    max-width: min(90vw, calc(100vw - 180px));
    max-height: 66vh;
  }
  .wordmark {
    /* becomes the tap target that reveals/hides "Gallery" on mobile only;
       desktop leaves it non-interactive (pointer-events: none, above) */
    pointer-events: auto;
    cursor: pointer;
  }
  .wordmark::before {
    content: '';
    position: absolute;
    inset: -14px;
  }
}

/* ---- Gallery entry point (homepage) ---- */

.gallery-label {
  position: fixed;
  top: 50%;
  left: var(--edge-left);
  transform: translateY(-50%);
  z-index: 25;
  /* exact midpoint between the wordmark's size (top left) and the
     colophon's fixed 0.64rem (bottom left), at every viewport width */
  font-size: clamp(0.72rem, calc(0.72rem + (100vw - 640px) * 0.002), 0.82rem);
  color: var(--ink-soft);
  text-decoration: none;
  opacity: 0.8;
  cursor: var(--cursor-shooting-star);
}

/* invisible padded hit-zone so the shooting-star cursor (and click target)
   isn't limited to the tight text box — text/layout above is untouched */
.gallery-label::before {
  content: '';
  position: absolute;
  inset: -16px;
}

.gallery-label:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  /* Mobile-only nav: "Gallery" moves up next to "Marley Chaney" on the
     same line, top-right, and stays hidden until the wordmark is tapped —
     plain show/hide, no panel, border, or transition. */
  .gallery-label {
    top: var(--edge-top);
    left: auto;
    right: var(--edge-left);
    transform: none;
    display: none;
  }
  .gallery-label.is-visible {
    display: block;
  }
}

/* ---- Shared minimal back-link (Gallery, Project pages) ---- */

.back-link {
  position: fixed;
  top: var(--edge-top);
  left: var(--edge-left-back);
  z-index: 30;
  font-size: var(--fs-label);
  color: var(--ink-soft);
  text-decoration: none;
  opacity: 0.85;
  cursor: var(--cursor-shooting-star);
}

.back-link::before {
  content: '';
  position: absolute;
  inset: -16px;
}

.back-link:hover {
  text-decoration: underline;
}

/* ---- Gallery index page ---- */

.gallery-page {
  height: auto;
  min-height: 100vh;
  overflow: auto;
}

.gallery-wrap {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding:
    clamp(7rem, calc(7rem + (100vw - 640px) * 0.04), 9rem)
    3vw
    clamp(4rem, calc(4rem + (100vw - 640px) * 0.04), 6rem);
  align-items: start;
  transform: translateX(clamp(-100px, calc((100vw - 640px) * -0.125), 0px));
}

.gallery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: right;
}

.gallery-item {
  margin: 0;
}

.gallery-item a {
  position: relative;
  display: block;
  padding: 0.5rem 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 150ms ease;
  cursor: var(--cursor-shooting-star);
}

/* invisible padded hit-zone so the shooting-star cursor isn't limited to
   the tight text box — text/layout above is untouched */
.gallery-item a::before {
  content: '';
  position: absolute;
  inset: -6px -24px;
}

.gallery-item a:hover,
.gallery-item a:focus,
.gallery-item a.active {
  color: var(--ink);
}

.gallery-preview {
  position: sticky;
  top: clamp(7rem, calc(7rem + (100vw - 640px) * 0.04), 9rem);
}

.gallery-preview img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

/* ---- Individual project page: continuous horizontal filmstrip ---- */

.filmstrip {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.filmstrip::-webkit-scrollbar {
  display: none;
}

.filmstrip-track {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  padding: 0 50vw;
}

.filmstrip-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.filmstrip-photo {
  display: block;
  max-width: min(82vw, 900px);
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.project-title {
  position: fixed;
  left: var(--edge-left-title);
  bottom: var(--edge-bottom);
  z-index: 10;
  margin: 0;
  font-size: clamp(0.66rem, calc(0.66rem + (100vw - 640px) * 0.0008), 0.7rem);
  color: var(--ink-soft);
  opacity: 0.85;
}

@media (max-width: 640px) {
  .gallery-wrap {
    grid-template-columns: 1fr;
    padding-left: 5vw;
    padding-right: 5vw;
    gap: 1.5rem;
  }
  .gallery-preview {
    position: static;
  }
  .filmstrip-photo {
    max-width: 90vw;
    max-height: 66vh;
  }
  /* portrait photos ~22% smaller than the 90vw used for horizontal ones */
  .filmstrip-photo.is-portrait {
    max-width: 70vw;
  }
}

