/* A quiet gallery wall. System fonts only; no external requests. */

:root {
  color-scheme: light;
  --wall: #e6dfd2;
  --wall-deep: #d9d0c0;
  --wall-light: #efe9dd;
  --plaster: rgba(80, 64, 40, 0.045);
  --rail: #8a7d68;
  --brass: #9a8660;
  --frame: #2c241c;
  --frame-edge: #1a1510;
  --mat: #fbf8f2;
  --mat-line: #e6e0d4;
  --card: #f6f1e6;
  --card-edge: #cfc6b4;
  --ink: #2a261f;
  --ink-soft: #5c564c;
  --ink-faint: #7a7368;
  --shadow: rgba(40, 30, 18, 0.28);
  --serif: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", Times, serif;
  --sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --frame-w: 0.72rem;
  --mat-w: 1.7rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background-color: var(--wall);
  background-image:
    radial-gradient(ellipse 90% 42% at 50% -8%, rgba(255, 250, 240, 0.62), transparent 62%),
    linear-gradient(180deg, var(--wall-light) 0%, var(--wall) 38%, var(--wall-deep) 100%);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint plaster grain, no network. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
p,
figure {
  margin: 0;
}

a {
  color: var(--ink);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--frame);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--frame);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Header ----- */

.masthead {
  text-align: center;
  padding: 2.75rem 1.25rem 1.5rem;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.masthead h1 {
  margin-top: 0.55rem;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.rail {
  height: 0;
  margin: 0.35rem 0 0;
  border: 0;
  border-top: 1px solid var(--rail);
  box-shadow: 0 1px 0 rgba(255, 250, 240, 0.6);
}

/* ----- Gallery ----- */

.gallery {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 2.4rem auto 4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.25rem 2.75rem;
  align-items: start;
  flex: 1;
}

@media (min-width: 760px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 4.25rem 3.25rem;
    width: min(1120px, calc(100% - 4rem));
    margin-top: 2.8rem;
  }
}

.work {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.frame {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  max-width: 32rem;
  margin: 0;
  padding: var(--frame-w);
  border: 1px solid var(--frame-edge);
  background:
    linear-gradient(145deg, #3a3126 0%, var(--frame) 42%, #1f1914 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0.7rem 1.6rem var(--shadow);
  cursor: zoom-in;
  color: inherit;
  text-align: left;
}

.frame:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 0.95rem 1.9rem rgba(40, 30, 18, 0.36);
}

.frame:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}

.mat {
  display: block;
  padding: var(--mat-w);
  background:
    linear-gradient(180deg, #fffcf7 0%, var(--mat) 100%);
  box-shadow:
    inset 0 0 0 1px var(--mat-line),
    inset 0 0 0.6rem rgba(80, 60, 30, 0.06);
}

.mat img {
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(80, 60, 30, 0.08);
}

/* Wall label */

.label {
  width: 100%;
  max-width: 32rem;
  margin-top: 0.95rem;
  display: flex;
  justify-content: flex-start;
}

.label-card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  box-shadow: 0 1px 2px rgba(40, 30, 18, 0.08);
  padding: 0.62rem 0.8rem 0.58rem;
  min-width: 10.5rem;
  max-width: 16rem;
}

.label-card .title {
  font-size: 0.92rem;
  font-style: italic;
  letter-spacing: 0.01em;
}

.label-card .artist {
  margin-top: 0.18rem;
  font-size: 0.88rem;
}

.label-card .meta {
  margin-top: 0.28rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

/* ----- Footer / baseboard ----- */

.colophon {
  margin-top: auto;
  border-top: 10px solid #4a4034;
  box-shadow: 0 -1px 0 var(--brass);
  padding: 1rem 1.25rem 1.35rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: linear-gradient(180deg, #cfc5b3 0%, #c4b9a5 100%);
}

/* ----- Lightbox ----- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.25rem 1.5rem;
  background: #14110e;
  color: #f3eee4;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(96vw, 1600px);
  max-height: 100%;
  min-width: 0;
}

.lightbox-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 7.5rem);
  max-width: 100%;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 7.5rem);
  width: auto;
  height: auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1.2rem 3rem rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.95rem;
}

.lightbox-caption .title {
  font-style: italic;
}

.lightbox-caption .sep {
  margin: 0 0.45rem;
  color: #b8b09f;
}

.lightbox-caption .meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #c4bbaa;
}

.lightbox-ui {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  background: rgba(20, 16, 12, 0.45);
  color: #f3eee4;
  border: 1px solid rgba(243, 238, 228, 0.28);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.lightbox-close {
  position: fixed;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 22;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.6rem;
  border-radius: 0;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 22;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.65rem;
}

.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

.lightbox-ui:hover {
  background: rgba(20, 16, 12, 0.7);
}

.lightbox-ui:focus-visible {
  outline: 2px solid #f3eee4;
  outline-offset: 3px;
}

/* ----- 404 ----- */

.missing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem 4rem;
  gap: 0.85rem;
}

.missing h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 500;
}

.missing p {
  color: var(--ink-soft);
}

/* ----- Tight phones ----- */

@media (max-width: 390px) {
  :root {
    --frame-w: 0.55rem;
    --mat-w: 1.15rem;
  }

  .masthead {
    padding: 1.85rem 0.9rem 1.1rem;
  }

  .gallery {
    width: min(1120px, calc(100% - 1.4rem));
    margin: 1.6rem auto 2.6rem;
    gap: 2.4rem;
  }

  .label-card {
    min-width: 0;
    max-width: 100%;
  }

  .lightbox {
    padding: 3.4rem 0.6rem 1rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 2.4rem;
    height: 2.4rem;
    top: auto;
    bottom: 0.7rem;
    transform: none;
  }

  .lightbox-prev { left: 0.6rem; }
  .lightbox-next { right: 0.6rem; }

  .lightbox-image-wrap,
  .lightbox-image-wrap img {
    max-height: calc(100vh - 9.2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0.7rem 1.6rem var(--shadow); }
}
