main {
  /* below nav */
  margin-top: -57px;
  display: flex;
  flex-direction: column;
  width: 100%;
  font-family: Inter, sans-serif;
}

.hero {
  display: grid;
  place-items: center;
  background: url('/img/hero-background.jpg') no-repeat center center;
  min-height: 100vh;
  scroll-snap-align: center;

  #hero-canvas {
    grid-area: 1 / 1;
    width: 600px;
    height: auto;
    aspect-ratio: 6 / 5;
    max-width: 100%;
  }

  .hero-content {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    text-align: center;
    font-size: 16px;
    line-height: 150%;
    z-index: 1;
    padding: 0 16px;

    .logo {
      filter: drop-shadow(0px 0px 25px #F16053);
      width: 400px;
      height: auto;
      aspect-ratio: 40/13;
      max-width: 100%;
    }

    p {
      max-width: 500px;
      text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
    }
  }

  .scroll-hint {
    position: absolute;
    left: 50%;
    translate: -50%;
    bottom: 40px;
    align-items: center;
    gap: 13px;
    opacity: 0;
    transition: opacity 1s;

    .scroll-hint-circle {
      display: grid;
      place-items: center;
      width: 50px;
      height: 50px;
      border: 1px solid #F16053BB;
      border-radius: 25px;
    }

    p {
      color: #F16053;
      font-size: 14px
    }
  }
}

.hero-quote {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 1500px;
  min-height: 100vh;
  margin: auto;
  background: radial-gradient(50% 50% at 50% 50%, #F160534D 0%, rgba(241, 96, 83, 0.00) 100%);
  scroll-snap-align: center;

  p {
    color: #EEE;
    text-align: center;
    font-family: Inter;
    font-size: 28px;
    font-style: italic;
    font-weight: 600;
    line-height: 130%;
    /* 36.4px */
  }
}

.hero-values {
  display: grid;
  place-items: center;
  min-height: 100vh;
  text-align: center;
  text-decoration: none;
  scroll-snap-align: center;
  position: relative;

  &::before {
    content: "";
    position: absolute;
    width: 100%;
    max-width: 1160px;
    height: 660px;
    background: radial-gradient(50% 50% at 50% 50%, #F160534D 0%, rgba(241, 96, 83, 0) 100%);
    pointer-events: none;
  }

  .vstack {
    gap: 50px;
  }

  .hstack {
    gap: 16px;
    align-items: center;
  }

  svg {
    display: block;

    path {
      stroke-linecap: round;
      stroke: #FF6D57;
      stroke-opacity: 0.4;
    }
  }

  button {
    display: flex;
    width: 140px;
    padding: 10px 16px;
    margin: 0 32px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    background: rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    color: #EEE;
    font-family: "JetBrains Mono";
    font-size: 14px;
    cursor: pointer;

    span {
      color: #FF6D57;
    }

    &:hover {
      border: 1px solid #F16053;
      background: #913A32;
      color: #fff;

      span {
        color: #fff;
      }
    }
  }

  .desktop {
    .hstack {
      a {
        display: flex;
        flex-direction: column;
        gap: 20px;
        text-decoration: none;
        padding: 16px 0 32px 0;
        border-radius: 8px;
        border: 1px solid rgba(241, 96, 83, 0);
        position: relative;
        /* transition: all 0.1s; */

        &:hover {
          border: 1px solid rgba(241, 96, 83, 0.10);
          background-color: rgba(0, 0, 0, 0.69);

          &::after {
            content: "";
            position: absolute;
            left: -20px;
            width: 240px;
            height: 240px;
            background: radial-gradient(50% 50% at 50% 50%, #F160534D 0%, rgba(241, 96, 83, 0.00) 100%);
          }

          svg {
            position: relative;

            path {
              stroke-opacity: 0.8;
            }
          }

          button {
            border: 1px solid #F16053;
            background: #913A32;
            color: #fff;

            span {
              color: #fff;
            }
          }
        }
      }
    }
  }
}

#section-nav {
  display: flex;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 110px;
  padding-left: 12px;
  height: 130px;
  background: #000;

  &::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: #F00;
    background: linear-gradient(#000, #0000)
  }

  .nav-item {
    font-family: "JetBrains Mono";
    font-size: 14px;
    text-decoration: none;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
  }

  .nav-item:hover,
  .nav-item.active {
    color: #F16053;
  }
}

.scroll-container {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  max-width: 1630px;
  padding: 0 16px;
  margin: auto;
}

.left-pane {
  width: 50%;
  display: flex;
  flex-direction: column;
}

.right-pane {
  width: 50%;
  height: calc(100vh - 57px);
  position: sticky;
  top: 57px;
  margin-top: 57px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
}

#artwork-container {
  display: flex;
  justify-content: center;
  align-items: center;

  &>img,
  &>canvas {
    object-fit: contain;
  }

  &>* {
    position: absolute;
    display: flex;
    max-width: 100%;
    max-height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    /* Workaround for Safari otherwise it doesn't animate. */
    will-change: opacity;
    -webkit-user-select: none;
    user-select: none;

    &.active {
      opacity: 1;
      pointer-events: auto;
    }
  }
}

.main-section {
  display: flex;

  .content {
    display: flex;
    flex-direction: column;
    padding-left: 40px;
  }
}

.section-progress {
  position: sticky;
  top: 170px;
  margin: 170px 0 120px 0;
  width: 24px;
  height: calc(100vh - 290px);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;

  button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    opacity: 0.6;
    cursor: pointer;

    &:hover {
      opacity: 1;
    }
  }

  .track {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    .notch {
      width: 24px;
      border-left: 11px solid black;
      border-right: 11px solid black;
      background-color: #D9D9D9;
      opacity: 0.2;
      flex: 1;
      /* transition: flex 0.2s linear, opacity 0.4s linear; */

      &:hover {
        opacity: 0.4;
      }

      &.active {
        flex: 4;
        opacity: 1;
      }
    }
  }
}

.subsection {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  opacity: 0.3;
  transition: opacity 0.2s ease;
  scroll-snap-align: center;

  &.active {
    opacity: 1;
  }

  h2 {
    font-size: 70px;
    font-weight: 600;
    line-height: 100%;
    text-transform: uppercase;
    word-break: break-all;
    margin-bottom: 20px;
  }

  .subtitle {
    font-size: 21px;
    font-weight: 400;
    line-height: 150%;
    margin-bottom: 80px;
    max-width: 400px;
  }

  h3 {
    font-size: 36px;
    font-weight: 600;
    line-height: 150%;
  }

  h4 {
    font-size: 24px;
    font-weight: 600;
    line-height: 150%;
  }

  h5 {
    font-size: 16px;
    font-weight: 600;
    line-height: 150%;
  }

  p {
    color: #B4B4B4;
    font-size: 16px;
    line-height: 150%;
    max-width: 600px;
  }

  code {
    font-family: "JetBrains Mono";
  }

  blockquote {
    font-style: italic;
  }

  ul,
  ol {
    color: #B4B4B4;
    font-size: 16px;
    line-height: 150%;
    padding-left: 24px;
  }
}

footer {
  position: absolute;
  bottom: 0;
  text-align: center;
  color: #B4B4B4;
  opacity: 0.4;
  margin: 32px;
}

@media (min-width: 810px) {
  .hero-values {
    .mobile {
      display: none;
    }
  }

  #safety {
    /* let the section nav overlap the content */
    margin-top: -130px;
  }
}

@media (max-width: 809px) {
  html {
    scroll-snap-type: unset;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    >a {
      &::after {
        display: none;
      }
    }
  }

  .hero {
    background-size: 800px 700px;

    #hero-canvas {
      width: 360px;
      translate: 0 -80px;
    }

    .hero-content {
      gap: 100px;

      .logo {
        width: 280px;
      }

      p {
        max-width: 310px;
        font-size: 15px;
        text-wrap: pretty;
        color: #B4B4B4;
      }
    }
  }

  .hero-values {
    .desktop {
      display: none;
    }

    .vstack {
      align-items: center;

      .hstack {
        align-items: flex-end;
        gap: 0;

        .tetrahedron:nth-child(1),
        .tetrahedron:nth-child(3) {
          width: 100px;
          height: 100px;
        }

        .tetrahedron:nth-child(2) {
          width: 150px;
          height: 150px;
        }
      }

      h1 {
        font-size: 21px;
      }

      .vstack {
        align-items: stretch;
        width: fit-content;
        gap: 22px;

        button {
          justify-content: left;
          padding: 15px 24px;
          margin: 0;
          font-size: 18px;
          width: 100%;
        }
      }
    }

    a {
      text-decoration: none;
    }
  }

  .hero-quote {
    p {
      font-size: 15px;
      font-weight: 400;
      font-style: normal;
      color: #B4B4B4;
    }
  }

  .scroll-container {
    flex-direction: column-reverse;
  }

  .left-pane {
    width: 100%;
    gap: 48px;
  }

  #section-nav {
    top: 50vh;
    height: 40px;
    padding-top: 20px;
    padding-left: 0;
  }

  .main-section {
    scroll-margin-top: 50vh;

    .content {
      padding: 48px 0;
      gap: 48px;
    }
  }

  .section-progress {
    display: none;
  }

  .subsection {
    scroll-margin-top: 50vh;
    height: unset;
    min-height: calc(50vh - 40px);
    gap: 16px;

    h2 {
      font-size: 24px;
      margin-bottom: 0;
    }

    .subtitle {
      font-size: 18px;
      margin-bottom: 16px;
    }

    h3 {
      font-size: 24px;
    }

    p {
      font-size: 15px;
    }
  }

  .right-pane {
    width: 100%;
    height: 50vh;
    top: 0;
  }
}

/* Artworks */

#safety-2 {
  >g {
    transition: translate 0.5s ease;
  }

  &.active {
    #safety-2-group1 {
      translate: 50px 0;
    }

    #safety-2-group2 {
      translate: -50px 0;
    }
  }

  &.fade-out {
    #safety-2-group1 {
      translate: 100px 0;
    }

    #safety-2-group2 {
      translate: -100px 0;
    }
  }
}

#safety-4 {
  >svg {
    width: 100%;
    height: 100%;
    touch-action: none;
  }

  .piece {
    fill: black;
    fill-opacity: 0.4;
    stroke: #3A3A3A;
    stroke-linejoin: round;

    &.highlight {
      fill: #F16053;
      stroke: #F16053;
      stroke-width: 2;
    }
  }

  .tooltip {
    display: flex;
    position: absolute;
    right: 50.205%;
    bottom: 83.1878%;
    pointer-events: none;

    &.hidden {
      display: none;
    }

    .tooltip-text {
      padding: 4px 8px;
      white-space: nowrap;
      height: fit-content;
      background-color: #000000B2;
      border: 1px solid #EEEEEE;
      border-radius: 2px;
      font-family: 'JetBrains Mono';
      font-size: 12px;
      font-weight: 500;
      line-height: 120%;
      color: #F16053;
    }
  }

  &.active:not(:hover) {
    .piece:last-of-type {
      fill: #F16053;
      stroke: #F16053;
      stroke-width: 2;
    }

    .tooltip {
      &.hidden {
        display: flex;
      }
    }
  }
}

#safety-5 {
  width: 550px;
  height: 550px;

  >canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .tooltip {
    position: absolute;
    left: 52%;
    top: 62%;
    padding: 4px 8px;
    white-space: nowrap;
    height: fit-content;
    background-color: #000000B2;
    border: 1px solid #F16053;
    border-radius: 2px;
    font-family: 'JetBrains Mono';
    font-size: 12px;
    font-weight: 500;
    line-height: 120%;
    color: #EEEEEE;
    opacity: 0;
  }

  &.active {
    .tooltip {
      animation: 1.1s anim-fade-in ease forwards;
    }
  }
}

@keyframes anim-fade-in {
  85% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

#safety-9 {
  #safety-9-top {
    translate: -5px 70px;
    transition: translate 1s ease-out;
  }

  #safety-9-label {
    opacity: 0;
    transition: opacity 1s linear;
  }

  &.active {
    #safety-9-top {
      translate: 0;
    }

    #safety-9-label {
      opacity: 1;
    }
  }
}

#performance-1 {
  &.active:not(:hover) {
    #performance-1-shape1 {
      fill: #F1605380;
      stroke: #F16053;
    }

    #performance-1-graph1 {
      stroke-dashoffset: 400;
    }
  }

  .shape {
    fill: rgba(255, 255, 255, 0.05);
    stroke: rgba(255, 255, 255, 0.2);

    &:hover {
      fill: #F1605380;
      stroke: #F16053;
    }
  }

  .graph {
    stroke: #F16053;
    stroke-width: 3;
    stroke-dashoffset: 1000;
    stroke-dasharray: 1000;
    transition: stroke-dashoffset 0.5s;
  }

  &:has(#performance-1-shape1:hover) #performance-1-graph1 {
    stroke-dashoffset: 400;
  }

  &:has(#performance-1-shape2:hover) #performance-1-graph2 {
    stroke-dashoffset: 200;
  }

  &:has(#performance-1-shape3:hover) #performance-1-graph3 {
    stroke-dashoffset: 300;
  }

  &:has(#performance-1-shape4:hover) #performance-1-graph4 {
    stroke-dashoffset: 200;
  }

  &:has(#performance-1-shape5:hover) #performance-1-graph5 {
    stroke-dashoffset: 400;
  }
}

#performance-2 {
  .shape {
    fill: white;
    stroke: white;
    fill-opacity: 0.1;
    stroke-opacity: 0.2;
    transition: translate 1s ease;

    &:hover {
      fill-opacity: 0.5;
      stroke-opacity: 1;
    }
  }

  &.active {
    .shape {
      translate: 0;
    }
  }

  .network {
    translate: 0px 50px;

    &:hover {
      fill: #F1DE73;
      stroke: #F1DE73;
    }
  }

  .storage {
    translate: 0px -10px;

    &:hover {
      fill: #6860ED;
      stroke: #6860ED;
    }
  }

  .compute {
    translate: 62px -50px;

    &:hover {
      fill: #8BF2A9;
      stroke: #8BF2A9;
    }
  }

  .memory {
    translate: -56px -50px;

    &:hover {
      fill: #F16053;
      stroke: #F16053;
    }
  }

  &:has(.network:hover) {
    #performance2-network-color {
      r: 6;
      fill-opacity: 0.5;
      stroke: #F1DE73;
    }
  }

  &:has(.storage:hover) {
    #performance2-storage-color {
      r: 6;
      fill-opacity: 0.5;
      stroke: #6860ED;
    }
  }

  &:has(.compute:hover) {
    #performance2-compute-color {
      r: 6;
      fill-opacity: 0.5;
      stroke: #8BF2A9;
    }
  }

  &:has(.memory:hover) {
    #performance2-memory-color {
      r: 6;
      fill-opacity: 0.5;
      stroke: #F16053;
    }
  }
}

#performance-3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;

  img {
    transition: opacity 0.5s;
    will-change: opacity;
    max-width: 100%;
  }

  #performance-3b {
    opacity: 0;
  }

  &:has(#performance-3-toggle:checked) {
    #performance-3a {
      opacity: 0;
    }

    #performance-3b {
      opacity: 1;
    }
  }

  label[for="performance-3-toggle"] {
    position: relative;
    display: flex;
    padding: 3px;
    gap: 8px;
    width: fit-content;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;

    &>div {
      display: grid;
      place-items: center;
      font-family: "JetBrains Mono";
      font-size: 12px;
      font-weight: 500;
      width: 130px;
      height: 33px;
      z-index: 1;
    }

    &::before {
      content: "";
      position: absolute;
      top: 3px;
      left: 3px;
      width: 128px;
      height: 31px;
      background-color: #F1605380;
      border: 1px solid #F16053;
      border-radius: 2px;
      transition: left 0.1s, background-color 0.1s, border-color 0.1s;
    }
  }

  input#performance-3-toggle {
    display: none;

    &:checked~label[for="performance-3-toggle"]::before {
      left: 141px;
      background-color: #0088F680;
      border-color: #0088F6;
    }
  }
}

@media (max-width: 809px) {
  #performance-3 {
    gap: 0;
  }
}

#performance-4 {
  .graph {
    stroke-dashoffset: 1000;
    stroke-dasharray: 1000;
    transition: stroke-dashoffset 1s;
  }

  &.active {
    .memory {
      stroke-dashoffset: 200;
    }

    .storage {
      stroke-dashoffset: 200;
    }

    .network {
      stroke-dashoffset: 100;
    }
  }
}

.comparison-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  cursor: ew-resize;
  left: 50%;
  transform: translateX(-12px);
  touch-action: pan-y;

  &::before {
    content: "";
    position: absolute;
    left: 11px;
    width: 2px;
    height: 100%;
    background-color: white;
  }

  svg {
    position: absolute;
    top: 50%;
    transform: translateY(-12px);
    filter: drop-shadow(0 0 8px #000A);
  }
}

#experience-1 {
  >svg {
    width: 100%;
    height: 100%;
  }

  .comparison-slider {
    /* 503/543 */
    height: 92.633%;
  }
}

#experience-2 {
  >g {
    transition: translate 0.5s ease;
  }

  &.active {
    #experience-2-group1 {
      translate: 50px 0;
    }

    #experience-2-group2 {
      translate: -50px 0;
    }
  }

  &.fade-out {
    #experience-2-group1 {
      translate: 100px 0;
    }

    #experience-2-group2 {
      translate: -100px 0;
    }
  }
}

#experience-3 {
  box-sizing: border-box;
  width: 706px;
  height: 501px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;

  .clear {
    position: absolute;
    inset: 0;
    clip-path: inset(0 0 0 50%);
  }

  .blur {
    position: absolute;
    inset: 0;
    filter: blur(19px);
    overflow: hidden;
    clip-path: inset(0 50% 0 0);
  }

  >svg,
  >img {
    position: absolute;
    width: 100%;
    height: 100%;
  }
}

#experience-4 {
  >canvas {
    width: 100%;
    height: 100%;
  }
}
