:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #0f0f0f;
  --line: #d8d8d8;
  --muted: #666;
  --sticky-header-h: 0px;
  --sticky-footer-h: 0px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.4;
  min-height: 100vh;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -10rem;
  background: #fff;
  border: 1px solid #000;
  padding: 0.5rem;
  z-index: 9999;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header,
.site-main,
.site-footer {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.site-main {
  min-height: calc(100vh - var(--sticky-header-h) - var(--sticky-footer-h));
  padding: 1rem 0;
}

.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.thumb-button {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  cursor: pointer;
  background: transparent;
}

.thumb-button img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #f0f0f0;
}

.thumb-static img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #f0f0f0;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding: 0.8rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--bg);
}

.viewer {
  position: fixed;
  inset: var(--sticky-header-h) 0 var(--sticky-footer-h) 0;
  z-index: 1000;
}

.viewer.is-hidden {
  display: none;
}

.viewer--bg-black {
  background: #000;
  color: #fff;
}

.viewer--bg-white {
  background: #fff;
  color: #111;
}

.viewer-inner {
  position: relative;
  height: 100%;
}

.viewer-figure {
  margin: 0;
  height: 100%;
  display: grid;
  place-items: center;
}

.viewer-figure img {
  max-width: min(96vw, 1400px);
  max-height: calc(100vh - var(--sticky-header-h) - var(--sticky-footer-h) - 1.6rem);
  width: auto;
  height: auto;
}

.viewer-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.viewer-zone--prev {
  left: 0;
}

.viewer-zone--next {
  right: 0;
}

.viewer-hint {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  border: 1px solid currentColor;
  background: rgba(24, 24, 24, 0.78);
  color: #fff;
  z-index: 3;
}

.viewer-hint.is-hidden {
  display: none;
}

.orientation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.88);
}

.orientation-overlay p {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  padding: 0.7rem 0.9rem;
}

.orientation-overlay.is-hidden {
  display: none;
}

.orientation-overlay--notice {
  inset: auto 0 0 0;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.85);
  place-items: stretch;
}

.orientation-overlay--notice p {
  font-size: 0.8rem;
  border: 0;
  padding: 0.2rem 0;
}

.contact-main {
  max-width: 760px;
}

.contact-form {
  display: grid;
  gap: 0.65rem;
}

.contact-form label {
  font-weight: 500;
}

.contact-form input,
.contact-form textarea,
.contact-form select,
.contact-form button {
  font: inherit;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  border: 1px solid var(--line);
  padding: 0.6rem 0.65rem;
  background: transparent;
  color: inherit;
}

.contact-form button {
  width: fit-content;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.submit-button {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  border-radius: 0.25rem;
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .site-main {
    min-height: calc(100vh - var(--sticky-header-h) - var(--sticky-footer-h));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
