@import url('https://fonts.googleapis.com/css?family=Press+Start+2P&display=swap');

:root {
  /* measure */
  --ratio: 1.5;
  --s-5: calc(var(--s-4) / var(--ratio)); /* 0.131 */
  --s-4: calc(var(--s-3) / var(--ratio)); /* 0.197 */
  --s-3: calc(var(--s-2) / var(--ratio)); /* 0.296 */
  --s-2: calc(var(--s-1) / var(--ratio)); /* 0.44 */
  --s-1: calc(var(--s0) / var(--ratio)); /* 0.66 */
  --s0: 1rem;
  --s1: calc(var(--s0) * var(--ratio)); /* 1.5 */
  --s2: calc(var(--s1) * var(--ratio)); /* 2.5 */
  --s3: calc(var(--s2) * var(--ratio)); /* 3.75 */
  --s4: calc(var(--s3) * var(--ratio)); /* 5.625 */
  --s5: calc(var(--s4) * var(--ratio)); /* 8.4375 */
  --s6: calc(var(--s5) * var(--ratio));
  --s7: calc(var(--s6) * var(--ratio));

  /* colors */
  --color-accent: #7c6efb;
  --color-dark: #0b0b0b;
  --color-light: rgb(114, 106, 106);
  --color-success: rgb(59, 124, 59);
  --color-white: #fff;

  /* fonts */
  --font-plain: 'Press Start 2P', sans-serif;

  /* typography */
  --fs-text: 1rem;
  --fs-text-small: 0.875rem;
  --fs-text-big: 1.5rem;
  --fs-text-biggish: 2rem;
  --fs-text-bigger: 2.5rem;

  --fw-normal: 400;
  --fw-bold: 700;

  /* globals */
  /*   font-size: calc(0.333vw + 1em); */
  line-height: var(--ratio);
  font-family: var(--font-plain);
}

html {
  box-sizing: border-box;
}

*,
*::after,
*::before {
  border: 0 solid;
  box-sizing: inherit;
  color: inherit;
  font: inherit;
  margin: 0;
  overflow-wrap: break-word;
  padding: 0;
}

body {
  background-color: var(--color-dark);
  color: var(--color-white);
  font-size: var(--fs-text);
  min-height: 100vh;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

/* remove animations when people turned them off */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -----
  LAYOUT
------------------------------------ */
.box-l {
  background-color: var(--color-light);
  /* for accessibility */
  outline: 0.125rem solid transparent;
  outline-offset: -0.125rem;
  padding: var(--s1);
}

.center-l {
  box-sizing: content-box;
  margin-inline: auto;
  max-width: 720px;
  padding-inline-end: var(--s-1);
  padding-inline-start: var(--s-1);
}

.center-l * {
  box-sizing: border-box;
}

.cluster-l {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space, 1.5rem);
  justify-content: space-between;
}

[class^='stack-'] {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-block-start: var(--s-1);
}

.stack-large > * + * {
  margin-block-start: var(--s4);
}

.stack-small > * + * {
  margin-block-start: var(--s2);
}

.switcher-l {
  --threshold: 40rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter, var(--s1));
}

.switcher-l > * {
  flex-basis: calc((var(--threshold) - 100%) * 999);
  flex-grow: 1;
}

@media (min-width: 40rem) {
  [class^='stack-'] {
    padding-block-start: var(--s2);
  }
}
/* -----
  HEADER
------------------------------------ */
.header {
  border-bottom: 0.5rem solid var(--color-white);
  position: relative;
}

.header__title {
  font-size: var(--fs-text-big);
  margin-block-end: var(--s4);
  margin-block-start: var(--s2);
  order: 1;
  text-align: center;
}

.header__number {
  align-self: center;
  bottom: 0;
  font-size: var(--s2);
  max-width: var(--s7);
  min-width: var(--s5);
  order: 1;
  position: absolute;
  text-align: center;
  transform: translateY(50%);
}

.header__text {
  font-size: 0.7rem;
}

.header.stack-small {
  padding-block: 0;
}

.header.stack-small > :nth-child(2) {
  margin-block-start: 0;
}

@media (min-width: 40rem) {
  .header__title {
    margin-block-end: var(--s5);
  }
}

/* -----
  RESULT
------------------------------------ */
.result__title {
  color: var(--color-accent);
}

.result__title::first-letter,
.result__text::first-letter {
  font-size: var(--fs-text-big);
}

.result.stack-small > * + * {
  margin-block-start: var(--s-1);
}

/* -----
  BUTTON
------------------------------------ */

.btn {
  color: var(--color-dark);
  position: relative;
  padding: var(--s-1) var(--s-2);
  background-color: var(--color-white);
  cursor: pointer;
  max-width: var(--s6);
}

.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  top: 0.1rem;
  left: 0.1rem;
  height: 100%;
  background-color: var(--color-light);
  z-index: -1;
}

.btn:hover::after,
.btn:focus::after {
  top: 0;
  left: 0;
}

/* -----
  INPUT
------------------------------------ */
input {
  display: block;
  border: 2px solid var(--color-white);
  background-color: var(--color-dark);

  width: 25%;
  font-size: var(--fs-text-big);
  height: 4rem;
  color: var(--color-white);
  text-align: center;
}

input::selection {
  background-color: var(--color-accent);
}

/* -----
  UTILITIES
------------------------------------ */
.highlight {
  background-color: var(--color-success);
}

.disabled {
  display: none;
}
