:root {
  --bg: #f5f4f1;
  --card: rgba(255, 255, 255, 0.92);
  --line: #dde0e8;
  --text: #15233a;
  --muted: #5f6f86;
  --accent: #2a4fd8;
  --accent-soft: rgba(49, 94, 251, 0.12);
  --success: #198754;
  --warning: #d97706;
  --danger: #cf3341;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  color: var(--text);
  background: #f5f4f1;
}
.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(19, 33, 68, 0.07);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 24px;
  padding: 28px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
}
h1, h2, h3 { margin: 0; }
.hero-copy, .hint, .empty-state, #progress-label { color: var(--muted); line-height: 1.6; }
.hero-meta {
  display: grid;
  gap: 12px;
}
.hero-meta > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.hero-meta strong { display: block; margin-bottom: 6px; }
.grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.form-card, .jobs-card, .result-card { padding: 24px; }
.job-form { display: grid; gap: 16px; margin-top: 18px; }
.field { display: grid; gap: 8px; }
.field span { font-weight: 700; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 15px;
  background: #fff;
}
.upload-field input { padding: 12px; }
.divider {
  display: flex; align-items: center; gap: 12px; color: var(--muted);
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.primary-button, .ghost-button, .download-link {
  border: none; border-radius: 8px; padding: 14px 18px; font-weight: 800; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.primary-button { background: var(--accent); color: #fff; }
.ghost-button, .download-link { background: var(--accent-soft); color: var(--accent); }
.feedback { min-height: 24px; font-size: 14px; color: var(--muted); }
.feedback.error { color: var(--danger); }
.feedback.success { color: var(--success); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.jobs-list { display: grid; gap: 12px; }
.job-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.88);
  cursor: pointer;
}
.job-item.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49,94,251,0.12); }
.job-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.job-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.status-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent);
}
.status-pill.running { background: rgba(217,119,6,0.14); color: var(--warning); }
.status-pill.failed { background: rgba(207,51,65,0.12); color: var(--danger); }
.status-pill.succeeded { background: rgba(25,135,84,0.12); color: var(--success); }
.hidden { display: none; }
.progress-wrap { margin-top: 20px; }
.progress-bar { height: 8px; border-radius: 6px; background: #e3e3e0; overflow: hidden; }
#progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), #8ea5ff); transition: width 0.25s ease; }
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 20px;
}
.summary-tile {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff;
}
.summary-tile strong { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.summary-tile span { font-size: 24px; font-weight: 900; }
.downloads { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.result-layout {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; margin-top: 24px;
}
.chord-list {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 16px; max-height: 720px; overflow: auto;
}
.chord-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef2f8;
}
.chord-item:last-child { border-bottom: none; }
.score-viewer {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; min-height: 360px; padding: 16px; overflow: auto;
}
@media (max-width: 960px) {
  .hero, .grid, .result-layout { grid-template-columns: 1fr; }
  .shell { width: min(100% - 20px, 1180px); padding: 20px 0 48px; }
}


/* =============================================
   Entrance animation for result card
   ============================================= */

@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card:not(.hidden) {
  animation: card-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* =============================================
   Buttons — hover + press states
   ============================================= */

.primary-button,
.ghost-button,
.download-link {
  transition: background 180ms ease, transform 140ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button:hover {
  background: #1f3dbf;
  box-shadow: 0 10px 28px rgba(49, 94, 251, 0.35);
}

.primary-button:active,
.ghost-button:active,
.download-link:active {
  transform: scale(0.97);
}

.ghost-button:hover,
.download-link:hover {
  background: rgba(49, 94, 251, 0.18);
}

/* =============================================
   Form inputs — focus transition
   ============================================= */

.field input {
  transition: border-color 180ms ease, box-shadow 180ms ease;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 94, 251, 0.15);
}

/* =============================================
   Job list items — hover lift
   ============================================= */

.job-item {
  transition: box-shadow 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.job-item:hover {
  box-shadow: 0 8px 24px rgba(19, 33, 68, 0.1);
  border-color: #b8c8f4;
  transform: translateY(-1px);
}

/* =============================================
   Running status — pulse animation
   ============================================= */

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

.status-pill.running {
  animation: status-pulse 1.6s ease-in-out infinite;
}

/* =============================================
   Summary tiles — hover lift
   ============================================= */

.summary-tile {
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.summary-tile:hover {
  box-shadow: 0 8px 20px rgba(19, 33, 68, 0.1);
  transform: translateY(-2px);
}

/* =============================================
   Hero meta panels — hover lift
   ============================================= */

.hero-meta > div {
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.hero-meta > div:hover {
  box-shadow: 0 8px 20px rgba(19, 33, 68, 0.1);
  transform: translateY(-2px);
}

/* =============================================
   Chord items — hover highlight
   ============================================= */

.chord-item {
  transition: background 150ms ease;
  border-radius: 8px;
  margin: 0 -8px;
  padding: 10px 8px;
}

.chord-item:hover {
  background: #f0f4ff;
}

/* =============================================
   Progress bar — shimmer effect when running
   ============================================= */

@keyframes progress-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

#progress-fill {
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    #6b84f0 40%,
    var(--accent) 60%,
    #6b84f0 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 2s linear infinite;
}

/* =============================================
   Scrollbar
   ============================================= */

.chord-list::-webkit-scrollbar,
.score-viewer::-webkit-scrollbar {
  width: 4px;
}

.chord-list::-webkit-scrollbar-track,
.score-viewer::-webkit-scrollbar-track {
  background: transparent;
}

.chord-list::-webkit-scrollbar-thumb,
.score-viewer::-webkit-scrollbar-thumb {
  background: #c8d4ee;
  border-radius: 99px;
}

/* =============================================
   Refresh button — spin icon on click
   ============================================= */

.ghost-button#refresh-jobs {
  font-size: 13px;
  padding: 8px 14px;
  min-height: unset;
  border-radius: 6px;
}
