:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --tile-bg: #f4f4f2;
  --max: 1200px;
  --gap: 24px;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 16px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.site-name .aka {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
@media (max-width: 480px) {
  .nav { gap: 8px 16px; }
  .nav a { font-size: 12px; letter-spacing: 0.08em; }
}
.nav a {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

/* ---------- Main ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ---------- Gallery grid ---------- */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* centres a part-filled last row */
  gap: var(--gap);
  --cols: 3;
}
@media (max-width: 900px) { .grid { --cols: 2; --gap: 16px; } }
@media (max-width: 520px) { .grid { --cols: 1; } }

.tile {
  position: relative;
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  aspect-ratio: 1 / 1;
  background: var(--tile-bg);
  overflow: hidden;
}
.tile-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.tile-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}
.tile-open:hover img { opacity: 0.92; }
.tile-open:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

/* Carousel arrows: shown on hover/focus; always shown on touch screens */
.tile-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  padding: 0 0 3px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.tile-prev { left: 10px; }
.tile-next { right: 10px; }
.tile:hover .tile-arrow,
.tile:focus-within .tile-arrow { opacity: 1; }
.tile-arrow:hover { background: #fff; }
.tile-arrow:focus-visible { opacity: 1; outline: 2px solid var(--text); outline-offset: 2px; }

.tile-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tile:hover .tile-dots,
.tile:focus-within .tile-dots { opacity: 1; }
.tile-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}
.tile-dots span.on { background: #fff; transform: scale(1.25); }

@media (hover: none) {
  .tile-arrow, .tile-dots { opacity: 1; }
  .tile-arrow { width: 32px; height: 32px; font-size: 22px; background: rgba(255, 255, 255, 0.75); }
}

.empty { color: var(--muted); padding: 80px 0; text-align: center; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  margin: 0;
  max-width: min(1100px, 100vw - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  display: block;
}
.lightbox.has-views img { max-height: calc(100vh - 220px); }
.lb-views {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.lightbox .lb-view {
  position: static;
  transform: none;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid transparent;
  background: var(--tile-bg);
  opacity: 0.55;
  cursor: pointer;
}
.lightbox .lb-view img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}
.lightbox .lb-view:hover { opacity: 0.85; }
.lightbox .lb-view[aria-current="true"] { opacity: 1; border-color: var(--text); }
.lightbox figcaption {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lb-title { font-weight: 600; }
.lb-details, .lb-sold { color: var(--muted); }
.lb-buy {
  margin-top: 10px;
  padding: 8px 18px;
  border: 1px solid var(--text);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lb-buy:hover { background: var(--text); color: var(--bg); }

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
  padding: 12px 16px;
}
.lightbox button[hidden] { display: none; }
.lb-close { top: 8px; right: 8px; font-size: 36px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lightbox figure { max-width: calc(100vw - 32px); }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
}
.about img { width: 100%; display: block; background: var(--tile-bg); }
.about h1 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.about p { margin: 0 0 1em; max-width: 60ch; }
.about:not(:has(img)) { grid-template-columns: 1fr; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Footer ---------- */
.site-footer {
  width: calc(100% - 32px);
  max-width: calc(var(--max) - 32px);
  margin: 0 auto;
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.sep { margin: 0 10px; }
