@import 'reset-css';
@import 'fonts';
@import '../fonts/fontawesome-pro/css/all.css';

$font: 'Roboto', Arial, sans-serif;
$tonic: #2c78b6;

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

a {
  color: $tonic;

  &:hover {
    color: darken($tonic, 5%);
  }
}

@each $i in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) {
  $size : $i * 8px;

  .m-#{$i} {
    margin: $size;
  }
  .mv-#{$i} {
    margin-top: $size;
    margin-bottom: $size;
  }
  .mh-#{$i} {
    margin-left: $size;
    margin-right: $size;
  }
  .mb-#{$i} {
    margin-bottom: $size;
  }
  .mt-#{$i} {
    margin-top: $size;
  }
  .ml-#{$i} {
    margin-left: $size;
  }
  .mr-#{$i} {
    margin-right: $size;
  }

  .p-#{$i} {
    padding: $size;
  }
  .pv-#{$i} {
    padding-top: $size;
    padding-bottom: $size;
  }
  .ph-#{$i} {
    padding-left: $size;
    padding-right: $size;
  }
  .pb-#{$i} {
    padding-bottom: $size;
  }
  .pt-#{$i} {
    padding-top: $size;
  }
  .pl-#{$i} {
    padding-left: $size;
  }
  .pr-#{$i} {
    padding-right: $size;
  }
}

html {
  font: 400 16px $font;
  background: #f0f2f5;
}

#header {
  background: #cdd4df;
  padding-top: 64px;
  padding-bottom: 48px;

  .wrapper {
    position: relative;
  }


  .pic {
    position: absolute;
    top: 0;
    right: 0;
  }
}

h2.title {
  font: 600 2.5rem $font;
  color: #2c3c61;

  &:not(:last-child) {
    margin-bottom: 24px;
  }
}

h4.title {
  font: 600 1.5rem $font;
  color: $tonic;

  &:not(:last-child) {
    margin-bottom: 16px;
  }
}

h5.title {
  font: 600 1.15rem $font;
  color: #6b7fa1;
  
  &:not(:last-child) {
    margin-bottom: 16px;
  }
}

hr {
  padding: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.wrapper {
  width: 90%;
  max-width: 860px;
  margin: 0 auto;
}

.sketch {
  position: relative;
  margin: 0 auto;
  background: #0a0a14;
  overflow: hidden;
}

.section {
  padding: 48px 0;
}

.options {
  display: flex;
  flex-direction: column;
}

.group {
  width: 100%;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  margin-right: 16px;
}

.group label {
  color: #59697a;
  font: 400 1rem $font;
  margin-bottom: 8px;
}

input, select {
  display: block;
  width: 100%;
  appearance: none;
  outline: none;
  border: 2px solid #59697a;
  color: #364f69;
  background: transparent;
  margin: 0;
  padding: 0 8px;
  height: 36px;
  line-height: 36px;
  border-radius: 4px;
  font: 400 1rem $font;
}

.article {
  padding: 32px 0;
}

p {
  font: 400 1rem $font;
  line-height: 1.75rem;
}

.var {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin: 0 0.1rem;
  background: rgba(117, 164, 218, 0.1);
  color: $tonic;
  font-weight: 700;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
}

.hint {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  color: #8d9eb1;
  padding: 1rem;
  font: 400 0.8rem $font;

  .icon {
    margin-right: 0.25rem;
    display: none;
  }
}

.record-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.record-button {
  appearance: none;
  outline: none;
  background: none;
  font: 700 1rem $font;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 6px solid transparent;
  cursor: pointer;

  .icon {
    font-size: 2.25rem;

    &--on {
      display: block;
    }
    &--off {
      display: none;
    }
  }

  &.idle {
    color: #afbdcc;
    border-color: #afbdcc;
    transition: color ease 200ms, border-color ease 200ms;

    &:hover {
      color: #8695a5;
      border-color: #8695a5;
      transition: color ease 200ms, border-color ease 200ms;
    }
  }
  
  &.busy {
    color: $tonic;
    border-color: $tonic;
    animation: pulse cubic-bezier(.17,.67,.83,.67) infinite 500ms alternate;

    &:hover {
      .icon {
        &--on {
          display: none;
        }
        &--off {
          display: block;
        }
      }
    }
  }
}

.playback-toggle {
  z-index: 100;
  position: absolute;
  bottom: 16px;
  left: calc((100% - 48px) / 2);
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  outline: none;
  background: none;
  font: 700 1.25rem $font;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 6px solid transparent;
  cursor: pointer;
  color: #afbdcc;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.1);

  &:not(.show) {
    display: none;
  }

  .icon {
    &--on {
      display: block;
    }
    &--off {
      display: none;
    }
  }

  &.playing {
    .icon {
      &--on {
        display: none;
      }
      &--off {
        display: block;
      }
    }
  }
}

.fallback-sound {
  border: 0;
  appearance: none;
  outline: none;
  background: none;
  outline: none;
  font: 400 0.8rem $font;
  color: #afbdcc;
  cursor: pointer;
  
  &:hover {
    color:#8294a7;
    text-decoration: underline;
  }
}

.loader {
  margin-top: 16px;
  visibility: hidden;
  color: $tonic;
  font-size: 1.5rem;

  &.loading {
    visibility: visible;
  }
}

@keyframes pulse {
  from {
    box-shadow: 0 0 0 0 transparent, 0 0 0 16px transparent;
  }
  to {
    box-shadow: 0 0 0 16px rgba($tonic, 0.2), 0 0 0 25.88px rgba($tonic, 0.05);
  }
}

.record-hint {
  color: #afbdcc;
  padding: 1rem;
  font: 400 1.15rem $font;
  text-align: center;
  margin-top: 16px;
}

.figure {
  figcaption {
    margin-top: 8px;
    color:#67717c;
    font-size: 0.9rem;
  }

  &:not(:last-child) {
    margin-bottom: 32px;
  }
}

.imagecomp {
  position: relative;

  display: grid;
  grid-template-columns: 50% 50%;
  grid-gap: 16px;

  img {
    width: 100%;
    height: 500px;
    object-position: 100%;
    object-fit: cover;
  }
}


@import 'responsive';
