﻿@font-face {
  font-family: "Pretendard";
  src: local("Pretendard Variable"), local("Pretendard");
}

:root {
  --bg: #f4f6fb;
  --line: #d9deea;
  --text: #141927;
  --muted: #61708a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}

.shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1a243c;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(140deg, #7ea3ff, #2ab7ff);
}

.ghost-btn,
.mode,
.copy-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  color: #111827;
  padding: 10px 14px;
  cursor: pointer;
}

.intro h1 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.intro p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.actions {
  margin: 16px 0 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.mode-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode {
  border-color: #d5ddef;
  background: transparent;
}

.mode.is-active {
  background: #111827;
  color: white;
  border-color: #111827;
}

.palette {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
}

.color-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: end;
  padding: 12px;
  background: #fff;
}

.color-card:last-child {
  border-right: 0;
}

.lock-wrap {
  display: flex;
  justify-content: flex-end;
}

.lock {
  background: transparent;
  border: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.lock.is-locked { opacity: 1; }

.swatch {
  width: 100%;
  border: 0;
  border-radius: 12px;
  min-height: 120px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.swatch:hover { transform: scale(1.02); }

.hex {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #f9fafe;
}

.copy-btn {
  width: 100%;
}

.guide {
  margin-top: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.guide h2 {
  margin: 0 0 8px;
}

.guide p {
  margin: 0 0 12px;
  color: var(--muted);
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mood-grid img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  aspect-ratio: 1 / 1.25;
  object-fit: cover;
}

.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;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 1024px) {
  .palette {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
  .color-card:nth-child(3n) { border-right: 0; }
}

@media (max-width: 680px) {
  .app {
    padding: 14px;
  }

  .mood-grid {
    grid-template-columns: 1fr 1fr;
  }

  .palette {
    grid-template-columns: 1fr;
  }

  .color-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    aspect-ratio: auto;
    padding: 10px;
  }
}