@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

:root {
  --primary: #8B5CF6;
  --primary-dark: #7C3AED;
  --primary-light: #EDE9FE;
  --bg: #F7F8FA;
  --white: #FFFFFF;
  --text: #1A1A2E;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(139,92,246,0.18);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ───── Header ───── */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(139,92,246,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  gap: 32px;
}

.logo {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo span { opacity: 0.75; font-weight: 400; }

nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

nav a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: background 0.15s;
  white-space: nowrap;
}

nav a:hover { background: rgba(255,255,255,0.18); color: white; }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ───── Hero ───── */
.hero {
  background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
  padding: 56px 20px 80px;
  text-align: center;
}

.hero h1 {
  color: white;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero p {
  color: rgba(255,255,255,0.88);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

.hero-install-btn {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.6);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.hero-install-btn:hover { background: rgba(255,255,255,0.35); }

/* ───── Tools Section ───── */
.tools-section {
  max-width: 1200px;
  margin: -36px auto 0;
  padding: 0 20px 80px;
}

.category-block { margin-bottom: 40px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-desc {
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 2px 0 0 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 16px 22px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  display: block;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(139,92,246,0.18);
}

.tool-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  display: block;
}

.tool-name {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 7px;
  color: var(--text);
}

.tool-desc {
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.45;
}

/* ───── Tool Page Layout ───── */
.tool-page {
  max-width: 780px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 28px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.tool-header {
  text-align: center;
  margin-bottom: 36px;
}

.tool-header-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  display: block;
}

.tool-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tool-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ───── Panel / Card ───── */
.panel {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.panel-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 18px;
}

/* ───── Drop Zone ───── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 64px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: white;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone-icon { font-size: 3.5rem; margin-bottom: 14px; display: block; }

.drop-zone h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.drop-zone p {
  color: var(--text-light);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}
.btn-secondary:hover { background: #DDD6FE; }

.btn-select {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-select:hover { background: var(--primary-dark); }

.btn-convert {
  display: block;
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 15px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 24px;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.btn-convert:hover { background: var(--primary-dark); }
.btn-convert:active { transform: scale(0.99); }
.btn-convert:disabled { background: #D1D5DB; cursor: not-allowed; transform: none; }

/* Copy button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-copy:hover { background: #DDD6FE; }
.btn-copy.copied { background: #D1FAE5; color: #059669; }

/* ───── Color Preview Box ───── */
.color-preview {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background 0.2s;
  margin-bottom: 12px;
}

.color-swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.2s;
}

.color-swatch-sm {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: inline-block;
  flex-shrink: 0;
}

/* ───── Input Groups ───── */
.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  min-width: 52px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.input-group input[type="text"],
.input-group input[type="number"] {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
  color: var(--text);
  background: #F9FAFB;
  outline: none;
  transition: border-color 0.15s;
}

.input-group input:focus {
  border-color: var(--primary);
  background: white;
}

/* ───── Options Panel ───── */
.options-panel {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.options-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.option-row:last-child { margin-bottom: 0; }

.option-label {
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 120px;
  color: var(--text);
}

.option-control { flex: 1; }

.option-control select,
.option-control input[type="text"],
.option-control input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #F9FAFB;
  outline: none;
  transition: border-color 0.15s;
}

.option-control select:focus,
.option-control input:focus {
  border-color: var(--primary);
  background: white;
}

/* ───── Range Slider ───── */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(139,92,246,0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(139,92,246,0.3);
}

.range-value {
  min-width: 44px;
  text-align: right;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}

/* ───── Color Picker Input ───── */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  background: white;
}

input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }

/* ───── Code Block ───── */
.code-block {
  background: #1E1E3F;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 16px;
  position: relative;
}

.code-block pre {
  color: #A9B7FF;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: rgba(255,255,255,0.8);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.22); }
.code-copy-btn.copied { background: rgba(16,185,129,0.3); color: #6EE7B7; }

/* ───── Result Panel ───── */
.result-panel {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

/* ───── Badge ───── */
.badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.free-badge {
  display: inline-block;
  background: #22C55E;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

/* ───── WCAG badges ───── */
.wcag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
}
.wcag-pass { background: #D1FAE5; color: #065F46; }
.wcag-fail { background: #FEE2E2; color: #991B1B; }

/* ───── Palette Swatches ───── */
.palette-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.palette-swatch {
  flex: 1;
  min-width: 60px;
  height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}

.palette-swatch:hover { transform: scale(1.06); }

.palette-swatch-label {
  font-size: 0.7rem;
  text-align: center;
  color: var(--text-light);
  margin-top: 4px;
  font-family: 'Courier New', monospace;
}

/* ───── Color History ───── */
.color-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.history-item {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.15s;
  title: attr(data-hex);
}
.history-item:hover { transform: scale(1.15); }

/* ───── Gradient Preview ───── */
.gradient-preview {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: background 0.2s;
}

/* ───── Features Strip ───── */
.features {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 20px;
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  text-align: center;
}

.feature-icon { font-size: 2rem; margin-bottom: 10px; }

.feature-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ───── Footer ───── */
footer {
  background: #1F2937;
  color: #9CA3AF;
  padding: 44px 20px 28px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.footer-brand .logo-footer {
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 0.83rem;
  line-height: 1.6;
  max-width: 260px;
}

.footer-links h4 {
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.footer-links a {
  display: block;
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.83rem;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom p { font-size: 0.8rem; }

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.footer-bottom-links a:hover { color: white; }

/* ───── Alert ───── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-top: 16px;
}
.alert-error { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #C4B5FD; }

/* ───── Our Sites Bar ───── */
.our-sites-bar {
  justify-content: center;
  background: #1A1A2E;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.our-sites-bar::-webkit-scrollbar { display: none; }

.our-sites-label {
  color: rgba(255,255,255,0.4);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.our-sites-links {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.our-sites-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.our-sites-links a:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

.our-sites-links a.active {
  background: rgba(139,92,246,0.35);
  color: #C4B5FD;
}

/* ───── Cross Link Tips ───── */
.cross-link-tip {
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--text-light);
}
.cross-link-tip a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.cross-link-tip a:hover { text-decoration: underline; }

.cross-link-banner {
  margin: 32px 0 0;
  padding: 16px 20px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}
.cross-link-banner span { color: var(--text); font-weight: 600; }
.cross-link-banner a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  font-size: 0.82rem;
}
.cross-link-banner a:hover { background: var(--primary); color: white; }

.hero-related {
  margin-top: 16px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-related a {
  color: white;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255,255,255,0.2);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.4);
  font-size: 0.82rem;
}
.hero-related a:hover { background: rgba(255,255,255,0.35); }

/* ───── Utility ───── */
.text-mono { font-family: 'Courier New', monospace; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

/* ───── Responsive ───── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.65rem; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  nav { display: none; }
  .footer-top { flex-direction: column; }
  .option-row { flex-direction: column; align-items: flex-start; }
  .option-label { min-width: unset; }
}

@media (max-width: 520px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { padding: 18px 10px 14px; }
  .tool-icon { font-size: 2rem; }
  .hero { padding: 36px 20px 60px; }
}
