:root {
  --bg-color: oklch(97% 0.01 240);
  --nav-bg: oklch(100% 0 0 / 90%);
  --border: oklch(90% 0.02 250);

  --text-primary: oklch(25% 0.02 250);
  --text-inverse: oklch(98% 0 0);

  --btn-bg: oklch(20% 0 0);
  --btn-bg-hover: oklch(0% 0 0);
  --accent: oklch(60% 0.15 250);

  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  gap: 1rem;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: oklch(98% 0.01 250);
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

input[type="checkbox"] {
  accent-color: var(--btn-bg);
  cursor: pointer;
}

input[type="range"] {
  width: 80px;
  vertical-align: middle;
  opacity: 0.3;
  pointer-events: none;
  accent-color: var(--accent);
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.control-item input[type="checkbox"]:checked ~ input[type="range"] {
  opacity: 1;
  pointer-events: auto;
}

main {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

.color-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.lock-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-btn:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.1);
}

.lock-btn:active {
  transform: scale(0.95);
}

.color-code {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.color-code:hover {
  background: rgba(255, 255, 255, 0.2);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-top: 1px solid var(--border);
}

#generate-btn {
  background-color: var(--btn-bg);
  color: var(--text-inverse);
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);

  margin: 0 auto;
}

#generate-btn:hover {
  background-color: var(--btn-bg-hover);
  box-shadow: var(--shadow-md);
}

#generate-btn:active {
  transform: translateY(1px);
}

#home-page-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#home-page-btn:hover {
  opacity: 1;
  color: var(--accent);
}

#copy-toast {
  display: none;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--btn-bg);
  color: var(--text-inverse);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  font-weight: 500;
  z-index: 100;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  main {
    flex-direction: column;
  }

  .color-panel {
    min-height: auto;
    flex: 1;
  }

  .controls {
    gap: 0.5rem;
  }
}

@media (max-width: 624px) {
  nav {
    flex-direction: column;
    padding-bottom: 0.5rem;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  .control-item {
    flex: 1;
    justify-content: center;
  }

  input[type="range"] {
    width: 50px;
  }
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
