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

:root {
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-dark: #1a1d23;
  --bg-code: #0d1117;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --green-border: #86efac;
  --red-badge: #dc2626;
  --red-light: #fef2f2;
  --red-border: #fca5a5;
  --blue-badge: #1d4ed8;
  --blue-light: #eff6ff;
  --blue-border: #93c5fd;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'Inter', 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAV ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.nav-back:hover { background: var(--border); }

.nav-title {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 72px 24px 48px;
  max-width: 900px;
  margin: 0 auto;
}
.hero-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 12px;
}
.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ── INDEX GRID ── */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.folder-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-light) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
.folder-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.folder-card:hover::before { opacity: 1; }

.folder-icon {
  width: 64px;
  height: 64px;
  position: relative;
  z-index: 1;
}

.folder-number {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.05em;
  z-index: 1;
}

.folder-title {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.folder-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.folder-badge.type-a { background: var(--green-light); color: var(--green); }
.folder-badge.type-b { background: var(--red-light); color: var(--red-badge); }

/* ── CONTENT LAYOUT ── */
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── SECTION CARD ── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.section-body { padding: 24px 28px; }

/* ── SUMMARY BULLETS ── */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .summary-grid { grid-template-columns: 1fr; } }

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.summary-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* ── BEFORE AFTER ── */
.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 640px) { .ba-grid { grid-template-columns: 1fr; } }

.ba-col { padding: 24px 28px; }
.ba-col.before { border-right: 1px solid var(--border); background: #fafafa; }
.ba-col.after { background: var(--green-light); }

.ba-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}
.ba-badge.before { background: #fee2e2; color: #b91c1c; }
.ba-badge.after { background: #dcfce7; color: #15803d; }

.ba-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ba-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.ba-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.ba-col.before .ba-list li::before { background: #ef4444; }
.ba-col.after .ba-list li::before { background: #22c55e; }

.ba-stat {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.ba-col.before .ba-stat { background: #fee2e2; color: #b91c1c; }
.ba-col.after .ba-stat { background: #dcfce7; color: #15803d; }

/* ── INTERNAL BADGE ── */
.internal-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
.internal-badge-icon { font-size: 20px; }
.internal-badge-text { font-size: 13px; font-weight: 600; color: var(--blue-badge); }

/* ── TERMINAL ── */
.terminal-wrap {
  background: var(--bg-code);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.terminal-bar {
  padding: 10px 16px;
  background: #21262d;
  display: flex;
  align-items: center;
  gap: 8px;
}
.terminal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }
.terminal-bar-title {
  margin-left: 8px;
  font-size: 12px;
  color: #8b949e;
  font-family: var(--font-mono);
}
.terminal-body {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: #e6edf3;
  min-height: 140px;
}
.terminal-body .t-prompt { color: #58a6ff; }
.terminal-body .t-ok { color: #3fb950; }
.terminal-body .t-warn { color: #d29922; }
.terminal-body .t-dim { color: #8b949e; }
.terminal-body .t-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: #e6edf3;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── PROGRESS BAR ── */
.progress-section { margin-bottom: 20px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  border-radius: 100px;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
}

/* ── STEP TIMELINE ── */
.step-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.step-item {
  display: flex;
  gap: 16px;
  opacity: 0.4;
  transition: opacity 0.4s;
}
.step-item.active { opacity: 1; }
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.4s;
}
.step-item.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.step-content { flex: 1; }
.step-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.step-content p { font-size: 13px; color: var(--text-muted); }

/* ── CODE BLOCK ── */
.code-wrap {
  background: var(--bg-code);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #21262d;
}
.code-filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8b949e;
}
.code-copy-btn {
  padding: 4px 10px;
  border-radius: 6px;
  background: #30363d;
  border: 1px solid #484f58;
  color: #e6edf3;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.code-copy-btn:hover { background: #484f58; }
.code-copy-btn.copied { background: #1f6feb; border-color: #1f6feb; }
pre.code-pre {
  padding: 20px 24px;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}
pre.code-pre code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e6edf3;
  white-space: pre;
}

/* ── DOWNLOAD BUTTON ── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}
.btn-download:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }

.btn-copy-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy-code:hover { background: var(--border); }
.btn-copy-code.copied { background: var(--green-light); border-color: var(--green); color: var(--green); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── BOOKMARKLET DRAG BTN ── */
.bookmarklet-drag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: grab;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(217,119,6,0.3);
  transition: transform 0.1s;
}
.bookmarklet-drag:hover { transform: scale(1.02); }
.bookmarklet-drag:active { cursor: grabbing; }

/* ── MANUAL STEPS ── */
.manual-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.manual-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.manual-step-num {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.manual-step-text { font-size: 13px; color: var(--text); line-height: 1.5; padding-top: 2px; }

/* ── TECH TAGS ── */
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tech-tag {
  padding: 3px 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── RESULT BADGE ── */
.result-badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.result-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  min-width: 120px;
  text-align: center;
}
.result-badge-num { font-size: 22px; font-weight: 700; color: var(--green); }
.result-badge-label { font-size: 11px; color: #166534; margin-top: 2px; }

/* ── FOOTER ── */
.page-footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-light);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .index-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 20px 16px 60px; }
  .section-body { padding: 16px 18px; }
  .ba-col { padding: 16px 18px; }
}
