
  :root {
    --paper: #ffffff;
    --ink: #333333;
    --ink-soft: rgba(51, 51, 51, 0.5);
    --hair: rgba(10, 10, 10, 0.16);
    --rule: 1px solid var(--ink);
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  [hidden] { display: none !important; }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.06em;
    -webkit-font-smoothing: antialiased;
    text-transform: uppercase;
  }

  ::selection { background: var(--ink); color: var(--paper); }

  /* ---------- header ---------- */

  .top {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 40px; /* panel sits at exactly 40px — no gap */
    padding: 0 16px;
    background: var(--paper);
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .top .mid {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .top button {
    all: unset;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
  }

  .top .cnt { color: var(--ink); }

  .top .right {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .top .hbtn {
    color: var(--ink);
    transition: transform 160ms var(--ease-out);
  }

  .top .hbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
  .top .hbtn:active { transform: scale(0.95); }

  /* ---------- filter panel (hidden dropdown) ---------- */

  .fpanel {
    position: fixed;
    top: 40px;
    left: 0; right: 0;
    z-index: 39;
    background: var(--paper);
    overflow: hidden;
    max-height: 0;
    transition: max-height 220ms var(--ease-out);
  }

  .fpanel.open { max-height: min(480px, calc(100vh - 40px)); }

  .fpanel .finner {
    border-top: var(--rule);
    border-bottom: var(--rule);
  }

  .filter-primary {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 40px;
    padding: 0 16px;
    border-bottom: var(--rule);
  }

  .filter-primary .f {
    all: unset;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    color: var(--ink-soft);
    transition: color 160ms var(--ease-out), transform 160ms var(--ease-out);
  }

  .filter-primary .f:hover,
  .filter-primary .f.on { color: var(--ink); }
  .filter-primary .f:active { transform: scale(0.95); }

  .fcols {
    display: grid;
    grid-template-columns: minmax(190px, 27%) minmax(190px, 27%) 1fr;
  }

  .fcol { border-right: var(--rule); }
  .fcol:last-child { border-right: 0; }

  .fhead {
    display: flex;
    align-items: center;
    height: 24px;
    padding: 0 16px;
    border-bottom: var(--rule);
    color: var(--ink);
  }

  .fopts { padding: 8px 16px 16px; }

  .fcol .f {
    all: unset;
    display: block;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    color: var(--ink-soft);
    line-height: 1.7;
    transition: color 200ms var(--ease-out);
  }

  .fcol .f:hover,
  .fcol .f.on { color: var(--ink); }

  .fclose {
    all: unset;
    margin-left: auto;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    color: var(--ink);
  }

  .fclose:hover { text-decoration: underline; text-underline-offset: 3px; }

  /* ---------- canvas + grid ---------- */

  .canvas {
    margin: 0 auto;
  }

  .masonry {
    width: 100%;
    padding-top: 40px;
    columns: 4;
    column-gap: 0;
    transform-origin: 0 0;
  }

  .item {
    position: relative;
    break-inside: avoid;
    cursor: pointer;
    overflow: hidden;
  }

  .frame { display: block; overflow: hidden; }

  /* modular vertical rhythm — 6 / 12 / 24, repeating */
  .sp-a { margin-bottom: 6vh; }
  .sp-b { margin-bottom: 12vh; }
  .sp-c { margin-bottom: 24vh; }

  .item img {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
    filter: saturate(0.72) contrast(0.97);
    transform: none;
  }

  .item figcaption {
    display: block;
    position: relative;
    z-index: 1;
    background: var(--paper);
    padding: 8px 10px 0;
    height: 26px;
    line-height: 1;
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: var(--ink);
  }

  /* ---------- reveal motion ---------- */

  .item {
    opacity: 0;
    transition: opacity 640ms var(--ease-out);
    transition-delay: var(--d, 0ms);
  }

  .item .frame {
    transform: scale(1.025);
    transform-origin: 50% 50%;
    transition: transform 640ms var(--ease-out);
    transition-delay: var(--d, 0ms);
  }

  .item.in { opacity: 1; }
  .item.in .frame { transform: scale(1); }

  .item.instant,
  .item.instant .frame { transition: none; }

  /* ---------- lightbox ---------- */

  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.88);
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms var(--ease-out);
  }

  .lightbox.open {
    opacity: 1;
    pointer-events: auto;
  }

  .lightbox .lb-media > img {
    max-width: min(88vw, 1240px);
    max-height: 80vh;
    display: block;
    transform: scale(0.97);
    filter: saturate(0.72) contrast(0.97);
    opacity: 0;
    transition:
      transform 400ms var(--ease-out),
      opacity 300ms var(--ease-out);
  }

  .lightbox.open .lb-media > img.ready {
    transform: scale(1);
    opacity: 1;
  }

  .lightbox .lb-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: min(88vw, 1240px);
    max-height: 80vh;
    margin: 0;
  }

  .lightbox .lb-media > img {
    max-width: 100%;
    max-height: calc(80vh - 28px);
  }

  .lightbox .lb-meta {
    display: flex;
    align-items: center;
    align-self: stretch;
    justify-content: flex-start;
    width: 100%;
    min-height: 28px;
    padding-top: 10px;
    color: var(--ink);
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .lightbox .lb-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .lightbox button {
    all: unset;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    color: var(--ink);
    transition: transform 160ms var(--ease-out);
  }

  .lightbox button:active { transform: scale(0.95); }

  .lb-zone {
    position: absolute;
    top: 0; bottom: 0;
    width: 50%;
    z-index: -1;
  }
  .lb-zone--prev { left: 0; cursor: w-resize; }
  .lb-zone--next { right: 0; cursor: e-resize; }

  body.locked { overflow: hidden; }

  /* ---------- mobile ---------- */

  @media (max-width: 900px) {
    .masonry { columns: 3; }
    .sp-a { margin-bottom: 4vh; }
    .sp-b { margin-bottom: 8vh; }
    .sp-c { margin-bottom: 16vh; }
  }

  @media (max-width: 600px) {
    .masonry { columns: 2 !important; } /* fixed — no manual control on mobile */
    .item figcaption { font-size: 8.5px; }
    .top { padding: 0 12px; }
    .top .mid { display: none; }
    .top .right { gap: 12px; }
    .filter-primary { gap: 14px; padding: 0 12px; }
    .fcols { grid-template-columns: 1fr 1fr minmax(44px, auto); }
    .fhead { padding: 0 12px; }
    .fopts { padding: 8px 12px 14px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .item { transition: opacity 200ms ease; }
    .item .frame {
      transform: none;
      transition: none;
    }
    .fpanel,
    .lightbox { transition: none; }
    .lightbox .lb-media > img {
      transform: none;
      transition: opacity 200ms ease;
    }
  }

/* Standalone gallery controls and the click-open background blur. */
.top { justify-content: space-between; font-size: 12px; }
.top .mid { color: inherit; text-decoration: none; font-size: 12px; }
.top .hbtn, .lightbox button { min-height: 40px; }
.top .right { margin-left: auto; }
.shuffle-icon { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.25; }
.fpanel.open { max-height: calc(100svh - 40px); overflow-y: auto; }
.fcols { grid-template-columns: 1fr 1fr; }
.lightbox { background: rgba(255,255,255,.48); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.lb-bar { align-items: center; padding: 0 16px; }
.lb-actions { display: flex; gap: 20px; }
.lb-media > img { width: auto; height: auto; object-fit: contain; }
button:focus-visible, a:focus-visible, .item:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.empty { padding: 80px 16px; text-align: center; }
@media (max-width: 600px) {
  .top .mid { display: inline; position: static; transform: none; }
  .lb-actions { gap: 16px; }
}

/* A quiet guestbook beneath the photographs. */
.top a { color: inherit; text-decoration: none; }
.comments { max-width: 680px; margin: 0 auto; padding: 64px 20px 100px; scroll-margin-top: 40px; font-size: 13px; line-height: 1.6; letter-spacing: 0; text-transform: none; }
.comments-heading { margin-bottom: 28px; }
.comments h1 { font-size: 14px; font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.comments-heading > span, .comment-note { color: #666; font-size: 11px; }
.comments label { display: block; margin: 16px 0 6px; }
.comments label span { color: #666; }
.comments input, .comments textarea { display: block; width: 100%; border: 1px solid #aaa; border-radius: 0; background: white; color: #333; padding: 10px; font: inherit; }
.comments textarea { resize: vertical; min-height: 100px; }
.comments input:focus-visible, .comments textarea:focus-visible { outline: 1px solid #333; outline-offset: 1px; }
.comments button { border: 1px solid #333; background: white; color: #333; padding: 10px 16px; font: inherit; cursor: pointer; min-height: 44px; }
.comments button:disabled { opacity: .5; cursor: wait; }
.comment-form-footer { display: flex; align-items: center; gap: 16px; margin: 16px 0 8px; }
#comments-status { margin-top: 32px; }
.comment-list { list-style: none; margin-top: 20px; }
.comment-list li { padding: 22px 0; border-top: 1px solid #ddd; }
.comment-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; font-size: 12px; }
.comment-meta time { color: #666; flex-shrink: 0; }
.comment-list p { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-meta span { overflow-wrap: anywhere; }
@media (max-width: 600px) { .comments input, .comments textarea { font-size: 16px; } }
.top .right > a { display: inline-flex; align-items: center; min-height: 40px; }
