  :root{
    --bg: #c6c4c1;
    --bg-rgb: 206, 204, 201; /* keep this in sync with --bg above */
    --ink: #4a4a4a;
    --muted: #4a4a4a;
    --gap-col: 64px;
    --gap-row: 64px;
    --side-margin: 48px;
  }

  * { box-sizing: border-box; }

  body{
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  /* ---------- Nav ---------- */
  header.nav{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px var(--side-margin) 32px;
  }

  .nav-left{
    display: flex;
    gap: 48px;
  }

  .nav-left a,
  .nav-left .nav-btn{
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
  }

  .nav-left a:hover,
  .nav-left .nav-btn:hover{
    opacity: 0.6;
    scale: 1.07;
  }

  .nav-right a{
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 15px;
    font-weight: 500;
  }

  /* ---------- Tags filter bar ---------- */
  .tags-bar{
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px var(--side-margin) 40px;
  }

  .tag-btn{
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--ink);
    border-radius: 6px;
    padding: 6px 16px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  }

  .tag-btn:hover{
    opacity: 0.6;
  }

  .tag-btn.active{
    background: #584354;
    border-color: #584354;
    color: #e1e1e1;
  }

  /* ---------- Grid ---------- */
  main{
    padding: 0 var(--side-margin) 80px;
  }

  .grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--gap-col);
    row-gap: var(--gap-row);
    align-items: start;
  }

  .project{
    display: block;
    color: var(--ink);
    text-decoration: none;
  }

  .project, .project *{
    text-decoration: none;
  }

  .project-hero video {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
}

  .media{
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.8s cubic-bezier(.25,.8,.25,1);
    transform-origin: center;
  }

  .project:hover .media{
    transform: scale(0.4);
    filter: blur(0px); 
    transition: transform 0.3s ease, filter 0.3s ease;
} 

  .media img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* placeholder art (swap these for real <img> tags) */
  .media.ph{
    aspect-ratio: var(--ar, 3 / 2);
  }
  .media.ph span{
    font-size: 13px;
    color: rgba(0,0,0,0.35);
    letter-spacing: 0.02em;
  }

  .meta{
    display: flex;
    gap: 24px;
    margin-top: 16px;
  }

  .meta .year{
    flex: 0 0 56px;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
  }

  .meta .info .title{
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
    font-style: italic;
    color: var(--ink);
    text-decoration: none;
  }

  .meta .info .subtitle{
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
  }

  .meta .info .tags-list{
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
    opacity: 0.55;
    text-decoration: none;
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 900px){
    :root{
      --gap-col: 40px;
      --gap-row: 48px;
      --side-margin: 28px;
    }
  }

  @media (max-width: 640px){
    .grid{ grid-template-columns: 1fr; }
    header.nav{ flex-wrap: wrap; gap: 16px; }
  }

  /* ---------- Project subpages ---------- */
  .back-link{
    display: block;
    padding: 0 var(--side-margin);
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--ink);
    text-decoration: none;
  }

  .back-link:hover{
    opacity: 0.6;
  }

  .project-hero{
    display: flex;
    justify-content: center;
    padding: 0 var(--side-margin);
    margin-bottom: 32px;
  }

  .project-hero img{
    max-width: 720px;
    width: 100%;
    height: auto;
    display: block;
  }

  .project-info{
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--side-margin);
    text-align: center;
    margin-bottom: 64px;
  }

  .project-info .title{
    font-size: 22px;
    font-weight: 600;
    font-style: italic;
    margin: 0 0 4px;
    color: var(--ink);
  }

  .project-info .subtitle{
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 4px;
  }

  .project-info .year{
    font-size: 14px;
    color: var(--muted);
    opacity: 0.5;
    margin: 0 0 28px;
    display: block;
  }

  .project-info .tags-list{
    font-size: 13px;
    color: var(--muted);
    opacity: 0.55;
    margin: 0 0 20px;
  }

  .project-info .synopsis{
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    text-align: left;
  }

  .project-info .synopsis p{
    margin: 0 0 20px;
  }

  .project-info .synopsis p:last-child{
    margin-bottom: 0;
  }

  .gallery-heading{
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--side-margin);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 20px;
  }

  .gallery{
    position: relative;
    width: 100%;
    padding: 0 var(--side-margin) 80px;
  }

  /* positioned by the masonry script below — top/left are set via
     inline transform, width via inline style */
  .gallery-item{
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* placeholder tiles show a mix of aspect ratios so you can see the
     gallery still reads well once you drop in images of different
     sizes/proportions — set via --ar on each .gallery-item */
  .gallery-item.ph{
    aspect-ratio: var(--ar, 3 / 2);
  }

  .gallery-item img{
    width: 100%;
    height: auto;
    display: block;
  }

  .gallery-item span{
    font-size: 13px;
    color: rgba(0,0,0,0.35);
    letter-spacing: 0.02em;
    text-align: center;
    padding: 0 12px;
  }

  /* ---------- Lightbox ---------- */
  .project-hero img,
  .gallery-item img{
    cursor: zoom-in;
  }

  .lightbox{
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 14, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 40px;
    overflow: auto;
  }

  .lightbox.active{
    display: flex;
  }

  .lightbox img{
    max-width: 88vw;
    max-height: 86vh;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: transform 0.35s ease;
  }

  .lightbox img.zoomed{
    cursor: zoom-out;
    transform: scale(2.2);
  }

  .lightbox-close,
  .lightbox-prev,
  .lightbox-next{
    position: fixed;
    background: none;
    border: none;
    color: #efece4;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 12px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
  }

  .lightbox-close:hover,
  .lightbox-prev:hover,
  .lightbox-next:hover{
    opacity: 1;
  }

  .lightbox-close{
    top: 20px;
    right: 24px;
    font-size: 32px;
  }

  .lightbox-prev{
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 44px;
  }

  .lightbox-next{
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 44px;
  }

  @media (max-width: 640px){
    .lightbox-prev{ left: 4px; }
    .lightbox-next{ right: 4px; }
  }
  /* ---------- About / Contact overlay ---------- */
  .about-overlay{
    position: fixed;
    inset: 0;
    background: rgba(var(--bg-rgb), 0.94);
    z-index: 2000;
    display: none;
    overflow-y: auto;
    padding: 170px var(--side-margin) 80px;
  }

  .about-overlay.active{
    display: block;
  }

  .overlay-close{
    position: fixed;
    top: 32px;
    right: var(--side-margin);
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    z-index: 2001;
  }

  .overlay-close:hover{
    opacity: 1;
  }

  .overlay-inner{
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    gap: 56px;
    align-items: flex-start;
  }

  .overlay-image{
    width: 100%;
    max-width: 260px;
    aspect-ratio: 3 / 4;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
  }

  .overlay-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .overlay-image span{
    font-size: 13px;
    color: rgba(0,0,0,0.35);
    letter-spacing: 0.02em;
    text-align: center;
    padding: 0 12px;
  }

  .overlay-text{
    flex: 1;
    min-width: 0;
  }

  .overlay-text .overlay-heading{
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 20px;
  }

  .overlay-text p{
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    margin: 0 0 32px;
  }

  .contacts-segment h3{
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 16px;
  }

  .contact-line{
    display: flex;
    gap: 12px;
    align-items: baseline;
    font-size: 15px;
    margin: 0 0 10px;
    color: var(--ink);
  }

  .contact-line .label{
    color: var(--muted);
    min-width: 80px;
  }

  .contact-line a,
  .copy-email{
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .copy-email{
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
  }

  .copy-email.copied::after{
    content: " — copied!";
    text-decoration: none;
    color: var(--muted);
  }

  @media (max-width: 640px){
    .overlay-inner{
      flex-direction: column;
      gap: 32px;
    }
    .overlay-image{
      max-width: 200px;
    }
    .about-overlay{
      padding: 90px 28px 60px;
    }
  }
