// $A100: #3D9CFF;
// $G100: #000000;
// $G200: #141414;
// $G300: #333333;
// $G400: #6A6A6A;
// $G500: #A3A3A3;
// $G600: #BBBBBB;
// $G700: #FFFFFF;
// $vfColor: #3D9CFF;
$A100: #2680EB;
$G100: #FFFFFF;
$G200: #F7F7F7;
$G300: #E1E1E1;
$G400: #999999;
$G500: #666666;
$G600: #333333;
$G700: #000000;
$vfColor: #2680EB; // $A100: #50C9CE;
// $G100: #FFFFFF;
// $G200: #FDFCF6;
// $G300: #E8E3DC;
// $G400: #9D978F;
// $G500: #6A6256;
// $G600: #332C21;
// $G700: #000000;
// $vfColor: #50C9CE;
$textBackgroundColor: #FFFFFF;
$textColor: #000000;
$transition: 125ms ease-in-out;
$sans: 'Nunito Beta', sans-serif;
$mono: 'Input Mono Beta', monospace;
@import 'fonts';
@mixin track() {
  background-color: $G300;
  border-radius: 1px;
  border: none;
  outline: none;
  height: 2px;
  padding: 0;
}
@mixin thumb() {
  -webkit-appearance: none;
  outline: none;
  background: $G100;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  border: 2px solid $G500;
  box-shadow: 3px 0 0 1px $G200, -3px 0 0 1px $G200;
  box-sizing: border-box;
  margin-top: -7px;
  transition: border $transition;
  z-index: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  background-color: transparent;
  height: 16px;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  z-index: 1;

  &:focus {
    outline: none;
  }

  &:active {
    &::-webkit-slider-thumb {
      border-width: 8px;
    }

    &::-moz-range-thumb {
      border-width: 8px;
    }

    &::-ms-thumb {
      border-width: 8px;
    }
  }

  &::-webkit-slider-runnable-track {
    @include track();
  }

  &::-moz-range-track {
    @include track();
  }

  &::-ms-track {
    @include track();
    border-color: transparent;
    color: transparent;
  }

  &::-webkit-slider-thumb {
    @include thumb();
  }

  &::-moz-range-thumb {
    @include thumb();
  }

  &::-ms-thumb {
    @include thumb();
    margin-top: 0;
  }

  &::-ms-ticks-after,
  &::-ms-ticks-before,
  &::-ms-tooltip {
    display: none;
  }

  &::-ms-fill-lower {
    background: $G500;
    border-radius: 1px;
  }

  &::-ms-fill-upper {
    background: $G300;
    border-radius: 1px;
  }

  &::-moz-focus-outer {
    border: 0;
  }
}

input[type="text"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  border-radius: 0;
  border-bottom: solid 1px $G300;
  background-color: transparent;

  &::placeholder {
    color: $G400;
  }
}
// .select-disabled {
//   -moz-user-select: none;
//   -khtml-user-select: none;
//   -webkit-user-select: none;
//   -ms-user-select: none;
//   user-select: none;
// }
// .select-enabled {
//   -moz-user-select: text;
//   -khtml-user-select: text;
//   -webkit-user-select: text;
//   -ms-user-select: text;
//   user-select: text;
// }
// [contenteditable]:focus {
//   outline: none;
// }

.text-frame {
  display: inline-block;
  position: absolute;
  top: 100px;
  left: 50px;
  border: solid 1px transparent;

  &.fit-type,
  &.point-type {
    &.selected,
    &:hover {
      border: solid 1px $vfColor;
    }
  }

  &.area-type {
    &.selected,
    &:hover {
      border: solid 1px $vfColor;
    }
  }

  &.highlight {
    .text {
      color: $vfColor;
    }
  }

  &.point-type .text {
    white-space: nowrap;
  }

  &.area-type .text {
    height: 100%;
    white-space: normal;
    overflow: hidden;
  }

  .text {
    font-size: 100px;
    font-family: 'Dunbar';
    font-variation-settings: "wght" 400, "opsz" 72;

    .controls--vf-xheight {
      .vf-xheight-line {
        position: absolute;
        left: 0;
        right: 0;
        height: 1px;
        cursor: ns-resize;
        background-color: $vfColor;
        visibility: hidden;

        &:before {
          content: '';
          position: absolute;
          left: 0;
          right: 0;
          top: -5px;
          margin: auto;
          height: 11px;
          background-color: rgba($vfColor, 0.15);
        }
      }

      .vf-base-line {
        position: absolute;
        left: 0;
        right: 0;
        border-bottom: 1px dashed $vfColor;
        visibility: hidden;
      }
    }
  }

  .round-handle {
    width: 7px;
    height: 7px;
    position: absolute;
    border: solid 1px $vfColor;
    background-color: #fff;
    border-radius: 50%;
  }

  .square-handle {
    width: 7px;
    height: 7px;
    position: absolute;
    border: solid 1px $vfColor;
    background-color: #fff;
  }

  .controls--vf-opsz {
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    bottom: -60px;
    width: 9px;

    .vf-opsz-handle {
      position: relative;
      width: 7px;
      height: 7px;
      border: solid 1px $vfColor;
      border-radius: 50%;
      cursor: ns-resize;

      &:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 1px;
        height: 7px;
        background-color: $vfColor;
        box-shadow: -2px 0 0 0 $vfColor, 2px 0 0 0 $vfColor;
      }
    }

    .vf-opsz-line {
      position: absolute;
      width: 0;
      left: 4px;
      height: 50px;
      top: -50px;
      transform-origin: left bottom;
      border-left: solid 1px $vfColor;
    }
  }

  .controls--vf-slantness {
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    top: -60px;
    width: 9px;

    .vf-slantness-handle {
      position: relative;
      width: 7px;
      height: 7px;
      border: solid 1px $vfColor;
      border-radius: 4.5px;
      cursor: ew-resize;

      &:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 1px;
        height: 7px;
        background-color: $vfColor;
        box-shadow: -2px 0 0 0 $vfColor, 2px 0 0 0 $vfColor;
      }
    }

    .vf-slantness-line {
      position: absolute;
      width: 0;
      left: 4px;
      height: 50px;
      transform-origin: left bottom;
      border-left: solid 1px $vfColor;
    }
  }

  .controls--vf-width-x {
    position: absolute;
    right: -60px;
    bottom: -5px;
    margin: auto;
    width: 9px;
    height: 9px;

    .vf-width-x-handle {
      position: relative;
      width: 7px;
      height: 7px;
      border: solid 1px $vfColor;
      border-radius: 50%;
      cursor: ew-resize;
      background-color: #fff;

      &:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 1px;
        height: 7px;
        background-color: $vfColor;
        box-shadow: -2px 0 0 0 $vfColor, 2px 0 0 0 $vfColor;
      }
    }

    .vf-width-x-line {
      position: absolute;
      width: 0;
      left: -50px;
      top: 4px;
      width: 50px;
      border-top: solid 1px $vfColor;
    }
  }

  .controls--vf-width-y {
    position: absolute;
    right: -5px;
    margin: auto;
    bottom: -60px;
    width: 9px;

    .vf-width-y-handle {
      position: relative;
      width: 7px;
      height: 7px;
      border: solid 1px $vfColor;
      border-radius: 50%;
      cursor: ns-resize;

      &:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 1px;
        height: 7px;
        background-color: $vfColor;
        box-shadow: -2px 0 0 0 $vfColor, 2px 0 0 0 $vfColor;
      }
    }

    .vf-width-y-line {
      position: absolute;
      width: 0;
      left: 4px;
      height: 50px;
      top: -50px;
      transform-origin: left bottom;
      border-left: solid 1px $vfColor;
    }
  }

  .controls--vf-width {
    position: absolute;
    right: -60px;
    bottom: -60px;
    width: 9px;

    .vf-width-handle {
      position: relative;
      width: 7px;
      height: 7px;
      border: solid 1px $vfColor;
      border-radius: 50%;
      cursor: nwse-resize;
      background-color: #fff;

      &:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 1px;
        height: 7px;
        background-color: $vfColor;
        box-shadow: -2px 0 0 0 $vfColor, 2px 0 0 0 $vfColor;
      }
    }

    .vf-width-line {
      position: absolute;
      width: 0;
      left: 3px;
      top: 3px;
      height: 76px;
      transform-origin: top center;
      transform: rotate(135deg);
      border-left: solid 1px $vfColor;
    }
  }

  .controls--size {
    .handle {
      width: 7px;
      height: 7px;
      position: absolute;
      border: solid 1px $vfColor;
      background-color: #fff;
      border-radius: 50%;

      &.top.left {
        cursor: nw-resize;
      }

      &.top.center {
        cursor: n-resize;
      }

      &.top.right {
        cursor: ne-resize;
      }

      &.middle.left {
        cursor: w-resize;
      }

      &.middle.right {
        cursor: e-resize;
      }

      &.bottom.left {
        cursor: sw-resize;
      }

      &.bottom.center {
        cursor: ns-resize;
      }

      &.bottom.right {
        cursor: se-resize;
      }

      &.top {
        top: -5px;
      }

      &.bottom {
        bottom: -5px;
      }

      &.left {
        left: -5px;
      }

      &.right {
        right: -5px;
      }

      &.center {
        left: 0;
        right: 0;
        margin: auto;
      }

      &.middle {
        top: 0;
        bottom: 0;
        margin: auto;
      }
    }
  }

  .controls--area-size {
    .square-handle {
      &.bottom.right,
      &.top.left {
        cursor: nwse-resize;
      }

      &.bottom.left,
      &.top.right {
        cursor: nesw-resize;
      }

      &.top {
        top: -5px;
      }

      &.bottom {
        bottom: -5px;
      }

      &.left {
        left: -5px;
      }

      &.right {
        right: -5px;
      }
    }
  }

  .controls--font-size {
    .round-handle.font-size-handle {
      cursor: ns-resize;
      bottom: -5px;
      left: 0;
      right: 0;
      margin: auto;
    }
  }

  .controls--contrast {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -62px;
    width: 52px;
    display: none;

    .contrast-value {
      display: inline-block;
      font-size: 20px;
      height: 20px;
      color: $vfColor;
      width: 40px;
      text-align: right;
      margin: auto;
      top: 0;
      bottom: 0;
      right: 12px;
      position: absolute;
    }

    .contrast-bracket {
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      width: 8px;
      border-top: solid 1px $vfColor;
      border-left: solid 1px $vfColor;
      border-bottom: solid 1px $vfColor;
    }
  }

  &:hover .controls--vf-xheight {
    .vf-base-line,
    .vf-xheight-line {
      visibility: visible;
    }
  }

  [class^="controls-"] {
    display: none;
  }

  &.selected.area-type .controls--area-size,
  &.selected.area-type .controls--font-size,
  &.selected.point-type .controls--font-size,
  &.selected.point-type.vf-width-on .controls--vf-width,
  &.selected.point-type.vf-width-on .controls--vf-width-x,
  &.selected.point-type.vf-width-on .controls--vf-width-y,
  &.selected.vf-optical-size-on .controls--vf-opsz,
  &.selected.vf-slant-on .controls--vf-slantness,
  &.selected.vf-xheight-on .controls--vf-xheight {
    display: block;
  }
}

body {
  background-color: $textBackgroundColor;
  -moz-osx-font-smoothing: grayscale;
  font-smoothing: antialiased;
  -webkit-font-smoothing: antialiased;
  position: relative;
  font-family: $sans;
  display: flex;
}

#font-playground-app {
  width: 100%;

  &.design-view {
    .panel .section.section-font-size,
    .panel .section.section-preset-variations {
      display: block;
    }

    .panel .section.section-variable-options {
      display: flex;
    }

    .panel .section.section-code,
    .panel .section.section-export {
      display: none;
    }

    .about {
      display: none;
    }
  }

  &.code-view {
    .panel .section.section-font-size,
    .panel .section.section-preset-variations,
    .panel .section.section-variable-options {
      display: none;
    }

    .panel .section.section-code,
    .panel .section.section-export {
      display: flex;
    }

    .about {
      display: none;
    }
  }

  .drawer {
    display: none;
  }

  .canvas {
    width: calc(100vw - 284px);
    left: 42px;
  }

  &.font-menu-opened {
    .drawer {
      display: block;
    }

    .canvas {
      width: calc(100vw - 526px);
      left: 284px;
    }
  }

  &.about-view {
    .canvas,
    .drawer,
    .panel,
    .tools {
      display: none;
    }

    .about {
      display: block;
    }
  }
}

.subtitle-text {
  font-family: $sans;
  font-variation-settings: 'wght' 140;
  color: $G400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.logo-text {
  font-family: "GRADUATE";
  font-variation-settings: 'XOPQ' 100, 'XTRA' 300, 'OPSZ' 8, 'GRAD' 9, 'YTRA' 750, 'CNTR' 40, 'YOPQ' 200, 'SERF' 0, 'YTAS' 0, 'YTLC' 650, 'YTDE' 0, 'SELE' 0;
  color: $G500;
  font-size: 14px;
  text-decoration: none;

  .accent-text {
    color: $A100;
  }
}

.badge-text {
  font-family: $sans;
  font-variation-settings: 'wght' 99;
  color: $G500;
  font-size: 12px;
}

.label-text {
  font-family: $sans;
  font-variation-settings: 'wght' 99;
  color: $G600;
  font-size: 12px;
}

.value-text {
  font-family: $sans;
  font-variation-settings: 'wght' 99;
  color: $G700;
  font-size: 12px;
}

.button {
  background-color: $G100;
  border: 1px solid $G300;
  line-height: 28px;
  height: 28px;
  box-sizing: border-box;
  border-radius: 3px;
  padding: 0 5px;
  cursor: pointer;
  display: inline-block;

  &:active {
    border-color: $A100;
  }
}

.tabs {
  width: 100vw;
  height: 37px;
  background-color: $G200;
  border-bottom: 2px solid $G300;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;

  .logo-text {
    margin-left: 12px;
    line-height: 37px;
    position: absolute;
    left: 0;
  }

  .menu {
    position: absolute;
    left: 260px;
    display: flex;

    & > li {
      position: relative;

      &:hover {
        & > ul {
          display: block;
        }

        & > span {
          cursor: pointer;
          background-color: $G500;
          color: $G100;

          & > a {
            color: $G100;
          }
        }
      }

      & > span {
        display: block;
        padding: 0 15px;
        line-height: 38px;
        height: 37px;

        & > a {
          text-decoration: none;
          font-weight: bold;
          color: $A100;
        }
      }

      & > ul {
        display: none;
        border-radius: 0 0 3px 3px;
        width: max-content;
        position: absolute;
        padding-top: 2px;
        left: 0;
        box-shadow: 0 3px 10px rgba($G500, 0.5);
        z-index: 9;

        a,
        li {
          display: block;
          position: relative;
          line-height: 30px;
          padding: 0 30px 0 15px;
          background-color: $G200;

          &:hover {
            cursor: pointer;
            background-color: $A100;
            color: $G100;
          }

          &:last-child {
            border-radius: 0 0 3px 3px;
          }
        }

        li.contains-sub-menu {
          &:after {
            content: "▶";
            position: absolute;
            top: 0;
            bottom: 0;
            right: 8px;
          }

          ul {
            display: none;
            position: absolute;
            z-index: 2;
            left: 100%;
            top: 0;
            box-shadow: 0 3px 10px rgba($G500, 0.5);

            li {
              color: $G700;
              padding: 0 15px;

              &:hover {
                color: $G100;
              }

              &:last-child {
                border-radius: 0 0 3px 3px;
              }
            }
          }

          &:hover ul {
            display: block;
          }
        }

        a.offsite-link {
          &:after {
            content: "⸣";
            position: absolute;
            top: 0;
            bottom: 0;
            right: 8px;
          }
        }

        a {
          text-decoration: none;
          color: inherit;
        }
      }
    }
  }

  .tab {
    position: relative;
    color: $G500;
    padding: 0 10px;
    line-height: 38px;
    height: 39px;
    cursor: pointer;
    overflow: hidden;
    transition: color 0.2s ease;

    &:after {
      content: '';
      position: absolute;
      width: 100%;
      bottom: 0;
      left: 0;
      height: 2px;
      border-radius: 1px;
      background-color: $G700;
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    &.active {
      cursor: default;
      color: $G700;

      &:after {
        opacity: 1;
      }
    }
  }

  .social {
    margin-right: 12px;
    margin-top: 4px;
    position: absolute;
    right: 0;
    display: flex;

    .icon-button {
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;

      path {
        fill: $G500;
        transition: fill 0.2s ease;
      }

      &.newsletter:hover {
        path {
          fill: $A100;
        }
      }

      &.twitter:hover {
        path {
          fill: #1DA1F2;
        }
      }

      &.facebook:hover {
        path {
          fill: #3B5998;
        }
      }

      &.github:hover {
        path {
          fill: #000000;
        }
      }
    }
  }
}

.tools {
  width: 42px;
  height: calc(100vh - 39px);
  background-color: $G200;
  border-right: 2px solid $G300;
  position: absolute;
  top: 39px;
  left: 0;
  box-sizing: border-box;
  padding-top: 4px;
  padding-left: 2px;
  padding-right: 2px;

  .tool {
    padding: 9px;
    cursor: pointer;
    position: relative;

    path {
      fill: $G500;
      transition: fill 0.2s ease;
    }

    &.active path,
    &:hover path {
      fill: $A100;
    }
  }

  .tool.font-menu {
    position: absolute;
    bottom: 4px;
    display: none;
  }
}

.drawer {
  width: 242px;
  height: calc(100vh - 39px);
  background-color: $G200;
  border-right: 2px solid $G300;
  position: absolute;
  top: 39px;
  left: 42px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;

  .section.section-font-cards {
    visibility: hidden !important; // ADAM
    height: calc(100% - 210px);
    display: flex;
    flex-direction: column;

    .search-box {
      position: relative;
      margin-top: 15px;

      input {
        width: 100%;
        height: 26px;
        line-height: 26px;
      }

      input:invalid {
        box-shadow: none;
      }

      input:not(:valid) ~ .close-button {
        display: none;
      }

      input:not(:valid) ~ .search-icon {
        display: block;
      }

      .search-icon {
        display: none;
        width: 18px;
        height: 18px;
        position: absolute;
        top: 5px;
        right: 0;

        &:before {
          content: '';
          position: absolute;
          width: 9px;
          height: 9px;
          box-sizing: border-box;
          border: solid 2px $G400;
          border-radius: 50%;
          top: 3px;
          left: 3px;
        }

        &:after {
          content: '';
          position: absolute;
          top: 10px;
          left: 9px;
          width: 2px;
          height: 5px;
          background-color: $G400;
          border-radius: 1px;
          transform: rotate(-45deg);
          transform-origin: 1px top;
        }
      }

      .close-button {
        cursor: pointer;
        width: 18px;
        height: 18px;
        position: absolute;
        top: 5px;
        right: 0;

        &:after,
        &:before {
          content: "";
          display: block;
          width: 2px;
          height: 14px;
          background-color: $G400;
          border-radius: 1px;
          position: absolute;
          top: 2px;
          left: 8px;
          transform: rotate(45deg);
        }

        &:before {
          transform: rotate(-45deg);
        }
      }
    }

    .font-cards {
      margin-top: 15px;
      overflow: auto;
      margin-right: -12px;
      padding-right: 12px;
    }
  }

  .section.section-font-info {
    position: relative;
    height: 210px;
    overflow: auto;

    .font-card {
      margin-top: 15px;
    }

    table.font-info__table {
      margin-top: 15px;
      margin-bottom: 10px;
      width: 100%;

      tr td,
      tr th {
        text-align: left;
        padding-bottom: 12px;
      }

      tr:last-child {
        td,
        th {
          padding-bottom: 0;
        }
      }

      tr th {
        padding-right: 15px;
        box-sizing: border-box;
        width: 32%;
      }

      tr td {
        width: 68%;
      }

      a {
        text-decoration: none;

        &:hover {
          text-decoration: underline;
        }
      }
    }
  }
}

.canvas {
  background-color: $textBackgroundColor;
  color: $textColor;
  height: calc(100vh - 39px);
  position: absolute;
  top: 39px;
  overflow: auto;
}

.panel {
  width: 242px;
  height: calc(100vh - 39px);
  background-color: $G200;
  border-left: 2px solid $G300;
  position: absolute;
  top: 39px;
  right: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;

  .section.section-font-size {
    padding: 5px 10px;
  }

  .section.section-preset-variations {
    .variations {
      margin-top: 15px;
      max-height: 90px;
      overflow-y: auto;
      margin-right: -12px;
      padding-right: 12px;
    }
  }

  .section.section-variable-options {
    display: flex;
    flex-direction: column;
    min-height: 0;

    .slider-2d {
      flex-shrink: 0;
      margin-top: 0;
      margin-bottom: 5px;
    }

    .sliders {
      margin-right: -12px;
      padding-right: 12px;
      overflow: auto;
      margin-top: 5px;
    }

    .slider {
      margin-bottom: 5px;
    }
  }

  .section.section-code {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex-grow: 1;

    code {
      background-color: $G100;
      color: $G700;
      border-radius: 3px;
      border: solid 1px $G300;
      display: block;
      font-family: $mono;
      font-variation-settings: 'wght' 450, 'wdth' 500, 'slnt' 0;
      font-size: 11px;
      line-height: 1.3;
      margin-top: 15px;
      padding: 10px 6px;
      white-space: pre;
      overflow: auto;
      word-wrap: break-word;

      span.css-for-canvas-object {
        display: block;
        cursor: pointer;
        width: max-content;
        min-width: calc(100% + 6px);

        &.highlight {
          background-color: $G700;
          color: $G100;
        }

        &:hover {
          color: $vfColor;
        }
      }
    }
  }

  .section.section-export {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    width: 100%;
    background-color: $G200;

    .button {
      margin-left: 12px;

      &.copied {
        position: relative;
        border-color: $A100;

        &:after {
          content: "Copied";
          position: absolute;
          color: $G100;
          background-color: $A100;
          left: 0;
          width: 100%;
          height: 26px;
          text-align: center;
          border-radius: 2px;
        }
      }

      &.button-export {
        margin-left: 0;
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;

        path {
          fill: $G500;
        }
      }
    }

    #form-export {
      display: flex;
      flex-grow: 1;
    }

    button:focus {
      outline: none;
    }
  }
}

.about {
  background-color: $textBackgroundColor;
  width: 600px;
  margin: 80px auto;
  font-family: $sans;
  font-variation-settings: 'wght' 99;
  color: $textColor;
  font-size: 16px;
  line-height: 24px;

  h1 {
    margin: 22px 0 0;
    font-variation-settings: 'wght' 156;
  }

  p {
    font-variation-settings: 'wght' 99;
    margin: 11px 0;
  }

  ul {
    margin: 11px 0;

    li {
      font-variation-settings: 'wght' 99;
    }
  }

  a {
    color: $textColor;
  }
}

.section {
  border-top: 2px solid $G300;
  padding: 10px 12px;
  box-sizing: border-box;

  &.section-code,
  &:first-child {
    border-top: none;
  }
}

.font-card {
  background-color: $G100;
  border: 1px solid $G300;
  padding: 5px 9px;
  cursor: pointer;
  transition: border-color $transition;
  border-radius: 3px;
  margin-bottom: 6px;
  position: relative;

  &.active {
    border-color: $A100;
  }

  .font-preview {
    font-size: 20px;
    line-height: 26px;
    height: 26px;
    overflow: hidden;
    white-space: nowrap;
    font-family: $sans;
    font-variation-settings: 'dfat' 0;
    color: $G600;
    margin-right: -9px;
    position: relative;

    &:after {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      width: 20px;
      background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 90%);
    }
  }

  .label-text {
    line-height: 15px;
    height: 15px;
    white-space: nowrap;
    overflow: hidden;
    margin-right: 30px;
    margin-bottom: 2px;
    color: $G700;
  }

  .badge-text {
    line-height: 15px;
    height: 15px;
    position: absolute;
    top: 5px;
    right: 8px;

    &:before {
      content: '';
      position: relative;
      display: inline-block;
      top: 1px;
      width: 11px;
      height: 11px;
      margin-right: 3px;
      background-image: url("../images/variable-font.svg");
    }
  }
}

.variation-card {
  background-color: $G100;
  color: $G700;
  border: 1px solid $G300;
  font-size: 12px;
  line-height: 28px;
  height: 28px;
  box-sizing: border-box;
  border-radius: 3px;
  margin-bottom: 6px;
  padding-left: 5px;
  cursor: pointer;
  transition: border-color 0.2s ease;

  &.active {
    border-color: $A100;
  }

  span.specimen {
    font-size: 20px;
    float: right;
    margin-right: 5px;
    line-height: 26px;
    color: $G600;
  }
}

.slider-2d {
  position: relative;
  width: 216px;
  height: 116px;
  overflow: hidden;
  cursor: crosshair;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 1px solid $G300;
    background-color: $G100;
    border-radius: 3px;
  }

  &:active .handle:before {
    border-width: 8px;
  }

  .handle {
    position: absolute;
    left: 20%;
    top: 20%;
    width: 16px;
    height: 16px;
    cursor: move;

    &::before {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      box-sizing: border-box;
      border: 2px solid $G500;
      background-color: $G100;
      border-radius: 50%;
      transition: border $transition;
    }

    .axis-x-line {
      position: absolute;

      &:after,
      &:before {
        content: "";
        position: absolute;
        width: 216px;
        height: 2px;
        top: 7px;
      }

      &:before {
        background-color: $G300;
        left: -220px;
      }

      &:after {
        background-color: $G300;
        right: -236px;
      }
    }

    .axis-y-line {
      position: absolute;

      &:after,
      &:before {
        content: "";
        position: absolute;
        width: 2px;
        height: 216px;
        left: 7px;
      }

      &:before {
        background-color: $G300;
        top: -220px;
      }

      &:after {
        background-color: $G300;
        bottom: -236px;
      }
    }
  }
}

.slider {
  span.radio-button {
    float: left;
    margin-right: 6px;
    position: relative;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    background-color: $G100;
    border: 1px solid $G400;
    border-radius: 3px;
    cursor: pointer;

    &:before {
      content: '';
      position: absolute;
      top: 6px;
      left: 0;
      width: 100%;
      border-top: solid 2px $G300;
    }

    &:after {
      content: '';
      position: absolute;
      top: 0;
      left: 6px;
      width: 2px;
      height: 14px;
      background-color: $G300;
    }
  }

  &.selected {
    span.radio-button {
      border: none;
      background-color: transparent;
      cursor: default;

      &:before {
        content: 'x';
        width: 100%;
        top: 2px;
        left: 0;
        border-top: solid 2px $G400;
        color: $G400;
        font-variation-settings: 'wght' 156;
        line-height: 12px;
        text-align: center;
      }

      &:after {
        content: '';
        width: 2px;
        height: 6px;
        top: 0;
        left: 14px;
        background-color: $G400;
      }
    }
  }

  &.selected ~ &.selected {
    span.radio-button {
      width: 16px;
      height: 16px;
      border: none;
      background-color: transparent;
      border-radius: 0;
      position: relative;
      cursor: default;

      &:before {
        content: 'y';
        top: 0;
        left: 2px;
        height: 100%;
        border-top: none;
        border-left: solid 2px $G400;
        width: 11px;
        line-height: 10px;
        text-align: right;
      }

      &:after {
        content: '';
        width: 6px;
        height: 2px;
        top: 14px;
        left: 0;
        background-color: $G400;
      }
    }
  }

  label {
    float: left;
    line-height: 16px;
  }

  input[type=text] {
    line-height: 16px;
    float: right;
    padding: 0 6px 3px 0;
    width: 50px;
    text-align: right;
  }

  input[type=range] {
    margin-top: 2px;
    clear: both;
  }
}

.tip-text {
  font-family: $sans;
  font-variation-settings: 'wght' 99;
  font-size: 10px;
  white-space: nowrap;
  position: absolute;
  pointer-events: none;
  display: none;
  z-index: 9;
  color: $vfColor;

  [class$="-handle"] & {
    top: 10px;
    left: 10px;
  }

  .tool & {
    top: 13px;
    left: 30px;
    color: $textColor;
    background-color: $textBackgroundColor;
  }

  .vf-xheight-line & {
    left: calc(100% + 5px);
    top: -5px;
  }

  .tool:hover &,
  .vf-xheight-line:hover &,
  [class$="-handle"]:hover & {
    display: block;
  }

  .tool:active &,
  .vf-xheight-line:active &,
  [class$="-handle"]:active & {
    display: none;
  }
}