* {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  box-sizing: border-box;
}


html,
body {
  min-height: 100vh;
  position: relative;
  color: var(--color-text);
  background: var(--color-bg);
}


/* Elements */

.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0); 
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap; 
  width: 1px;
}

.btn {
  line-height: 1.5;
  cursor: pointer;
  border: none;
  font-size: 1em;
  padding-bottom: 0.5em;
  padding-left: 0.5em;
  padding-top: 2em;
  padding-right: 4em;
  display: inline-flex;
  font-weight: 300;
  gap: 0.5em;
  align-items: flex-end;
}

@media (/*breakpoint*/max-width: 600px) {
  .btn {
    padding-right: 2em;
  }
}


.btn--text {
  color: var(--color-text);
}

.btn--outlined {
  color: var(--color-main);
  text-decoration: none;
  border: 1px solid var(--color-main);
}

.btn--outlined:hover {
  background-color: var(--color-main);
  color: var(--color-main-contrast);
}

.btn--contained {
  background: var(--color-main);
  color: var(--color-main-contrast);
  text-decoration: none;
}

.btn--contained:hover {
  background: var(--color-main--darker);
}

.btn--contained-dark {
  background: var(--color-text);
}

.btn--contained-dark:hover {
  background: var(--color-text--lighter);
}

.btn--contained-light {
  background-color: var(--color-grey-superlight);
  color: var(--color-text);
}

.btn--contained-light:hover {
  background-color: var(--color-grey-superlight--darker);
}

.labelled-btn {
  display: inline-flex;
  flex-direction: column;
  gap: 0.5em;
}

.labelled-btn__label {
  font-size: var(--font-size-label);
  padding: 0.5em;
}


/* Header */

.main-header__wrapper {
  max-width: 80em;
  margin: 0 auto;
}

.main-header {
  display: flex;
  flex-direction: row;
  
  width: 100%;
  padding: 1em;
  gap: 1em;
  align-items: flex-start;
}

.main-header__nav {
  display: flex;
  justify-content: flex-end;
}

.main-header__links {
  display: flex;
}

.flex-grow {
  flex-grow: 1;
}

.main-header__header {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

@media (/*breakpoint*/max-width: 600px) {
  .main-header__header {
    
    flex-direction: column;
  }
  
}


.main-header__header-logo-wrapper {
  background-color: var(--color-main);
  height: 4em;
  width: 4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-header__header-logo-img {
  width: 2em;
}

/* Cover */

.cover {

  gap: var(--padding-screen);
  display: flex;
  align-items: center;
  flex-direction: column;
}

.cover__slogan {
  padding: 0 var(--padding-screen);
  text-align: center;
  max-width: 20em;
  font-size: var(--font-size-h1);
  line-height: 1.5;
}

.cover__slogan-explanation {
  padding: 0 var(--padding-screen);
  line-height: 1.5;
  text-align: center;
  max-width: 30em;
  font-size: var(--font-size-h2);
}

.labelled-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
}

.cover__video-description {
  display: flex;
  gap: 0.2em;
  align-items: center;
}

.cover__video {
  --width: min(80em, 80vw);
  width: var(--width);
  height: calc(9 / 16 * var(--width));
  padding-bottom: var(--padding-screen);
}

@media (/*breakpoint*/max-width: 60em) {
  .cover__video {
    --width: 100vw;
  }
}

.highlight {
  background: rgba(255, 217, 0, 0.25);
  padding: 0.1em 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.highlight--green {
  background: rgba(51, 255, 0, 0.25);
}

.underline {
  text-decoration: underline;
}


/* Pricing */

#pricing {
  min-height: 100vh;
  display: flex;
}

.pricing-layout {
  width: 100%;
  display: grid;
  grid-template: 
    "content calculator" min-content
    "illustration calculator" 1fr
    / 1fr max-content;
}

@media (/*breakpoint*/max-width: 60em) {
  .pricing-layout {
    grid-template: 
      "content" min-content
      "calculator" 1fr
      / 1fr;
  }
}

.pricing-layout__content {
  padding: var(--padding-screen);
  display: flex;
  background: var(--color-bg);
  justify-self: flex-end;
  gap: var(--padding-screen);
  flex-wrap: wrap;
  grid-area: content;
  justify-content: flex-end;
}

.pricing__actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.pricing__description {
  max-width: 20em;
}

.pricing-layout__illustration {
  grid-area: illustration;
  background-size: cover;
  background-position: center center;
  background-image: url("./pricing_illustration.jpg");
}
.pricing-layout__calculator {
  padding: var(--padding-screen);
  grid-area: calculator;
  background-color: var(--color-grey-superlight);
  display: flex;
  justify-content: center;
}

#time-spent-label {
  line-height: 1.5;;
}

.time-spent-input {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.slider {
  display: flex;
  gap: 0.5em;
  align-items: center;
  flex-direction: column;
}

#time-spent-input-current {
  place-self: flex-start;
}

.time-spent-label__list {
  list-style-position: inside;
  list-style-type: disc;
}

.calculator-cta {
  display: flex;
  justify-content: flex-end;
}

#calculator-form {
  display: flex;
  gap: 2em;
  flex-direction: column;
  max-width: 30em;
  position: sticky;
  place-self: flex-start;
  top: 0px;
}

#current-spendings-calculator-form {
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.calculator-input {
  
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.calculator-input__field {
  padding: 1em;
  background: white;
  border: 1px solid black;
  border-radius: 0;
}

.pricing__description {
  font-size: var(--font-size-h1);
  line-height: 1.5;
}

.calculator__header, .comparison-chart__header {
  font-size: var(--font-size-h2);
  line-height: 1.5;
  font-weight: bold;
}

#comparison-chart {
  max-width: 30em;
  min-height: 95vh;
  display: none;
  gap: 2em;
  flex-direction: column;
  line-height: 1.5;
  --howlong-percentage: 0.4;
  --color-background: transparent;
  --color-scale: rgba(0, 0, 0, 0.1); 
}

.comparison-chart__cta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.comparison-chart__actual-chart {
  flex-grow: 1;
}

.comparison-chart__halves {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.comparison-chart__current {
  padding: 1em;
  background: #E10202;
  color: white;
  display: block;
  overflow: hidden;
}

.comparison-chart__current-label {
}

.comparison-chart__current-amount {
  font-size: 2em;
  font-weight: bold;
}

.comparison-chart__howlong {
  --bar-height: calc(100% * var(--howlong-percentage));
  --scale-height: var(--bar-height);
  background: repeating-linear-gradient(360deg, var(--color-background), var(--color-background) var(--bar-height), var(--color-scale) var(--bar-height), var(--color-scale) calc(var(--bar-height) + 1px));
  position: relative;
  display: block;
  color: #2F750E;
}

.comparison-chart__howlong-label {
  padding: 1em;
  position: absolute;
  z-index: 2;
  bottom: calc(min(1, max(0, 0.5 - var(--howlong-percentage) )* 99999999999) * var(--bar-height))
}

.comparison-chart__howlong-bar {
  position: absolute;
  bottom: 0;
  background: #C0FFA3;
  width: 100%;
  height: var(--bar-height)
}

.comparison-chart__axis {
  height: 1px;
  background-color: black;
  width: 100%;
}

.comparison-chart__axis-description {
  text-align: end;
}

/* Document */

.document {
  max-width: max(66%, 30em);
  margin: 0 auto;
}

/* Footer */

.page-footer__bg {
  display: grid;
  background: var(--color-text);
  color: rgb(130, 130, 130);
}

.page-footer__lists {
  min-height: 100%;
  display: flex;
  gap: 3em;
  align-items: flex-start;
  justify-content: flex-end;
}

@media (/*breakpoint*/max-width: 600px) {
  .page-footer__lists {
    align-items: flex-end;
    flex-direction: column;
    text-align: right;
  }
}

.page-footer__list-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--gap-list);
}

.page-footer__list-header {
  font-weight: lighter;
  font-size: var(--font-size-h2);
}

.page-footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-list);
}

.page-footer__link {
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.page-footer__link:hover {
  text-decoration: underline;
}


/* Video modal */

#modal-video iframe {
  width: 100%;
  height: 100%;
}


/* Slider */
input[type=range] {
  width: 100%;
  margin: 14.2px 0;
  background-color: transparent;
  -webkit-appearance: none;
}
input[type=range]:focus {
  outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
  background: rgba(0, 0, 0, 0.2);
  border: 0;
  width: 100%;
  height: 7.6px;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  margin-top: -14.2px;
  width: 16px;
  height: 36px;
  background: #000000;
  border: 2.9px solid #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  box-shadow: none;
  border-radius: 0;
}
input[type=range]:focus::-webkit-slider-runnable-track {
  background: #0d0d0d;
}
input[type=range]::-moz-range-track {
  background: rgba(0, 0, 0, 0.2);
  border: 0;
  width: 100%;
  height: 7.6px;
  cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 36px;
  background: #000000;
  border: 2.9px solid #ffffff;
  cursor: pointer;
  box-shadow: none;
  border-radius: 0;
}
input[type=range]::-ms-track {
  background: transparent;
  border-color: transparent;
  border-width: 14.2px 0;
  color: transparent;
  width: 100%;
  height: 7.6px;
  cursor: pointer;
}
input[type=range]::-ms-fill-lower {
  background: #000000;
  border: 0;
}
input[type=range]::-ms-fill-upper {
  background: rgba(0, 0, 0, 0.2);
  border: 0;
}
input[type=range]::-ms-thumb {
  width: 16px;
  height: 36px;
  box-shadow: none;
  background: #000000;
  border: 2.9px solid #ffffff;
  cursor: pointer;
  margin-top: 0px;
  border-radius: 0;
  /*Needed to keep the Edge thumb centred*/
}
input[type=range]:focus::-ms-fill-lower {
  background: rgba(0, 0, 0, 0.2);
}
input[type=range]:focus::-ms-fill-upper {
  background: #0d0d0d;
}
/*TODO: Use one of the selectors from https://stackoverflow.com/a/20541859/7077589 and figure out
how to remove the virtical space around the range input in IE*/
@supports (-ms-ime-align:auto) {
  /* Pre-Chromium Edge only styles, selector taken from hhttps://stackoverflow.com/a/32202953/7077589 */
  input[type=range] {
    margin: 0;
    /*Edge starts the margin from the thumb, not the track as other browsers do*/
  }
}
