:root {
  color-scheme: dark;
  --background: #080808;
  --surface: #111;
  --surface-raised: #171717;
  --text: #f1f1ee;
  --muted: #888;
  --line: #292929;
  --error: #e27777;
  --page-padding: clamp(1rem, 3vw, 3rem);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

html.lightbox-open,
html.lightbox-open body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6.5rem;
  padding: 0 var(--page-padding);
}

.wordmark {
  max-width: 55vw;
  overflow: hidden;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.5rem);
}

.site-nav a,
.menu-button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .7rem;
  letter-spacing: .16em;
  padding: .5rem 0;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active,
.menu-button:hover {
  color: var(--text);
}

.menu-button {
  display: none;
}

main {
  min-height: calc(100vh - 12rem);
  outline: none;
  padding: 1.5rem var(--page-padding) 5rem;
}

.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 1.5rem;
}

.view-heading h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -.035em;
  text-transform: capitalize;
}

.view-heading span {
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gallery {
  columns: 3 20rem;
  column-gap: clamp(.5rem, 1vw, .9rem);
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 clamp(.5rem, 1vw, .9rem);
  padding: 0;
  break-inside: avoid;
  border: 0;
  background: var(--surface);
  cursor: zoom-in;
  overflow: hidden;
}

.photo-card img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 350ms ease, transform 500ms ease;
}

.photo-card img.loaded {
  opacity: 1;
}

.photo-card:hover img {
  transform: scale(1.012);
}

.photo-card-caption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 3rem 1rem .8rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 72%));
  font-size: .7rem;
  letter-spacing: .08em;
  opacity: 0;
  text-align: left;
  text-transform: uppercase;
  transition: opacity 180ms ease;
}

.photo-card-caption small {
  color: #aaa;
}

.photo-card:hover .photo-card-caption,
.photo-card:focus-visible .photo-card-caption {
  opacity: 1;
}

.empty-state,
.loading,
.error-state {
  display: grid;
  min-height: 45vh;
  margin: 0;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.error-state {
  color: var(--error);
}

.about {
  display: grid;
  grid-template-columns: minmax(15rem, 42vw) minmax(18rem, 35rem);
  gap: clamp(2rem, 8vw, 9rem);
  align-items: start;
  max-width: 82rem;
  margin: 2rem auto;
}

.about-portrait,
.about-placeholder {
  width: 100%;
  min-height: 55vh;
  object-fit: cover;
}

.about-placeholder {
  display: grid;
  background: var(--surface);
  color: #303030;
  font-size: clamp(5rem, 16vw, 14rem);
  font-weight: 700;
  place-items: center;
}

.about-copy {
  padding-top: clamp(0rem, 7vw, 7rem);
}

.about-kicker {
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.about h1 {
  margin: .8rem 0 2rem;
  font-size: clamp(2.5rem, 6vw, 6rem);
  font-weight: 400;
  letter-spacing: -.06em;
  line-height: .95;
}

.about-bio {
  max-width: 34rem;
  margin: 0 0 2.5rem;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  line-height: 1.65;
  white-space: pre-line;
}

.about-details {
  display: grid;
  gap: .5rem;
  color: var(--muted);
}

.about-details a {
  color: var(--text);
  width: fit-content;
}

.site-footer {
  display: flex;
  padding: 1.5rem var(--page-padding) 2.5rem;
  color: #555;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.site-footer a:hover {
  color: var(--muted);
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(1rem, 3vw, 3rem);
  border: 0;
  background: rgb(5 5 5 / 97%);
  color: var(--text);
  overflow: hidden;
}

.lightbox[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 22rem);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: center;
}

.lightbox::backdrop {
  background: #000;
}

.lightbox-frame {
  position: relative;
  display: grid;
  height: calc(100dvh - 6rem);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  place-items: center;
  touch-action: pan-y;
}

.lightbox img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.lightbox img.navigable {
  cursor: e-resize;
}

.lightbox-caption h2 {
  margin: 0 0 .8rem;
  font-size: clamp(1.4rem, 2.5vw, 2.5rem);
  font-weight: 400;
}

.lightbox-caption {
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lightbox-caption p {
  color: #aaa;
  white-space: pre-line;
}

.lightbox-caption span {
  color: #666;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lightbox-close {
  position: fixed;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.admin-shell {
  width: min(70rem, 100%);
  margin: 1rem auto;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
}

.admin-header h1,
.login-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -.05em;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.panel {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.panel h2 {
  margin: 0 0 1.5rem;
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: .45rem;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: var(--surface);
  padding: .8rem;
  font-size: .9rem;
  letter-spacing: normal;
  text-transform: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #666;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input[type='file'] {
  color: var(--muted);
}

.checkbox input {
  width: auto;
  margin: 0 .4rem 0 0;
}

.button {
  width: fit-content;
  border: 1px solid #555;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: .68rem;
  letter-spacing: .12em;
  padding: .75rem 1rem;
  text-transform: uppercase;
}

.button:hover,
.button:focus-visible {
  border-color: var(--text);
}

.button.subtle {
  border-color: var(--line);
  color: var(--muted);
}

.form-status {
  min-height: 1.3rem;
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
}

.form-status.error {
  color: var(--error);
}

.admin-photos {
  display: grid;
  grid-column: 1 / -1;
  gap: .6rem;
  margin-top: 2rem;
}

.admin-photo {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}

.admin-photo img {
  width: 4.5rem;
  height: 3.25rem;
  object-fit: cover;
}

.admin-photo strong {
  display: block;
  font-size: .85rem;
  font-weight: 400;
}

.admin-photo small {
  color: var(--muted);
  text-transform: capitalize;
}

.admin-photo-actions,
.admin-photo-edit-actions {
  display: flex;
  gap: .5rem;
}

.admin-photo-edit {
  grid-column: 1 / -1;
  width: 100%;
  margin: .75rem 0 1rem;
  padding: 1rem;
  background: var(--surface);
}

.admin-photo-edit textarea {
  min-height: 5rem;
}

.login-panel {
  width: min(24rem, 100%);
  margin: clamp(2rem, 12vh, 8rem) auto;
}

.login-panel h1 {
  margin-bottom: 2.5rem;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: 1rem;
  max-width: calc(100vw - 2rem);
  padding: .75rem 1rem;
  background: var(--text);
  color: #111;
  font-size: .75rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(.5rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 700px) {
  .site-header {
    min-height: 5rem;
  }

  .menu-button {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: .5rem var(--page-padding) 1.5rem;
    background: var(--background);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: .7rem 0;
  }

  main {
    padding-top: .5rem;
  }

  .gallery {
    columns: 1;
  }

  .photo-card-caption {
    opacity: 1;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 0;
  }

  .about-portrait,
  .about-placeholder {
    min-height: 55vh;
  }

  .about-copy {
    padding: 0;
  }

  .lightbox[open] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: stretch;
  }

  .lightbox-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .lightbox-caption {
    width: 100%;
    max-height: 28dvh;
    padding: 0 0 .25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-photo {
    grid-template-columns: 3.75rem minmax(0, 1fr);
  }

  .admin-photo img {
    width: 3.75rem;
    height: 3.75rem;
  }

  .admin-photo-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}
