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

:root {
  font-size: 15px;
}

body {
  margin: 0;
  --color-text: #000;
  --color-bg: #f7f5ee;
  --color-link: #000;
  --color-link-hover: #000;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: rustica, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overflow-y: scroll;
  line-height: 1;
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  font-weight: 600;
}

a:hover {
  color: var(--color-link-hover);
  outline: none;
}

/* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
a:focus {
  /* Provide a fallback style for browsers
	 that don't support :focus-visible */
  outline: none;
  background: lightgrey;
}

a:focus:not(:focus-visible) {
  /* Remove the focus indicator on mouse-focus for browsers
	 that do support :focus-visible */
  background: transparent;
}

a:focus-visible {
  /* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
  outline: 2px solid red;
  background: transparent;
}

.line {
  transform-origin: 0% 50%;
  padding-bottom: 0.35rem;
  white-space: nowrap;
  will-change: transform;
}

.oh {
  overflow: hidden;
}

.oh__inner {
  display: inline-block;
  transform-origin: 0% 50%;
  will-change: transform;
}

.frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.frame--fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  padding: 1rem;
  z-index: 1;
  display: grid;
  grid-template-columns: 38% 62%;
}

.frame__title {
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 2rem 0;
}

.frame__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.frame__links a {
  margin: 0 1rem 0.35rem 0;
}

.frame--fixed .frame__links {
  flex-direction: row;
}

.grid {
  display: grid;
  --grid-border-radius: 8px;
  grid-template-columns: repeat(2, 50%);
}

.grid--large {
  padding: 0.5vw;
  --grid-padding: 0.5vw;
}

.grid--large .grid__cell {
  aspect-ratio: 1/1;
}

.grid--mini {
  --grid-padding: 1px;

  width: 235px;
  max-height: 190px;
  margin-bottom: 3vh;
  display: none;
  position: absolute;
  overflow: auto;
  padding-right: 10px;
}

.grid--mini .grid__cell:not(.grid__cell--current):hover .grid__cell-img {
  opacity: 0.7;
}

.grid__cell--current .grid__cell-img {
  opacity: 0.3;
}

.grid__cell--padded {
  padding: calc(var(--grid-padding) * 2);
}

.grid__cell--padded {
  display: flex;
  align-items: flex-end;
}

.grid__cell-img {
  width: calc(100% - var(--grid-padding) * 2);
  height: calc(100% - var(--grid-padding) * 2);
  margin: var(--grid-padding);
  border-radius: var(--grid-border-radius);
  display: block;
  position: relative;
  overflow: hidden;
}

.grid__cell-img-inner {
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--grid-border-radius);
  width: 100%;
  height: 100%;
}

.content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 15vh 8vw 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.content__item {
  position: absolute;
  display: grid;
}

.content__item--current {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

.content__item-number {
  font-weight: 600;
  display: block;
}

.content__item-heading {
  font-size: 4vw;
  line-height: 1;
  margin: 1rem 0 3rem 0;
  font-weight: 600;
}

.content__item-text {
  max-width: 30ch;
  margin-bottom: 2rem;
  line-height: 1.3;
}

.content__item-link {
  cursor: pointer;
}

.slide-nav {
  position: fixed;
  width: 40%;
  right: 15%;
  top: auto;
  bottom: 10%;
  height: 100%;
  display: grid;
  align-content: flex-end;
  pointer-events: none;
}

.slide-nav__img {
  width: 100%;
  height: 10vh;
  position: relative;
  overflow: hidden;
  opacity: 0.3;
  cursor: not-allowed;
}

.slide-nav__main-img {
  width: 100%;
  object-fit: cover;
  aspect-ratio: 1/1;
  scale: 1.26;
  border-radius: 8px;
}

.content--open .slide-nav__img {
  pointer-events: auto;
}

.slide-nav__img--prev {
  border-radius: 0 0 1.5vw 1.5vw;
  display: none;
  z-index: -1;
}

.slide-nav__img--next {
  border-radius: 1.5vw 1.5vw 0 0;
  display: none;
  z-index: -1;
}

.slide-nav__img-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: 50% 50%;
}

.back {
  background: none;
  border: 0;
  padding: 0;
  margin: auto 0 1.5rem 0;
  stroke: #000;
  z-index: 1000;
  cursor: pointer;
  width: 50px;
}

.back svg {
  stroke-linecap: round;
}

.back:hover,
.back:focus {
  outline: none;
  stroke: #823725;
}

.content--open .back {
  pointer-events: auto;
}

@media screen and (min-width: 53em) {
  .content {
    width: 38%;
  }
  .grid {
    grid-template-columns: repeat(4, 25%);
  }
  .grid__cell--padded {
    padding: var(--grid-padding);
  }
  .grid__cell-c1-r1 {
    grid-column: 1;
    grid-row: 1;
  }
  .grid__cell-c3-r1 {
    grid-column: 3;
    grid-row: 1;
  }
  .grid__cell-c4-r1 {
    grid-column: 4;
    grid-row: 1;
  }
  .grid__cell-c1-r2 {
    grid-column: 1;
    grid-row: 2;
  }
  .grid__cell-c2-r2 {
    grid-column: 2;
    grid-row: 2;
  }
  .grid__cell-c3-r2 {
    grid-column: 3;
    grid-row: 2;
  }
  .grid__cell-c4-r2 {
    grid-column: 4;
    grid-row: 2;
  }
  .grid__cell-c2-r3 {
    grid-column: 2;
    grid-row: 3;
  }
  .grid__cell-c4-r3 {
    grid-column: 4;
    grid-row: 3;
  }
  .grid__cell-c1-r4 {
    grid-column: 1;
    grid-row: 4;
  }
  .grid__cell-c3-r4 {
    grid-column: 3;
    grid-row: 4;
  }
  .grid__cell-c3-r5 {
    grid-column: 3;
    grid-row: 5;
  }
  .grid--mini {
    display: grid;
    visibility: visible;
    position: relative;
  }
  .content--open .grid--mini {
    pointer-events: auto;
  }

  .slide-nav {
    align-content: space-between;
    top: 0;
    bottom: 0;
  }

  .slide-nav__img--prev,
  .slide-nav__img--next {
    display: block;
  }

  .slide-nav__main-img {
    border-radius: 18px;
  }
}

.grid--mini .grid__cell-img-inner {
  aspect-ratio: 2/1.4;
}

.grid--large .grid__cell-img,
.grid--large .grid__cell-img-inner {
  transition: scale 1.5s cubic-bezier(0, 0.55, 0.45, 1);
}

.grid--large .grid__cell-img:hover {
  scale: 0.9;
}
