/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 0 64px;
  position: relative;
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  overflow: hidden;
}

/* Dot grid overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(99,91,255,0.18) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  border-radius: inherit;
}

/* Central glow */
.hero::after {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 380px;
  background: radial-gradient(ellipse at center, rgba(99,91,255,0.30) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,91,255,0.18);
  color: #C7D2FE;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(99,91,255,0.32);
  backdrop-filter: blur(8px);
  text-transform: uppercase;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: #818CF8;
  border-radius: 50%;
  flex-shrink: 0;
  animation: nav-dot-pulse 2s ease-in-out infinite;
}

.hero-title {
  position: relative;
  z-index: 1;
  font-size: 62px;
  font-weight: 800;
  color: rgba(255,255,255,0.95);
  letter-spacing: -0.045em;
  margin-bottom: 20px;
  line-height: 1.08;
}

.hero-title-gradient {
  background: linear-gradient(135deg, #818CF8 0%, #C7D2FE 50%, #A5B4FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  position: relative;
  z-index: 1;
  font-size: 15.5px;
  color: rgba(255,255,255,0.55);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.78;
}

/* ── Tech stack chips ─────────────────────────────────────────────────────── */
.hero-tech-stack {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.tech-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.11);
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tech-chip:hover {
  background: rgba(99,91,255,0.18);
  border-color: rgba(99,91,255,0.35);
  color: #C7D2FE;
}

.tech-chip-ai {
  background: rgba(99,91,255,0.16);
  border-color: rgba(99,91,255,0.32);
  color: #818CF8;
}

/* ── Legacy ───────────────────────────────────────────────────────────────── */
.hero-code-label { display: none; }
.hero-title-accent { color: #818CF8; }

/* ── Input card ──────────────────────────────────────────────────────────── */
.editor-section {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}

/* ── Type tabs — pill style ──────────────────────────────────────────────── */
.type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.type-tab {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 99px;
  padding: 8px 20px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.type-tab:hover:not(.active) {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

.type-tab.active {
  background: #635BFF;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(99,91,255,0.32);
}

/* ── Language subtabs ────────────────────────────────────────────────────── */
.lang-tabs { display: flex; gap: 6px; margin-bottom: 14px; }

.tab {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.tab:hover:not(.active) {
  background: var(--bg-subtle);
  color: var(--text);
}

.tab.active {
  background: #635BFF;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(99,91,255,0.28);
}

/* ── Editor top bar ──────────────────────────────────────────────────────── */
.editor-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.editor-top-bar .lang-tabs { margin-bottom: 0; }

/* ── Dual-pane header (label + upload btn) ───────────────────────────────── */
.dual-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── File upload button ──────────────────────────────────────────────────── */
.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1.5px solid #635BFF;
  border-radius: var(--radius);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  color: #635BFF;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn-upload:hover {
  background: #635BFF;
  color: #fff;
}

.btn-upload-sm { font-size: 11px; padding: 3px 10px; }

/* ── Drop zone ───────────────────────────────────────────────────────────── */
.drop-zone {
  position: relative;
  margin-bottom: 20px;
}

.drop-zone .code-editor { margin-bottom: 0; }

.dual-pane .drop-zone { margin-bottom: 0; }

.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(99,91,255,0.06);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  pointer-events: none;
  z-index: 10;
  line-height: 1.8;
  gap: 4px;
}

.drop-overlay small { font-size: 11px; font-weight: 400; opacity: 0.7; }

.drop-zone.dragover .drop-overlay { display: flex; }
.drop-zone.dragover .code-editor  { opacity: 0.35; }

/* ── Code / text editors ─────────────────────────────────────────────────── */
.code-editor {
  width: 100%;
  min-height: 200px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-input);
  color: var(--text);
  resize: vertical;
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.code-editor:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  background: var(--bg);
}

.code-editor::placeholder { color: var(--text-muted); }

#form-code .code-editor   { min-height: 260px; }
.dual-pane .code-editor   { margin-bottom: 0; min-height: 200px; }

/* ── Dual-pane layout (Translation / AI Response) ────────────────────────── */
.dual-input {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dual-pane { display: flex; flex-direction: column; gap: 8px; }

.input-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Code block (result display) ─────────────────────────────────────────── */
.code-block {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
}

/* ── Diff view ───────────────────────────────────────────────────────────── */
.diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius);
}

.view-tab {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.view-tab.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.diff-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.diff-panel-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.diff-unified {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}

.diff-line { display: flex; gap: 10px; white-space: pre; }
.diff-sign { user-select: none; color: var(--text-muted); min-width: 14px; font-weight: 700; }
.diff-add    { background: #ECFDF5; color: #065F46; }
.diff-remove { background: var(--red-light); color: #991B1B; }
.diff-same   { color: var(--text); }

/* ── Result section grid ─────────────────────────────────────────────────── */
.result-bottom {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 0;
}

.result-bottom .card { margin-bottom: 0; }

.explanation-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}

/* ── Score bar chart ─────────────────────────────────────────────────────── */
.score-chart { display: flex; flex-direction: column; gap: 16px; }

.score-row {
  display: grid;
  grid-template-columns: 110px 1fr 52px;
  align-items: center;
  gap: 12px;
}

.score-row-final {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

.score-row-label { font-size: 13px; color: var(--text-secondary); }
.score-row-final .score-row-label { font-weight: 600; color: var(--text); }

.score-bar-wrap {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.score-bar { height: 100%; border-radius: 99px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }

.score-row-value { font-size: 13px; font-weight: 600; text-align: right; }
.score-row-final .score-row-value { font-size: 16px; }

/* 다크모드: diff 라인 색상 */
:root[data-theme="dark"] .diff-add    { background: rgba(16,185,129,0.16); color: #6EE7B7; }
:root[data-theme="dark"] .diff-remove { background: rgba(239,68,68,0.16);  color: #FCA5A5; }

/* ───────────────────────────────────────────────────────────────────────────
   반응형 — 메인 에디터 / 결과
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dual-input   { grid-template-columns: 1fr; }
  .diff-panels  { grid-template-columns: 1fr; }
  .result-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hero { padding: 52px 16px 44px; }
  .hero-title { font-size: 38px; }
  .type-tabs { flex-wrap: wrap; }
  .type-tab { flex: 1 1 calc(50% - 8px); justify-content: center; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 30px; }
  .type-tab { flex: 1 1 100%; }
  .score-row { grid-template-columns: 86px 1fr 44px; gap: 8px; }
}
