
:root{--bg:#f7f7f4;--text:#161616;--muted:#777;--line:#d9d9d3}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:Arial,Helvetica,sans-serif;font-weight:400}
header{display:flex;justify-content:space-between;align-items:center;padding:28px 42px;border-bottom:1px solid var(--line);position:sticky;top:0;background:rgba(247,247,244,.96);backdrop-filter:blur(8px);z-index:10}
.brand{font-size:15px;letter-spacing:.08em;text-transform:uppercase}nav{display:flex;gap:26px;font-size:14px}nav a{color:inherit;text-decoration:none}nav a:hover,.project-open:hover{opacity:.55}
main{max-width:1500px;margin:0 auto;padding:72px 42px 120px}.intro{max-width:760px;margin-bottom:90px}
h1{font-family:Georgia,'Times New Roman',serif;font-size:64px;line-height:1.02;font-weight:400;margin:0 0 22px}.intro p{font-family:Georgia,'Times New Roman',serif;font-size:22px;line-height:1.5;color:#333;margin:0}
.projects{display:grid;grid-template-columns:1fr 1fr;gap:72px 42px}.project{border-top:1px solid var(--line);padding-top:18px}.index{font-size:12px;color:var(--muted);letter-spacing:.12em;margin-bottom:34px}
.placeholder{aspect-ratio:4/3;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;color:#999;font-size:13px;letter-spacing:.08em;text-transform:uppercase;background:#fbfbf8}
.project h2{font-family:Georgia,'Times New Roman',serif;font-size:42px;font-weight:400;margin:20px 0 10px}.project p{max-width:540px;font-size:15px;line-height:1.6;color:#555;margin:0}
.project-open{display:block;color:inherit;text-decoration:none;cursor:pointer}.project-cover{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;background:var(--bg)}
section.text-section{border-top:1px solid var(--line);margin-top:120px;padding-top:28px;display:grid;grid-template-columns:280px 1fr;gap:40px}section.text-section h3{font-size:13px;letter-spacing:.12em;text-transform:uppercase;font-weight:400;margin:0}section.text-section .copy{max-width:760px;font-family:Georgia,'Times New Roman',serif;font-size:21px;line-height:1.55}
footer{border-top:1px solid var(--line);padding:28px 42px 48px;color:#777;font-size:12px;display:flex;justify-content:space-between}
.gallery-page{display:none;max-width:1120px;margin:0 auto;padding:48px 42px 110px}.gallery-page:target{display:block}body:has(.gallery-page:target) main,body:has(.gallery-page:target) footer{display:none}
.gallery-heading{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:82px}.gallery-heading h1{font-size:58px}.gallery-back{color:var(--text);text-decoration:none;font-size:13px;letter-spacing:.04em;padding-top:12px}.gallery-frame{margin:0 auto 110px;text-align:center}.gallery-frame img{display:block;max-width:100%;max-height:84vh;width:auto;height:auto;margin:auto}.gallery-frame figcaption{margin-top:20px;font-size:11px;color:#888;letter-spacing:.1em}.gallery-page p{color:#555;max-width:620px;line-height:1.6}
@media(max-width:800px){header{padding:22px 20px;align-items:flex-start;gap:20px}nav{gap:14px;flex-wrap:wrap;justify-content:flex-end}main{padding:48px 20px 80px}h1{font-size:44px}.projects{grid-template-columns:1fr;gap:52px}section.text-section{grid-template-columns:1fr;gap:18px;margin-top:80px}.project h2{font-size:36px}.gallery-page{padding:40px 20px 60px}.gallery-heading h1{font-size:42px}.gallery-frame{margin-bottom:80px}}


/* Elements: native CSS snap scrolling works even without JavaScript.
   Keeps the existing page structure, typography, and curated photographs. */
.gallery-oneup.gallery-page:target {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 9;
  inset: var(--site-header-height, 82px) 0 0;
  max-width: none;
  width: 100%;
  padding: 20px clamp(18px, 3.5vw, 52px) 18px;
  overflow: hidden;
  background: var(--bg);
}
.gallery-oneup .gallery-heading {
  flex: 0 0 auto;
  align-items: center;
  margin: 0 0 16px;
  max-width: 1440px;
  width: 100%;
  align-self: center;
}
.gallery-oneup .gallery-heading h1 {
  font-size: clamp(27px, 2.8vw, 38px);
  line-height: 1.1;
  margin: 0 0 7px;
}
.gallery-oneup .gallery-heading p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: 680px;
  color: #777;
}
.gallery-oneup .gallery-back { padding-top: 0; white-space: nowrap; }
.gallery-stage {
  display: flex;
  flex-direction: column;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1440px;
  align-self: center;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-y;
}
.gallery-stage::-webkit-scrollbar { display: none; }
.gallery-oneup .gallery-frame,
.gallery-oneup .gallery-frame.is-active {
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.gallery-oneup .gallery-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  touch-action: pan-y;
}
.gallery-oneup .gallery-frame figcaption { display: none; }
.gallery-controls {
  flex: 0 0 auto;
  width: 100%;
  max-width: 1440px;
  align-self: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 13px;
  gap: 20px;
}
.gallery-count {
  min-width: 75px;
  font-size: 12px;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.gallery-instruction { font-size: 11px; color: #969690; letter-spacing: .04em; }
.gallery-buttons { display: flex; gap: 8px; }
.gallery-arrow {
  appearance: none;
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  width: 44px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font: 20px Georgia, serif;
}
.gallery-arrow:hover:not(:disabled) { border-color: #666; }
.gallery-arrow:disabled { opacity: .24; cursor: default; }
.gallery-arrow:focus-visible, .gallery-back:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@media (max-width: 800px) {
  .gallery-oneup.gallery-page:target { padding: 16px 14px 14px; }
  .gallery-oneup .gallery-heading { margin-bottom: 12px; gap: 12px; }
  .gallery-oneup .gallery-heading h1 { font-size: 27px; }
  .gallery-oneup .gallery-heading p { font-size: 12px; }
  .gallery-oneup .gallery-back { font-size: 12px; }
  .gallery-instruction { display: none; }
  /* Touch devices use native swipe / snap navigation. */
  .gallery-buttons { display: none; }
  .gallery-controls { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-stage { scroll-behavior: auto; }
}

/* Counter belongs to each photograph, not a JS-updated fixed label.
   This ensures it stays correct when Safari/ChatGPT only permits native scrolling. */
.gallery-oneup .gallery-frame { padding-bottom: 30px; }
.gallery-slide-counter {
  position: absolute;
  bottom: 5px;
  left: 0;
  font-size: 12px;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  line-height: 1.4;
}
.gallery-controls .gallery-count {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


/* Production page route: identical gallery treatment with a genuine permanent URL. */
body.gallery-route { height:100vh; height:100dvh; display:flex; flex-direction:column; overflow:hidden; }
body.gallery-route > header { flex:0 0 auto; }
body.gallery-route .gallery-page.gallery-oneup.is-page {
  display:flex; flex-direction:column; position:relative; inset:auto; z-index:auto; width:100%; max-width:none;
  flex:1 1 auto; min-height:0; margin:0; padding:20px clamp(18px,3.5vw,52px) 18px;
  overflow:hidden; background:var(--bg);
}
body.gallery-route .gallery-oneup .gallery-stage { min-height:0; }
@media (max-width:800px) {
 body.gallery-route .gallery-page.gallery-oneup.is-page { padding:16px 14px 14px; }
}

/* Elements gallery only: charcoal viewing room. Homepage remains unchanged. */
body.gallery-route {
  --bg: #1b1c1b;
  --text: #e8e7e1;
  --muted: #a7a6a0;
  --line: #41423f;
}
body.gallery-route > header {
  background: rgba(27, 28, 27, .97);
}
body.gallery-route .gallery-oneup .gallery-heading p {
  color: #aaa9a3;
}
body.gallery-route .gallery-instruction {
  color: #a7a6a0;
}
body.gallery-route .gallery-arrow:hover:not(:disabled) {
  border-color: #c2c1b9;
}


/* Gallery immersion: introductory site chrome is present only for photograph one.
   Header/heading overlays do not affect snap-panel heights. */
body.gallery-route > header {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  z-index: 12;
  transition: opacity .18s ease, visibility .18s ease;
}
body.gallery-route .gallery-page.gallery-oneup.is-page {
  padding-top: 0;
}
body.gallery-route .gallery-oneup .gallery-heading {
  position: absolute;
  z-index: 11;
  top: calc(var(--gallery-header-height, 82px) + 20px);
  left: clamp(18px, 3.5vw, 52px);
  right: clamp(18px, 3.5vw, 52px);
  width: auto;
  max-width: none;
  margin: 0;
  transition: opacity .18s ease, visibility .18s ease;
}
body.gallery-route .gallery-oneup .gallery-frame:first-child {
  padding-top: var(--gallery-first-intro-space, 220px);
}
body.gallery-route.gallery-immersive > header,
body.gallery-route.gallery-immersive .gallery-oneup .gallery-heading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 800px) {
  body.gallery-route .gallery-oneup .gallery-heading {
    top: calc(var(--gallery-header-height, 118px) + 16px);
    left: 14px;
    right: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.gallery-route > header,
  body.gallery-route .gallery-oneup .gallery-heading { transition: none; }
}


/* End-of-gallery thumbnail overview. The first image keeps its introduction;
   every later image remains immersive. No intermediate opening state. */
body.gallery-route .gallery-overview-trigger {
  display: none;
  border: 0;
  padding: 5px 0;
  background: transparent;
  color: var(--muted);
  font: 12px Arial, Helvetica, sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
}
body.gallery-route.gallery-at-end .gallery-overview-trigger { display: inline-block; }
body.gallery-route .gallery-overview-trigger:hover { color: var(--text); }
body.gallery-route .gallery-overview-trigger:focus-visible,
body.gallery-route .gallery-overview-close:focus-visible,
body.gallery-route .gallery-overview-tile:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}
.gallery-overview {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity .55s ease,
              transform .55s cubic-bezier(.22, 1, .36, 1),
              visibility 0s linear .55s;
}
.gallery-overview.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .55s ease,
              transform .55s cubic-bezier(.22, 1, .36, 1),
              visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .gallery-overview,
  .gallery-overview.is-open {
    transition: none;
    transform: none;
  }
}
.gallery-overview-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px calc(48px + env(safe-area-inset-bottom, 0px));
}
.gallery-overview-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  align-items: center;
  justify-content: space-between;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 0 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.gallery-overview-head h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  font-size: 30px;
  margin: 0;
}
.gallery-overview-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  font: 31px Arial, sans-serif;
}
.gallery-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 18px;
}
.gallery-overview-tile {
  appearance: none;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.gallery-overview-media {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #252625;
}
.gallery-overview-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gallery-overview-number {
  display: block;
  padding-top: 7px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}
.gallery-overview-footer {
  padding: 34px 0 16px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.gallery-overview-footer a { color: var(--text); text-decoration: none; }
.gallery-overview-footer a:hover { opacity: .65; }
@media (max-width: 800px) {
  .gallery-overview-inner { padding: 0 16px calc(42px + env(safe-area-inset-bottom, 0px)); }
  .gallery-overview-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); margin-bottom: 16px; }
  .gallery-overview-head h2 { font-size: 26px; }
  .gallery-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
}

/* Unified charcoal palette for homepage and project galleries.
   The gallery colour scheme above is retained; only the light home route changes. */
body:not(.gallery-route) {
  --bg: #1b1c1b;
  --text: #e8e7e1;
  --muted: #a7a6a0;
  --line: #41423f;
}
body:not(.gallery-route) > header {
  background: rgba(27, 28, 27, .97);
}
body:not(.gallery-route) .intro p,
body:not(.gallery-route) .project p {
  color: #aaa9a3;
}
body:not(.gallery-route) footer {
  color: var(--muted);
}
body:not(.gallery-route) .placeholder {
  background: #252625;
  color: var(--muted);
}
/* Unified charcoal palette for homepage — end. */
