:root {
  --bg: #f7f3ed;
  --panel: #fffaf2;
  --text: #1f2933;
  --muted: #64707d;
  --border: #ded6ca;
  --accent: #ff6b6b;
  --shadow: 0 24px 60px rgba(49, 39, 25, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent), transparent 72%), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.dark {
  --bg: #111827;
  --panel: #1f2937;
  --text: #f8fafc;
  --muted: #b7c0cc;
  --border: #374151;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

button,
input,
textarea {
  font: inherit;
}

.app {
  width: min(940px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0 80px;
  display: grid;
  align-content: start;
  gap: 32px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg), transparent 10%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.nav-container {
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

.color-description {
  margin: 24px 0 16px;
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: var(--text) !important;
}

.color-tips {
  padding: 16px;
  background: color-mix(in srgb, var(--accent), transparent 92%);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
}

/* Palette Grid (Color Hunt Style) */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.palette-item {
  height: 60px;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  padding: 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.palette-item:hover {
  transform: translateY(-4px);
}

.palette-item span {
  pointer-events: none;
}

.content-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 40px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.05);
}

.text-content p {
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--muted);
}

.footer {
  margin-top: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .content-section { padding: 24px; }
  .footer-container { flex-direction: column; gap: 16px; text-align: center; }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
}

.theme-toggle {
  min-width: 126px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.theme-icon {
  width: 20px;
  text-align: center;
}

.color-stage {
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr);
}

.color-preview {
  min-height: 100%;
  background: var(--accent);
}

.color-info {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.digit-badge {
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
}

.color-info h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
}

.color-info p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hex-code {
  width: fit-content;
  margin-bottom: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel), var(--accent) 8%);
  color: var(--text) !important;
  font-weight: 700;
}

.controls {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
}

.controls label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.controls input {
  width: min(100%, 360px);
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 0 14px;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.palette {
  display: grid;
  grid-template-columns: repeat(10, minmax(48px, 1fr));
  gap: 10px;
}

.swatch {
  height: 62px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.swatch span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--swatch-color);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 72%);
  font-weight: 800;
}

.partner-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

.comments-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

#disqus_thread {
  min-height: 240px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.1;
}

.partner-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.partner-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.partner-form input,
.partner-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 13px 14px;
}

.partner-form textarea {
  min-height: 132px;
  resize: vertical;
}

.partner-form input::placeholder,
.partner-form textarea::placeholder {
  color: var(--muted);
}

.consent {
  grid-template-columns: auto 1fr;
  align-items: start;
  color: var(--muted) !important;
  font-size: 14px;
  font-weight: 700 !important;
  line-height: 1.5;
}

.consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.submit-button {
  width: min(100%, 220px);
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent), transparent 70%);
}

.submit-button:hover {
  filter: brightness(0.96);
}

@media (max-width: 720px) {
  .app {
    width: min(100% - 24px, 560px);
    padding: 24px 0;
    align-content: start;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .color-stage {
    grid-template-columns: 1fr;
  }

  .color-preview {
    min-height: 190px;
  }

  .color-info {
    padding: 28px;
  }

  .palette {
    grid-template-columns: repeat(5, 1fr);
  }

  .partner-section {
    padding: 22px;
  }

  .comments-section {
    padding: 22px;
  }

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