@import url("https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,700;0,900;1,900&display=swap");

body {
  font-family: "Inter", sans-serif;
  background: #ffffff;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

:root {
  --vh: 1vh;
  --drawer-space: 180px;
  --header-h: 160px;
  --header-h-mobile: 180px;
  --swatch-outer: 88px;
  --swatch-inner: 72px;
}
html,
body {
  height: calc(var(--vh) * 100);
}
body {
  touch-action: manipulation;
  overscroll-behavior: none;
}

.logo-font {
  font-family: "Inter", sans-serif;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.05em;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: white;
  z-index: 100;
  border-bottom: 2px solid #000;
  padding: 20px;
}

main {
  margin-top: var(--header-h);
  height: calc((var(--vh) * 100) - var(--header-h) - var(--drawer-space));
  overflow-y: auto;
  padding: 20px;
}

@media (max-width: 768px) {
  header {
    height: var(--header-h-mobile);
    padding: 15px;
  }
  main {
    margin-top: var(--header-h-mobile);
    height: calc(
      (var(--vh) * 100) - var(--header-h-mobile) - var(--drawer-space)
    );
    overflow-y: auto;
    padding: 15px;
  }
}

/* Color card */
.color-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s;
  background: none;
  border: none;
  padding: 0;
}
.color-card:active {
  transform: scale(0.9);
}

.circle-wrapper {
  width: var(--swatch-outer);
  height: var(--swatch-outer);
  border-radius: 50%;
  border: 1.5px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}
.color-inner {
  width: var(--swatch-inner);
  height: var(--swatch-inner);
  border-radius: 50%;
  border: 3px solid white;
}

.color-name {
  font-size: 10px;
  font-weight: 600;
  color: #111;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
  max-width: 96px;
}
.hex-label {
  font-size: 9px;
  font-weight: 400;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Swatch states */
.dimmed {
  opacity: 0.08;
  filter: grayscale(1);
  pointer-events: none;
}
.is-base .circle-wrapper {
  border-color: #4a4a4a;
  box-shadow: 0 0 0 2.5px #4a4a4a;
}
.is-selected .circle-wrapper {
  border-color: #9a9a9a;
  box-shadow: 0 0 0 1.5px #9a9a9a;
}

/* Bottom drawer */
#paletteDrawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #eee;
  z-index: 100;
  transition: transform 0.4s ease;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
}
.drawer-closed {
  transform: translateY(calc(100% - 25px));
}

#toggleBtn {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #eee;
  border-bottom: none;
  width: 50px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  padding: 0;
}
.rotated {
  transform: rotate(180deg);
}

/* Picker grid */
#sourceGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 12px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 480px) {
  #sourceGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 640px) {
  #sourceGrid {
    grid-template-columns: repeat(6, 1fr);
  }
}
@media (min-width: 1024px) {
  #sourceGrid {
    grid-template-columns: repeat(8, 1fr);
  }
}
@media (min-width: 1280px) {
  #sourceGrid {
    grid-template-columns: repeat(11, 1fr);
    max-width: 80rem;
  }
}

/* Bottom drawer — warm/cool/universal sections */
#userPalette {
  display: flex;
  flex-direction: row;
  gap: 28px;
  overflow-x: auto;
  padding: 6px 4px 10px;
  align-items: flex-start;
  min-height: 120px;
  scrollbar-width: none;
}
#userPalette::-webkit-scrollbar {
  display: none;
}
.palette-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9a9a9a;
  padding: 0 2px 2px;
}
.section-swatches {
  display: flex;
  flex-direction: row;
  gap: 14px;
  flex-shrink: 0;
}

header button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
