@import url("https://fonts.googleapis.com/css?family=Montserrat:400,400i,700");

@mixin sp-layout {
  @media screen and (max-width: 750px) {
    @content;
  }
}

* {
  box-sizing: border-box;
  cursor: none;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: black;
  font-family: Montserrat, sans-serif;
}

// Glitch Text Reveal https://codepen.io/alphardex/pen/ExjjYOv
.glitch {
  &.active {
    span {
      &:not(:last-child) {
        animation-duration: 0.3s;
      }

      &:nth-child(odd) {
        animation-name: slide-from-left;
      }

      &:nth-child(even) {
        animation-name: slide-from-right;
      }

      &:last-child {
        animation: reveal steps(1) forwards;
        animation-delay: 0.6s;
      }
    }
  }
  span {
    &:not(:last-child) {
      --ratio: calc(100% / var(--slice-count));
      --top: calc(var(--ratio) * (var(--i) - 1));
      --bottom: calc(var(--ratio) * (var(--slice-count) - var(--i)));

      position: absolute;
      white-space: nowrap;
      clip-path: inset(var(--top) 0 var(--bottom) 0);
    }

    &:last-child {
      opacity: 0;
    }
  }
}

@keyframes slide-from-left {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slide-from-right {
  from {
    transform: translateX(20%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes reveal {
  to {
    opacity: 1;
  }
}

// Header Underline https://codepen.io/alphardex/pen/JjoqbNP
header {
  position: absolute;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 60px;

  @include sp-layout {
    padding: 0 20px;
  }
}

.logo {
  display: flex;
  align-items: center;
  font-size: 24px;
  line-height: 50px;
  text-align: center;
  text-decoration: none;
  color: white;

  img {
    width: 50px;
    height: 50px;
    margin-right: 4px;
  }
}

.underline-menu {
  position: fixed;
  top: 27%;
  right: 5%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  border-left: 1px solid hsla(0, 0%, 100%, 0.2);
  list-style-type: none;
  mix-blend-mode: difference;

  &:hover {
    li:not(:hover) a {
      opacity: 0.2;
    }
  }

  li {
    position: relative;

    &::after {
      position: absolute;
      content: "";
      top: 0;
      left: 0;
      width: 2px;
      height: 100%;
      background: #3498db;
      transform: scaleY(0);
      transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }

    &:hover,
    &.active {
      &::after {
        transform: scaleY(1);
      }
    }

    a {
      position: relative;
      display: flex;
      padding: 20px 10px 20px 10px;
      font-size: 14px;
      text-decoration: none;
      text-transform: uppercase;
      color: white;
      transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
  }
}

// Full Page Burger Navigation https://codepen.io/alphardex/pen/NWPBwYe
#burger-toggle {
  position: absolute;
  appearance: none;
  opacity: 0;

  &:checked {
    & ~ .overlay {
      opacity: 1;
      transform: scale(160);
    }

    & ~ .burger-nav {
      pointer-events: auto;

      ul li {
        opacity: 1;
        transform: translateX(0);
      }
    }

    & ~ main {
      opacity: 0;
      pointer-events: none;
    }

    & ~ .burger-menu {
      .line {
        &:nth-child(1) {
          transform: translateY(calc(var(--burger-menu-radius) / 5))
            rotate(45deg);
        }

        &:nth-child(2) {
          transform: scaleX(0);
        }

        &:nth-child(3) {
          transform: translateY(calc(var(--burger-menu-radius) / -5))
            rotate(-45deg);
        }
      }
    }
  }
}

.burger-menu {
  --burger-menu-radius: 4em;
  position: fixed;
  top: 25px;
  right: 60px;
  z-index: 100;
  display: none;
  width: var(--burger-menu-radius);
  height: var(--burger-menu-radius);
  background: white;
  border: solid 2px hsla(184, 9%, 62%, 0.4);
  border-radius: 50%;
  outline: none;
  transition: 0.5s ease-in-out;

  @include sp-layout {
    right: 18px;
  }

  .line {
    position: absolute;
    left: 25%;
    width: 50%;
    height: 3px;
    background: hsla(210, 29%, 24%, 0.3);
    border-radius: 10px;
    overflow: hidden;
    pointer-events: none;
    transition: all 0.5s ease;

    &:nth-child(1) {
      top: 30%;
    }

    &:nth-child(2) {
      top: 50%;
    }

    &:nth-child(3) {
      top: 70%;
    }

    &::after {
      position: absolute;
      content: "";
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: #2980b9;
      transform: translateX(-100%);
      transition: all 0.25s ease;
    }

    @for $i from 2 through 3 {
      &:nth-child(#{$i})::after {
        transition-delay: 0.1s * ($i - 1);
      }
    }
  }

  &:hover {
    box-shadow: 0.4px 0.4px 0.8px rgba(0, 0, 0, 0.042),
      1px 1px 2px rgba(0, 0, 0, 0.061), 1.9px 1.9px 3.8px rgba(0, 0, 0, 0.075),
      3.4px 3.4px 6.7px rgba(0, 0, 0, 0.089),
      6.3px 6.3px 12.5px rgba(0, 0, 0, 0.108),
      15px 15px 30px rgba(0, 0, 0, 0.15);

    .line::after {
      transform: translateX(0);
    }
  }
}

.overlay {
  position: fixed;
  top: 45px;
  right: 80px;
  width: 2em;
  height: 2em;
  background: #1a5780;
  border-radius: 50%;
  opacity: 0;
  transition: 0.5s ease-in-out;
  will-change: transform;
}

.burger-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;

  @include sp-layout {
    transform: translateY(-8%);
  }

  ul {
    position: fixed;
    z-index: 101;
    display: flex;
    flex-direction: column;
    align-items: start;
    list-style-type: none;

    li {
      padding: 6px 0;
      margin: 1em 3em;
      opacity: 0;
      transition: 0.6s cubic-bezier(0.365, 0.84, 0.44, 1);

      &:nth-child(odd) {
        transform: translateX(-100%);
      }

      &:nth-child(even) {
        transform: translateX(100%);
      }

      @for $i from 1 through 5 {
        &:nth-child(#{$i}) {
          transition-delay: 0.05s * $i;
        }
      }

      a {
        position: relative;
        display: block;
        padding: 5px;
        font-size: 2em;
        text-decoration: none;
        text-transform: uppercase;
        color: white;
        transition: 0.5s;

        &::after {
          position: absolute;
          content: "";
          top: 0;
          left: 0;
          z-index: -1;
          width: 100%;
          height: 100%;
          background: hsl(340, 100%, 63%);
          transform: scaleX(0);
          transform-origin: right;
          transition: transform 0.5s;

          @include sp-layout {
            transition: none;
          }
        }

        &:hover::after {
          transform: scaleX(1);
          transform-origin: left;

          @include sp-layout {
            transform: scaleX(0);
          }
        }
      }
    }
  }
}

@include sp-layout {
  .underline-menu {
    display: none;
  }

  .burger-menu {
    display: block;
  }

  .logo {
    padding-top: 20px;
  }
}

// Button Collection https://codepen.io/alphardex/pen/VwwVLdM
.btn {
  --hue: 204;
  position: relative;
  padding: 1rem 1.5rem;
  margin-top: 40px;
  font-size: 0.8rem;
  line-height: 1.5;
  text-decoration: none;
  background-color: hsl(var(--hue), 70%, 53%);
  border: 1px solid hsl(var(--hue), 70%, 53%);
  outline: transparent;
  overflow: hidden;
  cursor: none;
  user-select: none;
  white-space: nowrap;
  transition: 0.3s;

  @include sp-layout {
    & {
      margin-top: 20px;
      font-size: 0.7rem;
    }
  }

  &:hover {
    background: hsl(var(--hue), 70%, 43%);
  }

  &-ghost {
    color: hsl(var(--hue), 70%, 53%);
    background-color: transparent;
    border-color: hsl(var(--hue), 70%, 53%);

    &:hover {
      color: white;
      background: hsl(var(--hue), 70%, 53%);
    }
  }

  &-through {
    transition: 0.6s cubic-bezier(0.77, 0, 0.175, 1);

    &::before {
      position: absolute;
      content: "";
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: hsl(var(--hue), 70%, 53%);
      transform: scaleX(0);
      transform-origin: right;
      mix-blend-mode: color-dodge;
      will-change: transform;
      transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    }

    &:hover {
      color: white;
      background: transparent;

      &::before {
        transform: scaleX(1);
        transform-origin: left;
      }
    }
  }
}

// Cursor Follow & Hover Effect https://codepen.io/alphardex/pen/jOEgYjr
.cursor,
.cursor-border {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  transition: 0.3s;
}

.cursor {
  background: #3498db;
}

.cursor-border {
  padding: 2rem;
  border: 0.1rem solid #3498db;

  &.on-focus {
    padding: 0.5rem;
    background: hsla(204, 70%, 53%, 0.5);
    border-color: transparent;
  }
}

// Cross Bar Glitch Text https://codepen.io/alphardex/pen/VwLLLNG
.cross-bar-glitch {
  position: relative;

  &.active {
    .bars .bar {
      animation: 0.6s cubic-bezier(0.4, 0.2, 0.175, 1) forwards;

      &:nth-child(odd) {
        animation-name: slide-left;
      }

      &:nth-child(even) {
        animation-name: slide-right;
      }
    }

    .glitch {
      animation: reveal forwards 0.3s;
      animation-delay: 0.6s;

      span {
        &:not(:last-child) {
          animation-duration: 0.3s;
        }

        &:nth-child(odd) {
          animation-name: slide-from-left;
        }

        &:nth-child(even) {
          animation-name: slide-from-right;
        }

        &:last-child {
          animation: reveal steps(1) forwards;
          animation-delay: 0.6s + 0.6s;
        }
      }
    }
  }

  .bars {
    $bars-dalay: 0.3s, 0.2s, 0.5s, 0.3s, 0.4s;

    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    .bar {
      width: 100%;
      flex: 1;
      background: currentColor;
      border-radius: 50px;

      &:nth-child(odd) {
        transform: translateX(100%);
      }

      &:nth-child(even) {
        transform: translateX(-100%);
      }

      @for $i from 1 through 5 {
        &:nth-child(#{$i}) {
          animation-delay: nth($bars-dalay, $i);
        }
      }
    }
  }

  .glitch {
    opacity: 0;

    span {
      &:not(:last-child) {
        --ratio: calc(100% / var(--slice-count));
        --top: calc(var(--ratio) * (var(--i) - 1));
        --bottom: calc(var(--ratio) * (var(--slice-count) - var(--i)));

        position: absolute;
        color: currentColor;
        white-space: nowrap;
        clip-path: inset(var(--top) 0 var(--bottom) 0);
      }

      &:last-child {
        opacity: 0;
      }
    }
  }
}

@keyframes slide-from-left {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slide-from-right {
  from {
    transform: translateX(20%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes reveal {
  to {
    opacity: 1;
  }
}

@keyframes slide-left {
  to {
    transform: translateX(-100%);
  }
}

@keyframes slide-right {
  to {
    transform: translateX(100%);
  }
}

// Staggered Rise In Text https://codepen.io/alphardex/pen/qBEmGbw
.staggered-rise-in {
  position: relative;
  display: flex;
  white-space: pre;
  overflow: hidden;

  span {
    transform: translateY(100%);
  }

  &.active {
    span {
      animation: rise-in 1s forwards;
    }
  }
}

@keyframes rise-in {
  to {
    transform: translateY(-12%);
  }
}

// Profile Card https://codepen.io/alphardex/pen/jOExoLp
.card {
  --card-bg-color: linear-gradient(-20deg, #2b5876 0%, #4e4376 100%);
  position: relative;
  width: 240px;
  color: white;

  &.active {
    .card-borders {
      .border-top {
        animation: slide-in-horizontal 0.8s cubic-bezier(0.645, 0.045, 0.355, 1)
          forwards;
      }
      .border-right {
        animation: slide-in-vertical 0.8s cubic-bezier(0.645, 0.045, 0.355, 1)
          forwards;
      }
      .border-bottom {
        animation: slide-in-horizontal-reverse 0.8s
          cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
      }
      .border-left {
        animation: slide-in-vertical-reverse 0.8s
          cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
      }
    }
    .card-content {
      animation: bump-in 0.5s 0.8s forwards;

      .avatar {
        animation: bump-in 0.5s 1s forwards;
      }

      .username {
        animation: fill-text-white 1.2s 2s forwards;

        &::before {
          animation: slide-in-out 1.2s 1.2s cubic-bezier(0.75, 0, 0, 1) forwards;
        }
      }

      .info {
        animation: fade-up 1.2s 2s forwards;
      }
    }
  }

  .card-borders {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;

    .border-top {
      position: absolute;
      top: 0;
      width: 100%;
      height: 2px;
      background: var(--card-bg-color);
      transform: translateX(-100%);
    }

    .border-right {
      position: absolute;
      right: 0;
      width: 2px;
      height: 100%;
      background: var(--card-bg-color);
      transform: translateY(100%);
    }

    .border-bottom {
      position: absolute;
      bottom: 0;
      width: 100%;
      height: 2px;
      background: var(--card-bg-color);
      transform: translateX(100%);
    }

    .border-left {
      position: absolute;
      top: 0;
      width: 2px;
      height: 100%;
      background: var(--card-bg-color);
      transform: translateY(-100%);
    }
  }

  .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 360px;
    padding: 40px 0 40px 0;
    background: var(--card-bg-color);
    box-shadow: 0 0px 0.7px rgba(0, 0, 0, 0.056),
      0 0px 1.7px rgba(0, 0, 0, 0.081), 0 0px 3.1px rgba(0, 0, 0, 0.1),
      0 0px 5.6px rgba(0, 0, 0, 0.119), 0 0px 10.4px rgba(0, 0, 0, 0.144),
      0 0px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.6);

    .avatar {
      width: 120px;
      height: 120px;
      border-radius: 50%;
      margin-bottom: 40px;
      opacity: 0;
      transform: scale(0.6);
    }

    .username {
      position: relative;
      font-size: 26px;
      letter-spacing: 2px;
      margin-bottom: 40px;
      color: transparent;

      &::before {
        position: absolute;
        content: "";
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        color: black;
        background: white;
        transform: scaleX(0);
        transform-origin: left;
      }
    }

    .info {
      font-size: 12px;
      text-align: center;
      opacity: 0;
      transform: translateY(20%);
    }
  }
}

@keyframes bump-in {
  50% {
    transform: scale(1.05);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in-horizontal {
  50% {
    transform: translateX(0);
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes slide-in-horizontal-reverse {
  50% {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes slide-in-vertical {
  50% {
    transform: translateY(0);
  }

  to {
    transform: translateY(-100%);
  }
}

@keyframes slide-in-vertical-reverse {
  50% {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

@keyframes slide-in-out {
  50% {
    transform: scaleX(1);
    transform-origin: left;
  }

  50.1% {
    transform-origin: right;
  }

  100% {
    transform: scaleX(0);
    transform-origin: right;
  }
}

@keyframes fill-text-white {
  to {
    color: white;
  }
}

// Map Marker https://codepen.io/alphardex/pen/ZEGzZYd
.marker {
  position: relative;
  --marker-radius: 1em;
  --marker-diameter: calc(var(--marker-radius) * 2);
  --marker-color: #3498db;

  .pin {
    position: relative;
    z-index: 1;
    width: var(--marker-diameter);
    height: var(--marker-diameter);
    background: var(--marker-color);
    border-radius: 50% 50% 0 50%;
    mask: radial-gradient(
      transparent calc(var(--marker-radius) / 2),
      black calc(var(--marker-radius) / 2)
    );
    transform: rotate(45deg);
  }

  .shadow {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--marker-radius);
    height: var(--marker-radius);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transform: translate(50%, -10%) rotateX(60deg);

    &::before {
      position: absolute;
      content: "";
      width: var(--marker-diameter);
      height: var(--marker-diameter);
      background: transparent;
      border: 1px solid var(--marker-color);
      border-radius: inherit;
      opacity: 0;
      transform: scale(0);
      animation: pulse 1s infinite;
    }
  }
}

@keyframes pulse {
  50% {
    opacity: 1;
  }

  to {
    transform: scale(1.2);
  }
}

// Timeline https://codepen.io/alphardex/pen/bGdNxea
.timeline {
  position: relative;
  display: grid;
  gap: 40px;
  padding: 0;
  margin: 0;
  max-width: 600px;
  font-size: 0.75rem;
  line-height: 1;
  color: white;
  list-style-type: none;
  clip-path: inset(0 0 100% 0);

  &.active {
    animation: expand 4s 0.6s forwards linear;
  }

  @include sp-layout {
    & {
      animation: none;
      max-width: 60vw;
      clip-path: inset(0 0 0 0);
      opacity: 0;
      transform: translateY(2%);

      &.active {
        animation: fade-up 1.2s 0.6s forwards;
      }
    }
  }

  .timeline__line {
    position: absolute;
    top: 0;
    left: 6px;
    width: 4px;
    height: 100%;
    background: white;
  }

  .timeline__item {
    .info {
      display: grid;
      grid-template-columns: repeat(3, auto) 1fr;
      align-items: center;
      gap: 0.3rem;

      h4 {
        margin: 0;
      }

      a {
        text-decoration: none;
        color: #3498db;
      }

      .dot {
        position: relative;
        width: 16px;
        height: 16px;
        background: #1a1e23;
        border-radius: 50%;

        &::before {
          position: absolute;
          content: "";
          top: -4px;
          left: -4px;
          right: -4px;
          bottom: -4px;
          background: #1a1e23;
        }

        &::after {
          position: absolute;
          content: "";
          top: 0;
          left: 0;
          width: 8px;
          height: 8px;
          border: 4px solid white;
          border-radius: inherit;
        }
      }

      .time {
        margin-right: 8px;
      }
    }

    .content {
      margin: 1rem 0 0 3.9rem;
      line-height: 1.5;
    }
  }
}

@keyframes expand {
  to {
    clip-path: inset(0 0 0 0);
  }
}

// Fade Up
.fade-up {
  opacity: 0;
  transform: translateY(20%);

  &.active {
    animation: fade-up 0.6s forwards;
  }
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

// Fade in
.fade-in {
  opacity: 0;

  &.active {
    animation: reveal 0.6s forwards;
  }
}

// Basic Layout
main {
  height: 100%;
  color: white;

  section {
    h1,
    h2 {
      margin: 0;
    }

    h1 {
      font-size: 32px;
    }

    h2 {
      font-size: 14px;
    }

    p {
      margin: 0;
    }
  }

  .hero-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-image: linear-gradient(
        rgba(16, 16, 16, 0.8),
        rgba(16, 16, 16, 0.8)
      ),
      url(https://images.unsplash.com/photo-1435575653489-b0873ec954e2?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ);
    background-position: center;
    background-size: cover;

    h1 {
      margin-bottom: 8px;
      font-size: 46px;
      text-transform: uppercase;
    }

    h2 {
      font-size: 24px;
      font-weight: lighter;
    }

    @include sp-layout {
      h1 {
        font-size: 30px;
      }

      h2 {
        font-size: 16px;
      }
    }
  }

  .normal-section {
    display: grid;
    justify-items: center;
    gap: 40px;
    padding: 48px 0;
    color: white;

    &#speakers,
    &#sponsors {
      justify-items: normal;
    }

    .titles {
      display: grid;
      justify-items: center;
      gap: 20px;
      letter-spacing: 0.25em;
    }

    &:nth-child(odd) {
      background: #eceffc;
      color: black;
    }

    &:nth-child(even) {
      background: #1a1e23;
      color: white;
    }
  }

  #about {
    padding: 60px 0;

    .description {
      display: grid;
      gap: 24px;
      width: 60vw;

      @for $i from 1 through 4 {
        p:nth-child(#{$i}) {
          animation-delay: 0.5s + 0.1s * $i;
        }
      }
    }
  }

  #speakers {
    .speakers-cards {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      justify-items: center;
      gap: 2rem;
      margin: 0 12.5rem;
    }

    @include sp-layout {
      .speakers-cards {
        margin: 0;
      }
    }
  }

  #location {
    .place {
      display: flex;
      align-items: center;
      animation-delay: 0.6s;

      .marker {
        margin: 0 1em 0.5em 0;
      }

      .place-name {
        font-size: 20px;
        font-weight: bold;
      }
    }

    #map {
      width: 60vw;
      height: 360px;
      animation-delay: 0.6s;
    }
  }

  #sponsors {
    .sponsors-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 2rem;
      margin: 0 12.5rem;
      padding: 0;
      list-style-type: none;

      li {
        text-align: center;
        animation-delay: 0.2s;

        a {
          display: block;
          height: 100%;

          img {
            max-width: 150px;
            pointer-events: none;
          }
        }
      }
    }

    @include sp-layout {
      .sponsors-list {
        margin: 0;
      }
    }
  }
}
