/* CUSTOM VARIABLES */
:root {
  /* Colors */
  /* Primary colours */
  --clr-primary-100: #6f24bf;
  --clr-primary-200: #9358ce;
  --clr-primary-300: #b487dd;
  --clr-primary-400: #e7d1ff;
  --clr-primary-500: #ead6ff;
  --clr-primary-600: #eddbff;
  --clr-primary-700: #fbf6ff;

  /* Accent colours */
  --clr-accent-100: #a9ff30;
  --clr-accent-200: #caff6e;
  --clr-accent-300: #e5ffad;

  /* Surface colours */
  --clr-surface-100: #251930;
  --clr-surface-200: #3a2e44;
  --clr-surface-300: #504559;
  --clr-surface-400: #675d6f;
  --clr-surface-500: #7e7685;
  --clr-surface-600: #978f9c;

  /* Mixed colours */
  --clr-surface-mixed-100: #362842;
  --clr-surface-mixed-200: #4a3c55;
  --clr-surface-mixed-300: #5e5268;
  --clr-surface-mixed-400: #74697c;
  --clr-surface-mixed-500: #898091;
  --clr-surface-mixed-600: #a098a6;

  --clr-lightest: var(--clr-primary-700);

  --clr-grey: #666;
  --clr-lightgrey: #f5f5f5;

  /* Icons */
  --icon-clr-header: var(--clr-primary-500);
  --icon-clr-footer: var(--clr-primary-400);
  --icon-clr-primary: var(--clr-surface-600);

  /* Fonts */
  --ff-primary: 'Inter', sans-serif;
  --ff-body: var(--ff-primary);
  --ff-heading: var(--ff-primary);

  /* Font Weights */
  --fw-regular: 400;
  --fw-bold: 700;
  --fw-semibold: 600;

  /* Font Sizes */
  --fs-300: 0.8rem;
  --fs-400: 1rem;
  --fs-450: 1.2rem;
  --fs-500: 1.4rem;
  --fs-550: 1.6rem;
  --fs-600: 1.8rem;
  --fs-700: 2.2rem;
  --fs-750: 2.5rem;
  --fs-800: 2.8rem;

  /* Specific Font Sizes */
  --fs-body: var(--fs-400);
  --fs-primary-heading: var(--fs-800);
  --fs-secondary-heading: var(--fs-700);
  --fs-nav: var(--fs-400);
  --fs-button: var(--fs-400);

  /* Sizes */
  --size-200: 0.5rem;
  --size-300: 0.75rem;
  --size-400: 1rem;
  --size-500: 1.5rem;
  --size-600: 2rem;
  --size-700: 3rem;
  --size-800: 4rem;
  --size-900: 5rem;
  --ball-side-size: 550px;
  --response-size: 242px;

  /* Spacing */
  --ff-indent: 18px;
  --row-spacing: 2rem 0;
  --flow-margin: 1.4em;

  /* Border radius */
  --corners: 1.3em;
  --corners-sharp: 4px;
  --corners-pill: 20rem;

  /* Shadows */
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
  --shadow-images: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px,
    rgba(0, 0, 0, 0.3) 0px 18px 36px -18px;

  /* Page background colour */
  color: var(--clr-lightest);
  background-color: var(--clr-surface-100);
}

/* RESPONSIVE FONT SIZES */
@media (min-width: 50em) {
  :root {
    --fs-300: 0.9rem;
    --fs-400: 1.1rem;
    --fs-600: 2rem;
    --fs-700: 3rem;
    --fs-750: 3.5rem;
    --fs-800: 4.5rem;
  }
}

/* CSS REFRESH */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
* {
  margin: 0;
  padding: 0;
  font: inherit;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture,
svg {
  max-width: 100%;
  display: block;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* GENERAL STYLING */
body {
  font-size: var(--ff-body);
  font-family: var(--ff-primary);
  padding-bottom: 2em;
  line-height: 1.6;
}

/* Flexbox
// ================================================== */
.flex {
  display: flex;
}
.d--if {
  display: inline-flex;
}

/* Flex direction */
.fd--c {
  flex-direction: column;
}

/* Justify content */
.jc--c {
  justify-content: center;
}
.jc--sb {
  justify-content: space-between;
}

/* Align items */

.ai--c {
  align-items: center;
}

/* Gap sizes */

.gap-400 {
  gap: var(--size-400);
}
.gap-800 {
  gap: var(--size-800);
}

/* Buttons
// ================================================== */
.button {
  cursor: pointer;
  text-decoration: none;
  border-radius: 100vmax;
  padding: 1em 1.75em;
  font-size: var(--fs-button);
  font-weight: var(--fw-bold);
  line-height: 1;
  transition-timing-function: ease-in-out;
  transition: 0.2s;
}

.button--primary {
  background-color: var(--clr-primary-300);
  color: var(--clr-surface-100);
  border: 0;
}

.button--primary:hover,
.button--primary:focus-visible {
  background-color: var(--clr-primary-200);
}

.button--underlined {
  border-radius: 0;
  padding: 0;
  padding-bottom: 0.25em;
  border: 0;
  border-bottom: 2px solid var(--clr-surface-100);
  background: none;
  color: var(--clr-surface-100);
}

.button--underlined:hover,
.button--underlined:focus {
  border-color: var(--clr-primary-100);
  color: var(--clr-primary-100);
}

/* Navigation
// ================================================== */
.nav-bar {
  padding: var(--size-400) var(--size-700);
  gap: var(--size-700);
  border-radius: var(--corners-pill);
  box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px,
    rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.1) 0px 16px 56px;
  z-index: 500;
}

.mobile-nav-toggle {
  display: none;
}

.nav-list {
  list-style-type: none;
  font-size: var(--fs-nav);
  font-weight: var(--fw-semibold);
}

.nav-list a {
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus {
  color: var(--clr-primary-200);
}

@media (max-width: 50em) {
  .primary-navigation {
    display: none;
    position: fixed;
    padding: var(--size-600);
    inset: 7rem var(--size-400) auto;
    max-width: 25rem;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--corners-sharp);
    box-shadow: var(--shadow);
  }

  .primary-header[data-overlay]::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.8));
  }

  .nav-list {
    display: grid;
    gap: var(--size-500);
    text-align: center;
    font-weight: var(--fw-bold);
  }

  .primary-navigation[data-visible] {
    display: block;
  }

  .mobile-nav-toggle {
    display: block;
    position: fixed;
    top: var(--size-600);
    right: var(--size-500);
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0.5em;
    background-color: var(--clr-primary-500);
    border-radius: var(--corners-sharp);
  }

  .mobile-nav-toggle .icon-close {
    display: none;
  }
}

/* Dropdown menu
// ================================================== */

/* Dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Selected item and caret */
.select {
  cursor: pointer;
}

.caret {
  margin-left: 10px;
  border: solid var(--clr-lightest);
  border-width: 0 3px 3px 0;
  display: inline-block;
  padding: 3px;
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
  margin-bottom: 3px;
}

/* Dropdown menu */
.menu {
  display: none;
  position: absolute;
  background-color: hsl(from #763392 h s l / 0.9);
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  width: 100%;
  border-radius: 0.5em;
  margin-top: var(--size-200);
  list-style-type: none;
}

.menu li {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  margin: 4px;

  &:first-of-type {
    border-radius: 1em 1em 8px 8px;
  }
}

.menu li:hover {
  background-color: hsl(from #60237b h s l / 0.9);
}

/* Show the dropdown menu when clicked */
.select-clicked + .menu {
  display: block;
}

.select :where(:hover, :focus-within) {
  color: var(--clr-primary-300);
  border-color: var(--clr-primary-300);
}

/* Sprites
// ================================================== */
.header-logo {
  width: 130px;
  aspect-ratio: 1;
  fill: var(--icon-clr-header);
}

.footer-logo {
  width: 60px;
  aspect-ratio: 1;
  fill: var(--icon-clr-footer);
}

.nav-icon {
  width: 30px;
  aspect-ratio: 1;
  fill: var(--icon-clr-header);
}

/* Footer
// ================================================== */
.footer-nav a {
  text-decoration: none;
  font-weight: var(--fw-semibold);
}

.footer-nav a:where(:hover, :focus) {
  color: var(--clr-primary-300);
}

@media (max-width: 49em) {
  .primary-footer .even-columns > * {
    justify-self: center;
  }
  .primary-footer .even-columns {
    gap: 2.5em;
  }
}

/* Utilities
// ================================================== */

/* Visually Hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; /* added line */
  border: 0;
}

/* Container */
.container {
  --maxwidth: 80rem;
  --padding: 1rem;

  width: min(var(--maxwidth), 100% - (var(--padding) * 2));
  margin-inline: auto;
}

/* Row padding */
.padding-block-500 {
  padding-block: var(--size-500);
}
.padding-block-600 {
  padding-block: var(--size-600);
}
.padding-block-800 {
  padding-block: var(--size-800);
}

/* Text Colours
// ================================================== */
.text-white {
  color: var(--clr-lightest);
}

/* Background colours
// ================================================== */
.bg-surface-100 {
  background-color: var(--clr-surface-100);
}

.bg-transparent-primary-200 {
  background-color: hsl(from var(--clr-primary-200) h s l / 0.3);
}

/* Gradient backgrounds */
.body-bg {
  background-color: hsla(254, 100%, 24%, 1);
  background-image: radial-gradient(
      at 19% 18%,
      hsla(216, 100%, 31%, 0.47) 0px,
      transparent 50%
    ),
    radial-gradient(at 36% 0%, hsla(316, 100%, 29%, 1) 0px, transparent 50%),
    radial-gradient(at 99% 36%, hsla(283, 100%, 29%, 1) 0px, transparent 50%),
    radial-gradient(at 89% 93%, hsla(315, 100%, 29%, 1) 0px, transparent 50%),
    radial-gradient(at 60% 85%, hsla(51, 100%, 29%, 1) 0px, transparent 50%),
    radial-gradient(at 94% 45%, hsla(254, 100%, 29%, 1) 0px, transparent 50%),
    radial-gradient(at 84% 9%, hsla(102, 39%, 35%, 1) 0px, transparent 50%),
    radial-gradient(at 36% 33%, hsla(217, 39%, 55%, 1) 0px, transparent 50%),
    radial-gradient(at 12% 99%, hsla(59, 100%, 29%, 1) 0px, transparent 50%);
  background-size: cover;
  background-repeat: repeat-y;
}

/* Font weights */

/* Font sizes */

.fs-300 {
  font-size: var(--fs-300);
}

.fs-750 {
  font-size: var(--fs-750);
}

/* UTILITIES END */

/* Magic eight ball styles */

/* .ball img {
  height: fit-content;
  max-height: 100%;
} */

.shake-ball {
  animation: shake 0.5s;
  animation-iteration-count: infinite;
}

@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

.ball {
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 500px;
}

.clickme {
  width: 7em;
  z-index: 4;
}

.front {
  display: grid;
  place-items: end;
  width: var(--ball-side-size);
  height: var(--ball-side-size);
  position: relative;
  cursor: pointer;
}

.front > * {
  grid-area: 1 / 1;
}

.back {
  display: grid;
  place-items: center;
  width: var(--ball-side-size);
  height: var(--ball-side-size);
  position: relative;
  cursor: pointer;
}

.back > * {
  grid-area: 1 / 1;
}

.ball-back {
  z-index: 1;
}

.response-background {
  padding-top: 4rem;
  width: var(--response-size);
  z-index: 2;
}

.response-message {
  text-align: center;
  width: var(--response-size);
  z-index: 3;
}

@keyframes fadeInResponse {
  from {
    opacity: 0;
  }
  to {
    opacity: 100%;
  }
}

.response-fade-in {
  animation: fadeInResponse 2.5s;
}

.response-fade-out {
  animation: fadeInResponse 1.5s;
  animation-direction: reverse;
}

.ball-front:hover {
  animation: shake 0.5s;
  animation-iteration-count: infinite;
}

.hide {
  display: none;
}

.show-grid {
  display: grid;
}

.show-block {
  display: block;
}

/* @media (min-width: 50em) {
  .ball-front {
    max-width: 60%;
  }

  .clickme {
    width: 10em;
    bottom: 2em;
    right: 13em;
  }

  .prediction {
    width: 27%;
  }

  .response {
    top: 50%;
    width: 15%;
    height: 22%;
  }

  .back {
    background-size: contain;
  }
}

@media (max-width: 50em) {
  .container {
    --padding: 0;
  }
} */
