/* Variables */
:root {
  --primary-color: hsl(300, 59%, 94%);
  --btn-color: hsl(0, 0%, 100%);
  --copied-color: hsl(225, 73%, 57%);
  --border-color: hsl(0, 3%, 79%);
  --hover-color: hsl(0, 8%, 88%);
  --transition-duration: 0.2s;
  --seed-color-height: 3em;
  --seed-color-max-width: 6em;
}

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

* {
  margin: 0;
  padding: 0;
  font: inherit;
}

a {
  text-decoration: none;
}

/* General Styles */
body {
  font-family: "Inter", sans-serif;
  text-align: center;
  height: 100vh;
}

.primary-header,
footer {
  position: fixed;
  left: 0;
  z-index: 1000;
  width: 100%;
  padding: 1em 0;
  background-color: var(--primary-color);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

/* Header */
.primary-header {
  top: 0;
}

.logo {
  color: hsl(0, 0%, 0%);
}

/* Main */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 90%;
  padding-top: 4em;
}

.color-scheme-generator,
.seed-color,
.scheme-mode,
.btn,
.container {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.seed-color,
.scheme-mode,
.btn {
  width: 100%;
  cursor: pointer;
}

.seed-color,
.scheme-mode,
.btn,
.container {
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.color-scheme-generator {
  height: 200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.seed-color {
  height: var(--seed-color-height);
}

.scheme-mode {
  padding-left: 0.5em;
}

.scheme-mode,
.btn {
  padding: 1em;
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--btn-color);
}

/* Hover and active states */
.seed-color:hover,
.seed-color:active,
.scheme-mode:hover,
.scheme-mode:active,
.btn:hover,
.btn:active {
  background-color: var(--hover-color);
}

.color-scheme-output {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 1em 0;
}

.color-wrapper,
.seed-color {
  height: 100%;
}

.color-wrapper {
  display: flex;
  flex-direction: column;
}

.color-block,
.color-code {
  cursor: pointer;
}

.color-block {
  height: 95%;
  transition: all var(--transition-duration);
}

.color-block:hover,
.color-block:focus {
  box-shadow: 0 0 10px hsla(0, 0%, 0%, 0.4);
  transform: scale(1.02);
}

.color-block:active,
.color-code:active {
  transform: scale(1);
}

.color-code {
  padding-top: 1em;
  transition: color var(--transition-duration);
}

/* Footer */
footer {
  bottom: 0;
}

/* Utility Classes */
.container {
  display: flex;
  flex-direction: column;
  height: 80%;
  width: 95%;
  max-width: 1000px;
  padding: 0.5em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.copied {
  color: hsl(225, 73%, 57%);
}

/* Media Queries */

@media (min-width: 768px) {
  .color-scheme-generator {
    flex-direction: row;
    height: fit-content;
  }
  .seed-color {
    max-width: var(--seed-color-max-width);
  }
  .scheme-mode {
    width: 60%;
  }

  .btn {
    width: 40%;
  }
}
