@import url('https://fonts.googleapis.com/css2?family=Sono:wght,MONO@200..800,0..1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100..800&display=swap');

pre code {
  font-family: Sono;
  font-variation-settings: "MONO" 1;
  font-weight: 300;
  font-size: 0.75em;
  line-height: 1;
}
.mono pre {
  font-family: monospace;
  font-weight: 100;
  font-size: 0.76em !important;
  line-height: 1.25em !important;
}

.amok {
  background-color: #023;
  margin: 0 -1em 0 -1em;
  &>pre {
    background-color: #023;
    color: #cb8;
    font-variation-settings: "MONO" 1;
    padding: 0.8em 1em;
    margin: 0;
    overflow-x: auto;
    scrollbar-color: #fff3 transparent;
    scrollbar-width: thin;
    &>.line {
      padding: 0.05em 0;
      display: block;
      height: 1.25em;
      line-height: 1.25em;
      &>.hi { --caption-color: 187, 187, 255; }
      &>.err { --caption-color: 255, 0, 68; }
      &>.warn { --caption-color: 255, 170, 0; }
      &>.param { font-style: italic; }
      & code {
        white-space: pre;
        border-bottom: solid 1px rgba(var(--caption-color), 0.5);
        background-color: rgba(var(--caption-color), 0.25);
        display: inline-block;
        margin: 0;
        padding: 0;
        vertical-align: middle; }
      &>span:hover {
        &>.caption {
          transition: height ease 0.2s 0.1s, width ease 0.2s;
          &>span {
            opacity: 1;
            transition: opacity ease 0.2s 0.2s; } } }
      &>span:not(:hover) {
        &>.caption {
          height: 0 !important;
          width: 0 !important;
          &>span {
            height: 0;
            transition: opacity ease 0.2s; } } }
      &>span {
        font-weight: 500;
        cursor: pointer;
        &>.caption {
          font-family: Sono;
          backdrop-filter: blur(2px);
          position: absolute;
          transition: height ease 0.2s, width ease 0.2s 0.1s;
          margin-top: 1.92em;
          font-weight: 350;
          font-size: 0.55em;
          color: white;
          padding: 0;
          line-height: 1.5em;
          background-color: rgba(var(--caption-color), 0.25);
          border-bottom: dotted 1px rgba(var(--caption-color), 0.5);
          &::after {
            background-color: rgb(var(--caption-color));
            content: '';
            position: absolute;
            bottom: -2.5px;
            right: -2.5px;
            width: 4px;
            height: 4px;
            border-radius: 50%; }
          &>span {
            opacity: 0;
            overflow: hidden;
            display: inline-block;
            margin: 0 0.5ch; } } } } }
  & input[type=radio] { display: none; }
  & .before:checked ~ pre {
    & .one {
      opacity: 1;
      transition: height ease 1s 1s, width ease 1s 1s, opacity ease 1s 2s; }
    & .two {
      opacity: 0;
      transition: height ease 1s 1s, width ease 1s 1s, opacity ease 1s; }
    &>.two { height: 0; }
    &>.line>.two { width: 0 !important; } }
  & .after:checked ~ pre {
    & .one {
      opacity: 0;
      transition: height ease 1s 1s, width ease 1s 1s, opacity ease 1s; }
    & .two {
      opacity: 1;
      transition: height ease 1s 1s, width ease 1s 1s, opacity ease 1s 2s; }
    &>.one { height: 0; }
    &>.line>.one { width: 0 !important; } }
  & .before:checked + label::after {
    background-color: #fc3;
    color: black; }
  & .after:checked + label::before {
    background-color: #fc3;
    color: black; }
  & .before + label {
    width: 50%;
    text-align: right; }
  & label {
    cursor: pointer;
    font-size: 0.6em;
    color: #fffc;
    font-weight: 400;
    display: inline-block;
    text-transform: uppercase;
    padding: 0;
    margin: 1em 0 0 0;
    &::before, &::after {
      transition: background-color ease 0.3s, color ease 0.3s;
      display: inline-block;
      width: 1.8em;
      height: 1.7em;
      color: #fc2;
      border-radius: 50%;
      cursor: pointer;
      border: solid 0.15em #fc2;
      text-align: center;
      margin-left: 0.7em;
      margin-right: 0.7em; }
    &:hover::before {
      background-color: #fc3;
      color: black; }
    &:nth-of-type(1)::after { content: '1'; }
    &:nth-of-type(2)::before { content: '2'; } }
  & .error { color: #cc0033; }
  & .number { color: #cc3366; }
  & .modifier { color: #ff9966; }
  & .keyword { color: #ff6633; }
  & .ident { color: #ffcc99; }
  & .term { color: #ffcc33; }
  & .typed { color: #00cc99; }
  & .string { color: #99ddbb; }
  & .parens { color: #cc6699; }
  & .symbol { color: #cc3366; }
  & .unparsed { color: #2288aa; } } }
