:root {
  --primary-color: var(--msem-color-primary, #335fff);
  --secondary-color: var(--msem-color-secondary, #b3c3cc);
  --grey-lighter: var(--msem-color-lightest, #fff);
  --grey-light: var(--msem-color-lighter, #fafafa);
  --grey-dark: var(--msem-color-mediumlight, #ccc);
  --grey-darker: var(--msem-color-darker, #333);
  --shadow: 0.15em 0.15em 1em rgba(0, 0, 0, 0.15);
}
html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  background-color: var(--grey-light);
  background-image: url(https://www.msem.tech/static/images/misc/topography.svg);
  background-repeat: repeat;
  accent-color: var(--primary-color);
  color: var(--grey-darker);
  & > svg {
    display: none;
  }
  .shapes {
    position: absolute;
    inset-block-start: 0;
    inline-size: 100vw;
    block-size: 100vh;
    overflow: hidden;
  }
  .shape1 {
    --circle-size: 750px;
    --light-red: 360, 82%, 53%;
    --dark-red: 360, 92%, 40%;
    position: absolute;
    inset-block-start: calc(var(--circle-size) / 2 * -1);
    inset-inline-start: calc(50% - var(--circle-size) / 2);
    inline-size: var(--circle-size);
    block-size: var(--circle-size);
    background: radial-gradient(circle at center, hsla(var(--dark-red), 20%) 0, hsla(var(--light-red), 0) 50%) no-repeat;
    border-radius: 60% 40% 40% 30% / 20% 60% 60% 40%;
    transform-origin: 50% calc(50% + 200px);
    /* animation: circular-move 10s linear infinite; */
    mix-blend-mode: hard-light;
  }
  .shape2 {
    --circle-size: 800px;
    --dark-blue: 222, 99%, 40%;
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: calc(var(--circle-size) / 4 * -1);
    inline-size: var(--circle-size);
    block-size: var(--circle-size);
    background: radial-gradient(circle at center, hsla(var(--dark-blue), 15%) 0, hsla(var(--dark-blue), 0) 70%)
      no-repeat;
    /* animation: horizontal-move 10s ease infinite; */
    mix-blend-mode: hard-light;
  }
}
header {
  display: flex;
  align-items: end;
  margin: 1em 2.5em;
  gap: 1em;
  font-size: 1.5em;
  svg {
    block-size: auto;
    flex: 0 0 8em;
    color: var(--primary-color);
    transition: all 0.16s cubic-bezier(0.4, 0.1, 0.2, 0.9);
  }
  h2 {
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
main#root {
  fieldset {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(24em, 1fr));
    justify-content: center;
    gap: 1em;
    padding: 5.5em 1em 1em;
    margin: 3em;
    border-radius: 1em;
    border: 1px solid var(--grey-dark);
    background-color: var(--grey-lighter);
    box-shadow: var(--shadow);
  }
  legend {
    position: absolute;
    inset-inline-end: 0;
    inset-inline-start: 0;
    padding: 1em 1.5em;
    font-size: 1.25em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0.75em 0.75em 0 0;
    background: var(--grey-light);
    color: var(--primary-color);
    border-block-end: 1px solid var(--grey-dark);
  }
  label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0 0.5em;
    white-space: nowrap;
  }
  label a {
    display: contents;
  }
  label svg {
    fill: var(--grey-lighter);
    inline-size: 1em;
    block-size: 1em;
    flex: 0 0 1em;
    border-radius: 50%;
    background-color: var(--secondary-color);
  }
  select {
    background: url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='%23000000' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>")
      no-repeat;
    background-position: calc(100% - 0.75em) center;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
  }
  select,
  input[type="text"],
  input[type="number"],
  input[type="date"] {
    max-inline-size: 15em;
    min-inline-size: 10em;
    padding: 0.5em;
    font-weight: 700;
    font-family: inherit;
    font-size: 1em;
    border-radius: 0.5em;
    border: 1px solid var(--grey-dark);
    background-color: var(--grey-light);
  }
  input[type="checkbox"] {
    inline-size: 1.5em;
    block-size: 1.5em;
  }
  select {
    padding: 0.5em 2em 0.5em 1em;
  }
}
section#result {
  display: none;
  position: relative;
  margin: 3em;
  nav {
    display: flex;
    position: absolute;
    inset-block-start: 0.75em;
    inset-inline-end: 0.75em;
    gap: 0.5em;
    z-index: 1;
    button {
      padding: 0.5em 1.5em;
      white-space: nowrap;
      font-size: 1.15em;
      font-weight: 700;
      font-family: inherit;
      border: none;
      border-radius: 2em;
      color: var(--grey-lighter);
      background-color: var(--primary-color);
      box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.2);
    }
    button.secondary {
      font-size: 1em;
      font-weight: 400;
      color: var(--grey-darker);
      background-color: var(--grey-dark);
      box-shadow: none;
    }
  }
}
/* @keyframes circular-move {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
  to {
    transform: rotate(1turn);
  }
}
@keyframes horizontal-move {
  0% {
    transform: translate3d(-50%, -10%, 0);
  }
  50% {
    transform: translate3d(50%, 10%, 0);
  }
  to {
    transform: translate3d(-50%, -10%, 0);
  }
} */
@media (max-width: 675px) {
  header {
    margin: 1em;
    gap: 0.5em;
    svg {
      block-size: auto;
      flex: 0 0 4em;
    }
    h2 {
      font-size: 1em;
    }
  }
  main#root {
    fieldset {
      margin: 1em;
    }
  }
  section#result {
    margin: 1em;
  }
}
@media (max-width: 500px) {
  section#result {
    nav {
      button.secondary {
        display: none;
      }
    }
  }
}

/* Prism theme */

:root {
  --color-fg-default: #000;
  --color-gray: #6e7781;
  --color-red: #e61b29;
  --color-green: #00671e;
  --color-blue: #0062dd;
  --color-indigo: #7500ff;
}
pre[class*="language-"] {
  color: var(--color-fg-default);
  direction: ltr;
  text-align: start;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  line-height: 1.5;
  tab-size: 2;
  hyphens: none;

  font-size: 1em;
  font-family: monospace;
  padding: 4em 3em;
  margin: 0.5em 0;
  overflow: auto;
  border-radius: 1em;

  background-color: var(--grey-lighter);
  border-block-end: 1px solid var(--grey-dark);
  box-shadow: var(--shadow);
}
.token.comment,
.token.prolog,
.token.cdata {
  color: var(--color-gray);
}
.token.doctype,
.token.punctuation,
.token.entity {
  color: var(--color-fg-default);
}
.token.attr-name,
.token.class-name,
.token.boolean,
.token.constant,
.token.number,
.token.atrule,
.token.selector,
.token.string,
.token.char,
.token.builtin,
.token.inserted,
.token.regex,
.token.attr-value,
.token.attr-value > .token.punctuation {
  color: var(--color-blue);
}
.token.keyword {
  color: var(--color-red);
}
.token.property,
.token.tag,
.token.symbol,
.token.deleted,
.token.important,
.token.url {
  color: var(--color-green);
}
.token.variable,
.token.operator,
.token.function {
  color: var(--color-indigo);
}
.token.bold {
  font-weight: bold;
}
.token.comment,
.token.italic {
  font-style: italic;
}
.token.namespace {
  opacity: 0.8;
}
