:root {
  --mist: #e4e8e5;
  --card: #f6f8f6;
  --graphite: #1f2523;
  --slate: #56605b;
  --moss: #3f6b52;
  --moss-pale: #cfdcd2;
  --night: #121614;
  --serif: "Constantia", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Corbel", "Candara", "Optima", "Gill Sans", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--mist);
  color: var(--graphite);
  font: 18px/1.55 var(--sans);
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

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

a {
  color: var(--moss);
}

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

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.015em;
}

h2 {
  font-size: 1.9rem;
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0 0 1em;
}

.jump {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--graphite);
  color: var(--card);
  padding: 8px 14px;
}

.jump:focus {
  left: 10px;
  z-index: 20;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-right: 1px solid #c9d0cb;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--graphite);
  text-decoration: none;
  font: 400 1.7rem/1 var(--serif);
}

.brand img {
  width: 44px;
  height: 44px;
}

.brand:hover {
  color: var(--moss);
}

.rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.rail nav a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--slate);
  text-decoration: none;
}

.rail nav a:hover {
  color: var(--graphite);
  border-left-color: #a9b5ae;
}

.rail nav a[aria-current="page"] {
  color: var(--graphite);
  border-left-color: var(--moss);
}

.rail-note {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--slate);
}

.page {
  padding: 56px clamp(20px, 5vw, 72px) 40px;
  max-width: 1320px;
  width: 100%;
}

.intro {
  max-width: 44rem;
  margin-bottom: 56px;
}

.intro p {
  font-size: 1.15rem;
  color: var(--slate);
}

.albums {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 24px;
}

.album-card {
  grid-column: span 3;
  color: var(--graphite);
  text-decoration: none;
}

.album-card:first-child {
  grid-column: span 4;
  grid-row: span 2;
}

.album-card:nth-child(2) {
  grid-column: span 2;
}

.album-card:nth-child(3) {
  grid-column: span 2;
}

.album-card:nth-child(4) {
  grid-column: span 6;
}

.album-card:nth-child(4) .cover {
  aspect-ratio: 3 / 1;
}

.cover {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #cfd5d1;
  border-radius: 3px;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.album-card:hover .cover img {
  transform: scale(1.03);
}

.album-card h2 {
  font-size: 1.5rem;
  margin: 14px 0 2px;
}

.album-card:first-child h2 {
  font-size: 2.1rem;
}

.album-card p {
  margin: 0;
  color: var(--slate);
  font-size: 0.98rem;
}

.album-card:hover h2 {
  color: var(--moss);
}

.album-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: end;
  margin-bottom: 40px;
}

.album-head p {
  max-width: 40rem;
  color: var(--slate);
}

.back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--slate);
  text-decoration: none;
}

.back:hover {
  color: var(--moss);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
  font-size: 0.98rem;
}

.meta strong {
  font-weight: 700;
}

.album-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  min-width: 250px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid var(--graphite);
  border-radius: 999px;
  background: var(--graphite);
  color: var(--card);
  font: 700 1rem var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--card);
}

.btn.line {
  background: transparent;
  color: var(--graphite);
}

.btn.line:hover {
  background: var(--card);
  color: var(--moss);
}

.btn small {
  font-weight: 400;
  opacity: 0.75;
}

.photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.photos li:nth-child(6n + 1) {
  grid-column: span 2;
  grid-row: span 2;
}

.photos a {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 2px;
  background: #cfd5d1;
}

.photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}

.photos a:hover img {
  opacity: 0.88;
}

.album-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #c9d0cb;
  color: var(--slate);
}

.text-page {
  max-width: 40rem;
}

.text-page h2 {
  margin-top: 1.6em;
}

.steps {
  padding-left: 1.3em;
}

.steps li {
  margin-bottom: 0.7em;
  padding-left: 0.3em;
}

.foot {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid #c9d0cb;
  font-size: 0.92rem;
  color: var(--slate);
}

.missing {
  max-width: 34rem;
  padding-top: 8vh;
}

.missing .cover {
  margin-bottom: 32px;
  max-width: 420px;
}

.viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--night);
  color: #e3e8e5;
}

.viewer::backdrop {
  background: var(--night);
}

.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
}

.viewer-bar span {
  font-variant-numeric: tabular-nums;
  color: #a9b5ae;
}

.viewer-tools {
  display: flex;
  gap: 8px;
}

.viewer button,
.viewer-tools a {
  background: transparent;
  border: 1px solid #3a443f;
  color: #e3e8e5;
  border-radius: 999px;
  padding: 7px 16px;
  font: 400 0.95rem var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.viewer button:hover,
.viewer-tools a:hover {
  border-color: #e3e8e5;
}

.viewer-stage {
  position: relative;
  min-height: 0;
}

.viewer-stage img {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 64px;
  right: 64px;
  width: calc(100% - 128px);
  height: 100%;
  max-width: none;
  object-fit: contain;
  transition: opacity 0.35s ease;
}

.viewer-stage img.loading {
  opacity: 0.15;
}

.viewer .step {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
}

.viewer .step.prev {
  left: 10px;
}

.viewer .step.next {
  right: 10px;
}

.viewer-caption {
  padding: 14px 18px 20px;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.progress {
  height: 2px;
  background: #2a322e;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--moss-pale);
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 18px 16px;
    border-right: 0;
    border-bottom: 1px solid #c9d0cb;
  }

  .brand {
    flex-direction: row;
    align-items: center;
    font-size: 1.4rem;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .rail ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
  }

  .rail nav a {
    padding: 4px 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .rail nav a[aria-current="page"] {
    border-bottom-color: var(--moss);
  }

  .rail-note {
    display: none;
  }

  .page {
    padding: 32px 16px 32px;
  }

  .album-head {
    grid-template-columns: 1fr;
  }

  .album-actions {
    min-width: 0;
  }

  .photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

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

  .album-card,
  .album-card:first-child,
  .album-card:nth-child(2),
  .album-card:nth-child(3),
  .album-card:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
  }

  .album-card:nth-child(4) .cover {
    aspect-ratio: 3 / 2;
  }

  .viewer-stage img {
    left: 0;
    right: 0;
    width: 100%;
  }

  .viewer .step {
    top: auto;
    bottom: 8px;
    transform: none;
    background: rgba(18, 22, 20, 0.7);
  }

  .viewer-tools a {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover img,
  .viewer-stage img {
    transition: none;
  }
}
