@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Onest";
  src: url("/assets/fonts/onest-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Onest";
  src: url("/assets/fonts/onest-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0b0a;
  --paper: #e7e2d7;
  --muted: #a8a39a;
  --rule: #353431;
  --rule-strong: #716e66;
  --accent: #d35d40;
  --page-pad: clamp(20px, 3.2vw, 56px);
  --serif: "Newsreader", Georgia, serif;
  --sans: "Onest", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--rule-strong) var(--ink);
  scrollbar-width: thin;
}

body {
  margin: 0;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) {
  overflow: hidden;
}

::selection {
  color: var(--ink);
  background: var(--accent);
}

a {
  color: inherit;
  text-underline-offset: 0.26em;
  text-decoration-thickness: 1px;
}

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

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-160%);
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1);
}

.skip-link:focus {
  transform: translateY(0);
}

.masthead {
  padding: clamp(24px, 2vw, 48px) var(--page-pad) clamp(34px, 4.5vw, 72px);
  border-bottom: 1px solid var(--rule-strong);
}

.wordmark {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 24px;
  text-decoration: none;
}

.wordmark-main {
  display: block;
  font-family: var(--serif);
  font-size: clamp(5.2rem, 17.5vw, 18rem);
  font-weight: 360;
  line-height: .82;
  letter-spacing: -.04em;
}

.wordmark-ru {
  color: var(--accent);
  font-size: clamp(.78rem, 1.1vw, 1rem);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.manifest {
  max-width: 44ch;
  margin: clamp(18px, 1.2vw, 28px) 0 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.6vw, 2.5rem);
  font-weight: 360;
  /* impeccable-disable-next-line tight-leading -- intentional editorial display copy */
  line-height: 1.08;
  letter-spacing: -.025em;
}

.archive-nav {
  padding: 72px var(--page-pad) 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 8vw;
  border-bottom: 1px solid var(--rule-strong);
}

.archive-intro h1 {
  max-width: 10ch;
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 7.5vw, 7.6rem);
  font-weight: 360;
  line-height: .88;
  letter-spacing: -.035em;
}

.archive-intro p {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
}

.filters {
  align-self: end;
  border-top: 1px solid var(--rule-strong);
}

.filter {
  position: relative;
  width: 100%;
  padding: 16px 0 16px 16px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease-out;
}

.filter:hover,
.filter.is-active {
  color: var(--paper);
}

.filter.is-active::before {
  content: "";
  position: absolute;
  top: calc(50% - 3px);
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.filter span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.story {
  padding: clamp(74px, 10vw, 150px) var(--page-pad);
  border-bottom: 1px solid var(--rule-strong);
}

.story[hidden] {
  display: none;
}

.story-header {
  margin-bottom: clamp(28px, 4vw, 58px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.story-header h2 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.15rem, 7vw, 7rem);
  font-weight: 370;
  line-height: .9;
  letter-spacing: -.035em;
}

.coordinates {
  padding-left: 24px;
  display: grid;
  gap: 3px;
  border-left: 1px solid var(--accent);
  font-size: .94rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.coordinates span {
  color: var(--muted);
}

.photo-stage {
  margin: 0;
}

.open-photo {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  overflow: hidden;
  color: inherit;
  background: #070706;
  border: 0;
  cursor: zoom-in;
}

.open-photo img {
  width: 100%;
  height: auto;
  max-height: 88vh;
  display: block;
  object-fit: contain;
  background: #070706;
  transition: filter 260ms ease-out, transform 520ms cubic-bezier(.16, 1, .3, 1);
}

.open-photo:hover img {
  filter: brightness(1.04);
  transform: scale(1.004);
}

.photo-stage--portrait .open-photo img {
  width: min(72vw, 940px);
  margin: 0 auto;
}

.photo-stage figcaption {
  padding: 14px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: .9rem;
}

.variant-stage {
  position: relative;
}

.variant-controls {
  position: absolute;
  right: 18px;
  bottom: 52px;
  display: flex;
  align-items: stretch;
  color: var(--paper);
  background: rgba(11, 11, 10, .92);
  border: 1px solid rgba(231, 226, 215, .42);
}

.variant-controls p {
  min-width: 190px;
  margin: 0;
  padding: 10px 16px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: center;
}

.variant-controls small {
  color: var(--muted);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.variant-arrow {
  width: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: none;
  border: 0;
  cursor: pointer;
}

.variant-arrow + p,
.variant-controls p + .variant-arrow {
  border-left: 1px solid rgba(231, 226, 215, .3);
}

.variant-arrow:hover {
  color: var(--ink);
  background: var(--paper);
}

.variant-arrow svg,
.viewer-close svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.story-body {
  margin-top: clamp(38px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(60px, .25fr) minmax(0, 1.15fr) minmax(260px, .6fr);
  gap: clamp(28px, 5vw, 78px);
  align-items: start;
}

.record-no {
  margin: 0;
  color: var(--accent);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.story-copy {
  max-width: 68ch;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2vw, 1.82rem);
  font-weight: 350;
  line-height: 1.35;
  letter-spacing: -.012em;
}

.story-copy p {
  margin: 0 0 1em;
}

.story-copy p:last-child {
  margin-bottom: 0;
}

.story-copy--long:not(.is-expanded) .collapsible-text {
  position: relative;
  max-height: 12.2em;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
}

.expand-copy {
  margin-top: 20px;
  padding: 0 0 5px;
  color: var(--paper);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--accent);
  cursor: pointer;
}

.provenance {
  padding-top: 2px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: .98rem;
}

.provenance p {
  margin: 0 0 8px;
}

.provenance strong {
  color: var(--paper);
  font-weight: 500;
}

.provenance a {
  width: fit-content;
  color: var(--paper);
}

.site-footer {
  min-height: 52vh;
  padding: 80px var(--page-pad) 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .6fr);
  gap: 8vw;
  align-content: space-between;
}

.site-footer > p:first-child {
  max-width: 32ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  font-weight: 340;
  /* impeccable-disable-next-line tight-leading -- intentional editorial display copy */
  line-height: 1.02;
  letter-spacing: -.025em;
}

.site-footer > p:nth-child(2) {
  align-self: start;
  margin: 0;
  color: var(--muted);
}

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

.privacy-note {
  grid-column: 1 / -1;
  margin: 80px 0 0;
  padding-top: 16px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  font-size: .88rem;
}

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

.viewer::backdrop {
  background: rgba(0, 0, 0, .96);
}

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

.viewer-close {
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--rule-strong);
  cursor: pointer;
}

.viewer-close:hover {
  color: var(--ink);
  background: var(--paper);
}

.viewer-canvas {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
}

.viewer-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-meta {
  min-width: 0;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: .9rem;
}

.viewer-meta p {
  margin: 0;
}

.viewer-original {
  flex: 0 0 auto;
}

@media (max-width: 820px) {
  .wordmark {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wordmark-main {
    max-width: 100%;
    font-size: clamp(4.1rem, 19.5vw, 8.5rem);
  }

  .wordmark-ru {
    justify-self: end;
  }

  .archive-nav,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .filters {
    margin-top: 18px;
  }

  .story-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .story-header h2 {
    font-size: clamp(3.1rem, 15vw, 5.8rem);
  }

  .coordinates {
    width: fit-content;
    text-align: left;
  }

  .photo-stage--portrait .open-photo img {
    width: 100%;
  }

  .photo-stage figcaption {
    display: grid;
    gap: 2px;
    font-size: .84rem;
  }

  .story-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .record-no {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule);
  }

  .story-copy {
    font-size: clamp(1.24rem, 5vw, 1.55rem);
  }

  .provenance {
    padding-top: 24px;
    border-top: 1px solid var(--rule);
    font-size: .95rem;
  }

  .variant-controls {
    position: static;
    width: 100%;
    margin-top: 1px;
    justify-content: space-between;
    border-color: var(--rule-strong);
  }

  .variant-controls p {
    min-width: 0;
    flex: 1;
  }

  .variant-arrow {
    width: 58px;
  }

  .site-footer {
    min-height: 65vh;
  }

  .site-footer > p:nth-child(2) {
    margin-top: 28px;
  }

  .privacy-note {
    margin-top: 72px;
  }
}

@media (max-width: 520px) {
  .masthead {
    padding-top: 14px;
    padding-bottom: 32px;
  }

  .manifest {
    margin: 30px 0 0;
  }

  .archive-nav {
    padding-top: 56px;
  }

  .archive-intro h1 {
    font-size: clamp(3rem, 16vw, 4.2rem);
  }

  .story {
    padding-top: 74px;
    padding-bottom: 74px;
  }

  .open-photo img {
    max-height: 74vh;
  }

  .viewer {
    padding: 12px;
  }

  .viewer-meta {
    display: grid;
    gap: 8px;
  }
}

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

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