:root {
  color-scheme: light;
  --paper: #f1f2ef;
  --ink: #344754;
  --muted: #71808a;
  --rule: #aeb8be;
  --signal: #a84236;
  --edge: clamp(1.25rem, 3.1vw, 3.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", "Arial Narrow", Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  font-feature-settings: "kern" 1, "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

body.viewer-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.site-header {
  height: 4.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  margin: 0 var(--edge);
  border-bottom: 1px solid var(--rule);
}

.brand {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

nav { display: flex; gap: clamp(1.25rem, 3vw, 3rem); }
nav a {
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
nav a:hover, nav a:focus-visible, nav a.active { color: var(--ink); }
nav a.active {
  text-decoration-color: var(--signal);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45rem;
}

.page-title {
  min-height: min(24rem, 46svh);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(4rem, 9vh, 7rem) var(--edge) clamp(2.5rem, 5vh, 4rem);
}

.page-title h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.75rem, 5.5vw, 5.75rem);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.page-title p {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(8rem, 17vw, 17rem);
  padding: 0 var(--edge) clamp(9rem, 15vw, 15rem);
}

.frame { margin: 0; }
.frame--wide { width: 100%; }
.frame--medium { width: min(70rem, 76%); }
.frame--narrow { width: min(48rem, 58%); }
.frame--right { align-self: flex-end; }
.frame--left { align-self: flex-start; }

.frame button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #e5e5df;
  cursor: zoom-in;
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 88svh;
  object-fit: contain;
}

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

figcaption {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 var(--edge);
  padding: 1.75rem 0 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  background: rgba(241,242,239,.98);
  color: var(--ink);
}
.viewer::backdrop { background: rgba(241,242,239,.98); }
.viewer[open] { display: grid; grid-template-columns: 4rem 1fr 4rem; align-items: center; }
.viewer > div { min-width: 0; height: calc(100svh - 5rem); display: grid; grid-template-rows: 1fr auto; gap: 0.75rem; }
.viewer img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer p { margin: 0; text-align: center; color: var(--muted); font-size: 0.78rem; }
.viewer-close, .viewer-nav { border: 0; background: none; cursor: pointer; }
.viewer-close { position: fixed; z-index: 2; top: 1rem; right: 1.25rem; font-size: 1.6rem; }
.viewer-nav { height: 5rem; color: var(--muted); font-size: 1.5rem; }
.viewer-nav:hover, .viewer-close:hover { color: var(--ink); }

@media (max-width: 720px) {
  .site-header {
    height: auto;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem 0;
  }
  nav { width: 100%; justify-content: space-between; gap: 0.75rem; }
  nav a { font-size: 0.8rem; }
  .page-title { min-height: 48svh; padding-top: 5rem; }
  .page-title h1 { font-size: clamp(2.75rem, 13vw, 4.5rem); }
  .gallery { gap: 7rem; }
  .frame--medium, .frame--narrow { width: 88%; }
  .frame--wide { width: calc(100% + var(--edge) * 2); margin-left: calc(var(--edge) * -1); }
  .frame--wide figcaption { padding-left: var(--edge); }
  .viewer[open] { grid-template-columns: 2.25rem 1fr 2.25rem; padding: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
