:root {
  --color-main: black;
  --color-background: white;
  --color-overlay: #8f9cb1;
  --color-highlight: rgba(255, 255, 0, 0.15);
  --transition: 0.8s;
  --img-text-margin: 24px;
  --sans-font-families: Helvetica, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
    sans-serif;
  --serif-font-families: "Times New Roman", Times, serif;
}

.color-cover {
  width: 100%;
  height: 150%;
  position: fixed;
  background-color: var(--color-overlay);
  z-index: 10;
  mix-blend-mode: screen;
  pointer-events: none;
}

::selection {
  background: var(--color-highlight);
}

html {
  border: 0;
  background-color: var(--color-background); /* color outside viewport */
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-background);
  border: 0;
  font-family: var(--sans-font-families);
  font-size: 16px;
  font-weight: bold;
  color: var(--color-main);
  width: 100%;

  /* TODO: handle mobile overflow scroll when items are hovered & scaled */
  overflow-x: hidden; /* ignored on body/html ... */
}

main {
  width: 100%;
}

h1 {
  font-family: var(--sans-font-families);
  font-size: 12.5vw;
  line-height: 0.8;
  font-weight: bold;
  letter-spacing: -0.05em;

  text-transform: uppercase;
  text-align: center;
}

h2 {
  font-family: var(--serif-font-families);
  font-size: 120px;
  line-height: 0.8;
  font-weight: 400;
  letter-spacing: -0.03em;
}

h3 {
  font-family: var(--serif-font-families);
  font-size: 32px;
  line-height: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
h4 {
  font-family: var(--serif-font-families);
  font-size: 19px;
  line-height: 22px;
  font-weight: 400;
  text-transform: uppercase;
}
h5 {
  font-family: var(--sans-font-families);
  font-size: 16px;
  line-height: 1;
  font-weight: bold;
  text-transform: uppercase;
}

.reading-section p {
  font-family: var(--serif-font-families);
  font-size: 28px;
  line-height: 36px;
  font-weight: 400;
}

p {
}

a {
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  position: sticky;
  top: 0px;
  z-index: 3;
}
button,
nav a,
.btn-info,
.header-btns a,
.pill {
  background-color: var(--color-main);
  color: var(--color-background);
  padding: 14px 24px;
  text-transform: uppercase;
  border-radius: 24px;

  font-size: 16px;
  line-height: 16px;
  font-weight: bold;
  border: none;
}
nav a:first-child {
  border-radius: 0px;
}

.smallcaps {
  font-variant: small-caps;
  font-size: 19px;
  line-height: 22px;
}
.number {
  height: 24px;
  width: 24px;
  border-radius: 20px;
  padding: 2px 5px 0px 4px;

  background-color: var(--color-main);
  color: var(--color-background);

  font-family: Helvetica, sans-serif;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  line-height: 20px;
  letter-spacing: -0.05em;
}

/* HEADER */
header {
  margin-bottom: 96px;
  padding-top: 4px;
}

.header-btns {
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  padding: 0px 4px;
  position: absolute;
  width: 100%;
}
.header-info {
  text-transform: uppercase;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: -54px;
  padding: 0px 4px;
}
.header-info p {
  width: 23vw;
  max-width: 328px;
}
.header-info-left {
  text-align: right;
}
.subheadline {
  text-transform: uppercase;
  text-align: center;
  margin-top: 16px;
}
.btn-info {
  cursor: help;
}
.info-modal {
  visibility: hidden;
  position: absolute;
  z-index: 5;
  background-color: var(--color-main);
  color: var(--color-background);
  max-width: 450px;
  width: 80vw;
  padding: 32px;
  border-radius: 20px;
  margin-top: 4px;
  text-indent: 24px;

  overflow: hidden;
  transition: 0.1s;
}
.info-modal p {
  text-justify: inter-word;
}
.info-container:hover .info-modal,
.info-container:focus .info-modal {
  visibility: visible;
}
/* END HEADER */

/* EQUIPMENT */
.equipment-title {
  display: flex;
  justify-content: space-between;
  padding: 8px;
}

.equipment {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 56px;
  row-gap: 0px;
  margin: 0px 8px;
}

.item {
  height: 24vw;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;

  /* TODO: fix blurry svg when scaled in safari */
  /* transform: translate3d(0, 0, 0); safari: non-blurry scale() */
}

@keyframes growFadeIn {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

.item .number {
  align-self: flex-end;
  position: absolute;
  top: 0px;
  right: 0px;
}

.item img,
.item svg {
  image-rendering: crisp-edges;
  max-width: 50%;
  max-height: 50%;
  animation-name: growFadeIn;
  animation-duration: 1s;
  transition-duration: 1s;
  filter: invert(1);
  mix-blend-mode: difference;
  pointer-events: none;
}
.item:hover img,
.item:active img {
  transform: scale(10);
  z-index: 5;
  pointer-events: none;
}

@keyframes tooltip {
  from {
    top: 0%;
    left: 95%;
    transform: scale(0);
  }
  to {
    top: 45%;
    left: calc(50% - 100px);
    transform: scale(1);
  }
}

.item-hover {
  display: none;
  position: absolute;
  z-index: 2;
  max-width: 200px;
  padding: 12px 12px;
  overflow: hidden;
  color: var(--color-background);
  mix-blend-mode: difference;
  text-align: center;

  animation-fill-mode: forwards;
  animation-duration: 0.3s;
}

.item:hover .item-hover,
.item:active .item-hover {
  display: block;
  animation-name: tooltip;
}

/* END EQUIPMENT */

/* READING */

.chapter {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.reading-heading-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-left: 24px;
  padding-right: 24px;
  margin-top: 400px;
  margin-bottom: 48px;
}
.reading-heading {
  max-width: 1700px;
  width: 100%;
}

.line {
  width: 100%;
  height: 1px;
  background-color: var(--color-main);
}

.reading-section {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  column-gap: 56px;
  row-gap: 400px;
  margin-top: 120px;
  margin-left: 24px;
  margin-right: 24px;
  max-width: 1700px;
}
.reading-section .pill {
  justify-self: start;
}
.align-self-center {
  align-self: center;
}
.left {
  grid-column: 1 / 3;
}

.center {
  grid-column: 4 / 6;
}

.right {
  grid-column: 7 / 9;
}
.span-two-rows {
  grid-row: span 2;
}

.preface-comments p {
  font-family: var(--sans-font-families);
  font-size: 18px;
  line-height: 24px;
  font-weight: bold;
  color: var(--color-main);
}

.reading-smallcaps {
  margin-bottom: 22px;
}

.preface-comments {
  grid-column: 1 / 3;
  padding-top: 53px;
  padding-bottom: 3px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;

  font-size: 18px;
  line-height: 24px;
}

.preface-comments p:first-child {
  position: sticky;
  top: 64px;
  margin-bottom: 120px;
}

.preface-reading {
  grid-column: 3 / 7;
  grid-row: 1 / 1;
}
.preface-img-cutout {
  grid-row: 1 / 1;
  float: right;
  top: 64px;
  margin-top: 8px;
  margin-right: -20vw;
  margin-bottom: 16px;
  margin-left: 24px;
  shape-outside: inset(0px 0px 0px 0px);

  filter: invert(1);
  mix-blend-mode: difference;
  width: 32%;
  max-width: 350px;

  image-rendering: pixelated;
}

.highlight {
  background-color: var(--color-highlight);
}
li {
  padding-left: 13px;
  text-indent: -13px;
}

.reading-images {
  grid-area: images;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  height: 100%;
  box-sizing: border-box;
  padding-top: 50px;
}

.reading-images img {
  width: 100%;

  transform-origin: 100% 0%;
  transition: var(--transition);
  filter: blur(0px);
}

.reading-images img:hover {
  transform: scale(1);
  filter: blur(0px);
}

.gesture {
  width: 100%;
  min-width: 100px;
  image-rendering: pixelated;
  mix-blend-mode: difference;
  filter: invert(1) invert(1);
  filter: invert(1);
  transition: 0.3s;
  top: 44px;
}
.sticky {
  position: sticky;
}
.gesture:hover {
  /* transform: scale(1.5); */
}

.reading-section .number {
  display: inline-block;
  cursor: help;
  height: 24px;
  width: 24px;
  padding-top: 2px;
  transform: translateY(-3px);
}
.inline-svg {
  position: absolute;
  margin-top: 10px; /* half of number dot */
  width: 0px;

  pointer-events: none;
  transition: var(--transition);
  filter: blur(6px);
}
.reading-section .number:hover .inline-svg {
  width: 300px;
  margin-left: -100px;
  filter: blur(0px);
}

.img-text-margin {
  margin-top: var(--img-text-margin);
}

.flex-col-between {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.img-ng-a {
  grid-column: 3 / 6;
  width: 100%;
}
.sk-img-a {
  grid-column: 4 / 7;
  width: 100%;
}
.sk-img-d {
  grid-column: 3 / 6;
  width: 100%;
}
.js-img-a {
  grid-column: 3 / 7;
}
.yk-img-a {
  grid-column: 1 / 4;
}

.end {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.end a {
  color: var(--color-background);
  text-decoration: underline;
}

/* END OF READING */
.table-items {
  width: 100%;
  margin-top: 200px;
  /* height: 7.5vw; */
  margin-bottom: -2.5vw;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.table-items img {
  position: sticky;
  top: 40vh;
}
.end-table {
  width: 100%;
  padding: 0px 24px;
}
.table {
  width: 100%;
}
.bread {
  width: 20%;
}
.jam {
  width: 6%;
}
.hummus {
  width: 9%;
}
.tomato {
  width: 6%;
}
.cup {
  width: 5%;
}
.chocolate {
  width: 6%;
}
.salt {
  width: 7%;
}
.cucumber {
  width: 10%;
}

/* FOOTER */

footer {
  padding: 8px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  height: 100vh;
  background-color: var(--color-main);
  color: var(--color-background);
}
footer a {
  text-decoration: underline;
  color: var(--color-background);
}

.bottom-line {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.bottom-line p {
  width: 50%;
}
.bottom-line p:nth-child(2) {
  text-align: right;
}

/* MOBILE */

@media only screen and (max-width: 700px) {
  h1 {
    font-size: 15vw;
  }
  h2 {
    font-size: 60px;
    line-height: 0.8;
    font-weight: 400;
    letter-spacing: -0.03em;
  }
  .equipment {
    margin-left: 0px;
  }

  .reading-section p {
    font-size: 20px;
    line-height: 24px;
  }
  .preface-comments p {
    font-size: 14px;
    line-height: 16px;
  }
  .preface-comments p:first-child {
    top: 96px;
    margin-bottom: 240px;
  }
  li {
    font-size: 14px;
    line-height: 16px;
  }

  header h1 {
    margin-top: 56px;
  }
  .header-info {
    margin-top: 8px;
  }
  .header-info p {
    width: 40vw;
    max-width: 328px;
  }

  button,
  nav a,
  .btn-info,
  .header-btns a {
    padding: 12px 20px;
    border-radius: 24px;

    font-size: 14px;
    line-height: 16px;
    font-weight: bold;
    border: none;
  }

  .equipment {
    grid-template-columns: repeat(4, 1fr);
    column-gap: 0px;
  }

  .preface-reading {
    grid-column: 3 / 9;
  }
  .preface-img-cutout {
    width: 40%;
    margin-left: 16px;
    margin-bottom: 12px;

    top: 64px;
    margin-top: 8px;
    margin-right: 0px;
    image-rendering: pixelated;
  }

  .reading-heading-wrapper {
    margin-top: 160px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .reading-section {
    grid-template-columns: repeat(8, 1fr);
    column-gap: 16px;
    row-gap: 80px;
    margin-top: 40px;
    margin-left: 16px;
    margin-right: 16px;
  }
  .left {
    grid-column: 1 / 5;
  }

  .center {
    grid-column: 1 / 5;
  }

  .right {
    grid-column: 5 / 9;
  }

  .gesture {
    top: 80px; /* for sticky */
  }
}
