@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap');

/* @font-face { */
  /* font-family: 'Liberation Serif'; */
  /* font-weight: normal; */
  /* src: url('/assets/fonts/LiberationSerif-Regular.ttf') format('truetype'); */
/* } */

/* @font-face { */
  /* font-family: 'Liberation Serif'; */
  /* font-weight: bold; */
  /* src: url('/assets/fonts/LiberationSerif-Bold.ttf') format('truetype'); */
/* } */

/* @font-face { */
  /* font-family: 'Liberation Serif'; */
  /* font-weight: normal; */
  /* font-style: italic; */
  /* src: url('/assets/fonts/LiberationSerif-Italic.ttf') format('truetype'); */
/* } */

/* @font-face { */
  /* font-family: 'Liberation Serif'; */
  /* font-weight: bold; */
  /* font-style: italic; */
  /* src: url('/assets/fonts/LiberationSerif-BoldItalic.ttf') format('truetype'); */
/* } */

@font-face {
  font-family: 'Sentient';
  font-style: normal;
  src: url('/assets/fonts/Sentient-Variable.ttf') format('truetype');
}

@font-face {
  font-family: 'Sentient';
  font-style: italic;
  src: url('/assets/fonts/Sentient-VariableItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/InterVariable.ttf') format('truetype');
}

@font-face {
  font-family: 'Inconsolata';
  src: url('/assets/fonts/Inconsolata-Variable.ttf') format('truetype');
}

:root {
  --ft-sans: 'Inter', sans-serif;
  /* --ft-serif: 'Liberation Serif', serif; */
  --ft-serif: 'Noto Serif', serif;
  --ft-mono: 'Inconsolata', monospace;

  --full-width: 600px;

  --fg-mark: #f2cf8a;
  --fg-select: #aaaaaa;
  --fg-subtle: #313131;

  --bg-subtle: #eaeaea;
}

::selection {
  background-color: var(--fg-select);
}

* {
  box-sizing: border-box;
  /* line-height: 1.4em; */
  line-height: 1.5em;
}

body {
  font-family: var(--ft-serif);
  font-size: 14px;
  margin: 2rem;

  main {
    display: flex;
    gap: 0px 2rem;
    align-items: flex-start;
    margin: 10rem auto;
    max-width: calc(var(--full-width) + 2rem + 350px);

    aside#index {
      width: 100%;
      max-width: 350px;
      border-right: 1px solid var(--bg-subtle);
      padding: 0px 1rem;

      @media (max-width: 765px) {
        display: none;
      }

      ul {
        padding: 0px;

        li {
          /* list-style-type: none; */
          cursor: pointer;
          font-size: 0.9rem;

          &.index-H1 {
            margin-left: 0rem;
          }

          &.index-H2 {
            margin-left: 1rem;
          }

          &.index-H3 {
            margin-left: 2rem;
          }

          &.index-H4 {
            margin-left: 3rem;
          }

          &.index-H5 {
            margin-left: 4rem;
          }

          &.index-H6 {
            margin-left: 5rem;
          }
        }
      }
    }

    article {
      max-width: var(--full-width);
      width: var(--full-width);
    }
    
    h1 {
      /* font-family: var(--ft-sans); */
      font-size: 3rem;
      font-weight: 700;
      margin-top: 0rem;
      margin-bottom: 5rem;
      text-align: center;
    }

    h2 {
      /* font-family: var(--ft-sans); */
      font-weight: 700;
      margin-top: 2rem;
      padding-top: 2rem;
      padding-bottom: 1rem;
      margin-bottom: 0px;

      @media (max-width: 765px) {
        position: sticky;
        top: 0px;
        display: block;
        background-color: white;
      }
    }

    h3 {
      /* font-family: var(--ft-sans); */
    }

    h4 {
      /* font-family: var(--ft-sans); */

      @media (max-width: 765px) {
        position: sticky;
        top: calc(84px - 1rem);
        display: flex;
        align-items: center;
        background-color: white;
        padding-bottom: 1rem;
        margin-top: 0px;
        margin-bottom: -1rem;
        padding-top: 1rem;
        min-height: calc(4rem + 1rem + 1rem);
      }
    }

    h5 {
      /* font-family: var(--ft-sans); */
    }

    h6 {
      /* font-family: var(--ft-sans); */
    }

    .anchor {
      display: none;
    }

    .copy {
      display: none;
    }

    h1:hover,
    h2:hover,
    h3:hover,
    h4:hover,
    h5:hover,
    h6:hover {

      .anchor {
        display: inline-block;
        margin-left: 0.5rem;
        color: var(--fg-subtle);
        font-weight: normal;
        text-decoration: underline;
        cursor: pointer;
      }

      .copy {
        display: inline-block;
        margin-left: 0.5rem;
        color: var(--fg-subtle);
        font-weight: normal;
        text-decoration: underline;
        cursor: pointer;
      }
    
    }

    p {
      margin-top: 1.75rem;
      margin-bottom: 1.75rem;
    }

    ul {
      margin-top: 1.75rem;
      margin-bottom: 1.75rem;
    }

    sup {
      font-size: 0.7rem;
      background-color: var(--bg-subtle);
      display: inline-block;
      padding: 0rem 0.2rem;
    }

    blockquote {
      margin: 0px;
      margin-bottom: 2rem;
      font-size: 0.9rem;
      color: var(--fg-subtle);
      background-color: var(--bg-subtle);
      padding: 0.2rem 1rem;

      ol {
        padding-left: 1rem;

        li {
          font-size: 0.9rem;
          color: var(--fg-subtle);
          margin-top: 0.25rem;
        }
      }
    }

    figure {
      margin: 0px;
      margin-top: 0.75rem;
      margin-bottom: 0.75rem;

      img {
        margin: 0px !important;
      }

      figcaption {
        text-align: center;
        font-size: 0.9rem;
        color: var(--fg-subtle);
        margin-top: 0.5rem;
      }
    }

    img {
      margin-top: 0.75rem;
      margin-bottom: 0.75rem;
      max-width: 100%;
      border: 1px solid #999999;

      &.logo {
        user-select: none;
        pointer-events: none;
        border: none;
        margin: 0 auto;
        display: block;
        width: 200px;
        margin-top: -2.5rem;
      }
    }

    .info {
      text-align: center;
      text-transform: uppercase;
      text-decoration: underline;
    }

    .disclaimer {
      font-size: 14px;
    }

    .license {
      margin-top: 2rem;
      font-size: 14px;
      text-align: center;
    }
  }

  strong {
    font-weight: inherit;
    background-color: var(--fg-mark);
  }

  em > strong {
    background-color: initial;
    display: block;
    font-size: 1.2rem;
    text-align: center;
  }

  blockquote {
    /* font-family: var(--ft-sans); */
    font-size: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
}

/* BOOKS */

pre.txt {
  font-family: var(--ft-serif);
  white-space: pre-wrap;

  p {
    margin: 0px;
  }

  code {
    font-family: var(--ft-serif);
    white-space: pre-line;
  }
}

/* ////////// ART ////////// */

:root {
  --ft-serif: Sentient, serif;
}

* {
  cursor: url(/files/cursor-default.png), default;
}

body {
  font-family: var(--ft-sans) !important;
  background: url(/files/tile.png);
  background-position: 50px 50px;
}

main {
  --full-width: 1200px;
  max-width: var(--full-width) !important;
}

aside {
  display: none !important;
}

h1 {
  font-size: 10rem !important;
  font-weight: 800 !important;
  user-select: none !important;
  text-align: left !important;
  margin-bottom: 0rem !important;

  @media (max-width: 765px) {
    line-height: 80%;
    margin-bottom: 3rem !important;
  }
}

h2 {
  font-size: 2rem !important;
  font-weight: 500 !important;
  user-select: none !important;
  text-align: left !important;
  color: #666 !important;
  margin-top: -2rem !important;
  margin-bottom: 0rem !important;

  @media (max-width: 765px) {
    position: initial !important;
    background-color: unset !important;
    font-size: 1.8rem !important;
  }

  &:hover > a {
    display: none !important;
  }
}

.controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 6rem;
  margin-bottom: -6rem;

  button {
    width: 5rem;
    height: 2.6rem;
    cursor: url(/files/cursor-pointer.png), pointer !important;
    border: 4px solid #000;
    border-radius: 6px;
    position: relative;
    background-color: transparent;
    overflow: hidden;
    font-size: 1.2rem;

    @media (max-width: 765px) {
      display: none;
    }

    &:focus {
      outline: 8px solid #0003;
    }

    &::before {
      content: '';
      width: 1.2rem;
      height: 1.2rem;
      display: grid;
      place-content: center;
      position: absolute;
      top: 50%;
      left: 0.2rem;
      transform: translateY(-50%);
      background-color: #ccc;
      border: 4px solid #ccc;
      border-radius: 3px;
      transition: width 100ms ease;
    }

    &::after {
      content: '';
      width: 1.2rem;
      height: 1.2rem;
      display: grid;
      place-content: center;
      position: absolute;
      top: 50%;
      left: 0.2rem;
      transform: translateY(-50%);
      background-color: #666;
      border: 4px solid #666;
      border-radius: 3px;
      transition: left 100ms ease;
    }

    &.active {

      &::before {
        width: 3.6rem;
      }

      &::after {
        left: 2.6rem;
      }
    }

    &:hover {

      &::after {
        background-color: #000;
        border-color: #000;
      }
    }
  }
}

.gallery {
  --count: 3;
  --gap: 2rem;
  --rad: 6px;
  --label: 50%;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--gap);
  margin-top: 6rem;
  margin-bottom: 6rem;

  @media (max-width: 765px) {
    --count: 1;
  }

  @media (min-width: 766px) {

    &.shelf:not(.off) {
      position: relative;
      margin-bottom: calc(6rem + 3rem);
      position: relative;

      &::after {
        content: '';
        position: absolute;
        display: block;
        width: 100%;
        height: 1.8rem;
        border-radius: 6px;
        border: 4px solid #000;
        bottom: -3rem;
        left: 0px;
        background-color: #ccc;
        z-index: 99;
      }

      figure {
        position: unset;

        &:not(:first-of-type) {
          /* margin-left: -20rem !important; */
          margin-left: -18rem !important;
        }

        &:nth-of-type(1) { z-index: 99; }
        &:nth-of-type(2) { z-index: 98; }
        &:nth-of-type(3) { z-index: 97; }
        &:nth-of-type(4) { z-index: 96; }
        &:nth-of-type(5) { z-index: 95; }
        &:nth-of-type(6) { z-index: 94; }
        &:nth-of-type(7) { z-index: 93; }
        &:nth-of-type(8) { z-index: 92; }
        &:nth-of-type(9) { z-index: 91; }
        &:nth-of-type(10) { z-index: 90; }
        &:nth-of-type(11) { z-index: 89; }
        &:nth-of-type(12) { z-index: 88; }
        &:nth-of-type(13) { z-index: 87; }
        &:nth-of-type(14) { z-index: 86; }
        &:nth-of-type(15) { z-index: 85; }
        &:nth-of-type(16) { z-index: 84; }
        &:nth-of-type(17) { z-index: 83; }
        &:nth-of-type(18) { z-index: 82; }
        &:nth-of-type(19) { z-index: 81; }
        &:nth-of-type(20) { z-index: 80; }
        &:nth-of-type(21) { z-index: 79; }
        &:nth-of-type(22) { z-index: 78; }
        &:nth-of-type(23) { z-index: 77; }
        &:nth-of-type(24) { z-index: 76; }
        &:nth-of-type(25) { z-index: 75; }
        &:nth-of-type(26) { z-index: 74; }
        &:nth-of-type(27) { z-index: 73; }
        &:nth-of-type(28) { z-index: 72; }
        &:nth-of-type(29) { z-index: 71; }
        &:nth-of-type(30) { z-index: 70; }

        &:hover {

          picture {
            transform: translateY(-3rem) translateX(4rem) rotate(4deg);
            transition: filter transform 400ms ease;
            filter: unset;

            img {
              box-shadow: 20px 40px 40px 0px #0006;
              transition: box-shadow 400ms ease;
            }
          }
        }

        picture {
          transition: transform 300ms ease;

          img {
            box-shadow: 20px 10px 20px 0px #0003;
            transition: box-shadow 300ms ease;
          }
        }

        figcaption {
          top: auto;
          left: auto;
          right: 1.5rem;
          bottom: 1.5rem;
          width: 190px;
          height: 190px;
          padding: 0.8rem 1rem;
          transition: none;

          &::before {
            top: auto;
            bottom: 0px;
            left: auto;
            right: 0px;
            width: 190px;
            height: 190px;
            border-radius: 3px;
          }
        }
      }
    }
  }

  h3 {
    width: 100%;
    font-family: var(--ft-serif);
    font-size: 4rem !important;
    font-style: italic;
    font-weight: 800 !important;
    user-select: none !important;
    text-align: left !important;
    margin-top: 0rem !important;
    margin-bottom: 1rem !important;

    @media (max-width: 765px) {
      font-size: 3rem !important;
    }

    i {
      font-weight: 400 !important;
    }

    &:hover {

      a {
        display: none !important;
      }
    }
  }

  p {
    width: 100%;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    user-select: none !important;
    text-align: left !important;
    color: #666 !important;
    margin-top: -2rem !important;
    margin-bottom: 3rem !important;
  }

  figure {
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0px !important;
    flex: calc(100% / var(--count) - var(--gap) * (var(--count) - 1) / var(--count)) 0 0;
    position: relative;
    padding: 0px !important;
    aspect-ratio: 1/1;
    border-radius: var(--rad);

    &:focus {

      picture {
        outline: 8px solid #0003;
      }
    }

    picture {
      width: 100%;
      height: 100%;
      background-color: #ccc;
      border-radius: var(--rad);
      cursor: url(/files/cursor-pointer.png), pointer !important;
      transition: transform 200ms ease;

      img {
        user-select: none !important;
        pointer-events: none !important;
        border: none !important;
        box-shadow: 0px 10px 20px 0px #0003;
        border-radius: var(--rad);
        width: 100%;
        height: 100%;
      }
    }

    figcaption {
      opacity: 0;
      position: absolute;
      margin-top: 0px !important;
      font-size: 1.2rem !important;
      font-weight: 700 !important;
      display: flex;
      flex-direction: column;
      padding: calc(1.5rem + 0.8rem) calc(1.5rem + 1rem);
      border-radius: 4px;
      user-select: none !important;
      pointer-events: none !important;
      color: #fff !important;
      width: 100%;
      height: 100%;
      transition: opacity 100ms ease;

      &::before {
        display: block;
        content: '';
        position: absolute;
        background-color: #000;
        width: var(--label);
        aspect-ratio: 1/1;
        top: 1.5rem;
        left: 1.5rem;
        z-index: 9;
        border-radius: 3px;
      }

      strong {
        background-color: unset;
        text-align: left;
        z-index: 10;
      }

      span {
        font-family: var(--ft-mono);
        font-weight: 400;
        font-size: 1rem;
        color: #ccc;
        text-align: left;
        z-index: 10;
      }

      p {
        display: none;
      }
    }

    &:hover {

      picture {
        transform: rotate(3deg);
        transition: filter transform 100ms ease;
        filter: saturate(0);
      }

      figcaption {
        opacity: 1;
      }
    }
  }
}

.viewer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  padding: 0px;
  background: none;
  outline: none;
  margin: 0px;
  width: max-content;
  padding: 4rem;
  cursor: url(/files/cursor-pointer.png), pointer !important;

  @media (max-width: 765px) {
    padding: 0.5rem;
  }

  &::backdrop {
    background-color: #fffe;
    cursor: url(/files/cursor-pointer.png), pointer !important;
  }

  figure {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    pointer-events: none;

    @media (max-width: 765px) {
      flex-direction: column;
      margin: 0px !important;

      picture {
        width: 100% !important;
        height: 100% !important;
      }

      figcaption {
        margin: 0px auto !important;
        aspect-ratio: 3/2 !important;
      }
    }

    picture {
      width: 600px;
      height: 600px;
      cursor: url(/files/cursor-default.png), default !important;
      pointer-events: all !important;
      background-color: #ccc;
      border-radius: 6px;

      img {
        border: none !important;
        border-radius: 6px;
        box-shadow: 0px 10px 20px 0px #0004;
        user-select: none !important;
        pointer-events: none !important;
        background-color: #ccc;
        width: 100%;
        height: 100%;
      }
    }

    figcaption {
      user-select: none !important;
      pointer-events: none !important;
      background-color: #000;
      width: 300px;
      min-width: 300px;
      aspect-ratio: 3/2 !important;
      margin-top: 3rem;
      font-size: 1.2rem !important;
      font-weight: 700 !important;
      color: #fff !important;
      display: flex;
      flex-direction: column;
      padding: 1rem 1.2rem;
      pointer-events: all !important;
      cursor: url(/files/cursor-default.png), default !important;
      border-radius: 3px;

      strong {
        background-color: unset;
        text-align: left;
        z-index: 10;
      }

      span {
        font-family: var(--ft-mono);
        font-weight: 400;
        font-size: 1rem;
        color: #ccc;
        text-align: left;
        z-index: 10;
      }

      p {
        font-weight: 300;
        font-size: 0.9rem;
        color: #ccc;
        text-align: left;
        z-index: 10;
      }
    }
  }
}

.license {
  margin-top: 8rem !important;
  text-align: right !important;
  color: #666 !important;
  font-size: 1rem !important;
  user-select: none;

  @media (max-width: 765px) {
    text-align: center !important;
  }

  a {
    color: #666 !important;
    cursor: url(/files/cursor-pointer.png), pointer !important;

    &:hover {
      color: #000 !important;
    }
  }
}
