:root {
  color-scheme: light;
  --ink: #000;
  --muted: #686868;
  --line: #d9d9d9;
  --side: 160px;
  --gap: 20px;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { background: #fff; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 700 14px/1.42 Arial, Helvetica, sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover,
a:focus-visible { color: var(--muted); }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
button { color: inherit; font: inherit; }

/*
 * This is the same header geometry used by kynantait.com and the video site:
 * 1007px wide, 10px from the top, with five evenly spaced network links.
 */
.site-header {
  width: min(100%, 1007px);
  min-height: 22px;
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(36px, 7vw, 100px);
  line-height: 1.35;
}

.site-brand { white-space: nowrap; }

.site-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  text-align: center;
}

.site-nav [aria-current="page"] { color: var(--muted); }

.menu-toggle { display: none; }

.site-layout {
  width: calc(100% - 32px);
  min-height: calc(100vh - 56px);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  align-items: start;
  gap: var(--gap);
}

.collection-nav {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0 4px 34px 0;
  scrollbar-width: thin;
  scrollbar-color: #888 transparent;
}

.collection-group { margin: 0 0 19px; }
.collection-group h2 { margin: 0 0 2px; font: inherit; }
.collection-group ul { margin: 0; padding: 0; list-style: none; }
.collection-group a {
  display: inline-block;
  max-width: 100%;
  padding: 1px 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.42;
}
.collection-group a[aria-current="page"] {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

main { min-width: 0; }

.home-stage {
  min-height: calc(100vh - 56px);
  display: grid;
  align-items: start;
  justify-items: start;
  padding: 8px 0 28px;
}

.home-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 92px);
  object-fit: contain;
}

.not-found {
  display: grid;
  min-height: calc(100vh - 70px);
  place-content: center;
  gap: 10px;
  text-align: center;
}
.not-found p { margin: 0; }
.not-found a { color: var(--muted); }

.gallery-view {
  height: calc(100vh - 56px);
  min-height: 520px;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 34px;
}

.gallery-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.gallery-heading h1,
.gallery-heading p { margin: 0; font: inherit; }
.gallery-heading h1 { font-weight: 400; }
.gallery-heading .eyebrow { color: var(--muted); }
.gallery-status { color: var(--muted); font-weight: 400; }

.gallery-track {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: clamp(28px, 4vw, 68px);
  overflow: auto hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #aaa transparent;
  padding: 0 0 14px;
}

.photo {
  flex: 0 0 auto;
  height: 100%;
  max-width: none;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: start;
  scroll-snap-align: start;
  margin: 0;
}

.photo-open {
  height: 100%;
  min-height: 0;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  display: block;
}

.photo img {
  display: block;
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: top left;
}

.photo figcaption {
  max-width: 70ch;
  min-height: 22px;
  padding-top: 7px;
  font-weight: 400;
  text-transform: none;
}

.gallery-controls {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 7px;
}

.gallery-controls button {
  width: 44px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
}
.gallery-controls button:hover { color: var(--muted); }

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 28px;
  border: 0;
  background: rgba(255,255,255,.98);
}
.lightbox::backdrop { background: rgba(255,255,255,.98); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; place-items: center; }
.lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 82px); object-fit: contain; }
.lightbox p { min-height: 20px; margin: 10px 0 0; font-weight: 400; }
.lightbox-close {
  position: fixed;
  z-index: 2;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
}

@media (min-width: 761px) {
  .home-page .home-stage {
    height: calc(100vh - 56px);
    min-height: 0;
    display: block;
    padding: 0 0 14px;
  }

  .home-page .home-stage img {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    object-position: top left;
  }

  .gallery-page .gallery-view {
    position: relative;
    display: block;
    height: calc(100vh - 56px);
  }

  .gallery-page .gallery-heading {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    padding: 0 0 4px 8px;
    background: #fff;
  }

  .gallery-page .gallery-heading > div:first-child {
    display: none;
  }

  .gallery-page .gallery-track {
    height: 100%;
    gap: 5px;
    padding: 0 0 14px;
  }

  .gallery-page .gallery-controls {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    padding: 0;
    background: #fff;
  }
}

@media (max-width: 760px) {
  .site-header {
    width: 100%;
    min-height: 0;
    margin: 0;
    display: block;
    padding: 12px 16px 0;
  }

  .site-brand {
    display: inline-block;
    margin-bottom: 12px;
  }

  .site-nav {
    width: 100%;
    font-size: 12px;
  }

  .site-nav a {
    min-height: 44px;
    display: grid;
    place-items: center;
  }

  .menu-toggle {
    display: block;
    width: calc(100% - 32px);
    min-height: 44px;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
    text-align: left;
  }

  .site-layout {
    width: 100%;
    min-height: 0;
    margin: 0;
    display: block;
  }

  .collection-nav {
    position: fixed;
    z-index: 18;
    inset: 113px 0 0;
    max-height: none;
    padding: 22px 16px 40px;
    background: #fff;
    transform: translateX(-102%);
    transition: transform .22s ease;
  }
  .collection-nav.is-open { transform: translateX(0); }
  .collection-group { margin-bottom: 22px; }
  .collection-group a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  .home-stage {
    min-height: calc(100svh - 113px);
    padding: 20px 16px 28px;
  }
  .home-stage img { width: 100%; max-height: calc(100svh - 160px); }

  .gallery-view {
    height: auto;
    min-height: 0;
    display: block;
    padding: 24px 16px 40px;
  }

  .gallery-heading { margin-bottom: 26px; }

  .gallery-track {
    display: grid;
    gap: 44px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  .photo { display: block; width: 100%; max-width: none; height: auto; }
  .photo-open { display: block; width: 100%; height: auto; }
  .photo img { width: 100%; height: auto; object-fit: contain; }
  .photo figcaption { min-height: 0; padding-top: 8px; }
  .gallery-controls { display: none; }

  .lightbox { padding: 46px 12px 20px; }
}

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