/* ==========================================================================
   CSS Variables & Global Reset
   ========================================================================== */
:root {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-surface-hover: #222d42;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, 'Courier New', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==========================================================================
   Typography & Helpers
   ========================================================================== */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.18em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: #a5b4fc;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.accent-text {
  color: var(--accent-primary);
}

.section {
  padding: 6rem 0;
  position: relative;
}

.bg-surface {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.text-center {
  text-align: center;
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.section-header:not(.text-center) .section-desc {
  margin-left: 0;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-icon {
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.btn-primary-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
  transition: all var(--transition-fast);
}

.btn-primary-sm:hover {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 7rem 0 5rem 0;
  overflow: hidden;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.05) 50%, rgba(11, 15, 25, 0) 80%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #c7d2fe;
  margin-bottom: 2rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 850px;
  margin: 0 auto;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(8px);
}

.stat-num {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Overview / About Section
   ========================================================================== */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-box {
  background: linear-gradient(145deg, #131b2e 0%, #171d2b 100%);
  border-color: rgba(99, 102, 241, 0.2);
  position: relative;
}

.quote-symbol {
  font-size: 4rem;
  line-height: 1;
  color: var(--accent-primary);
  opacity: 0.3;
  font-family: Georgia, serif;
  margin-bottom: -1.5rem;
}

.quote-text {
  font-size: 1.12rem;
  line-height: 1.7;
  color: #e2e8f0;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.quote-author {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #fff;
}

.clean-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.clean-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.clean-list strong {
  color: #fff;
}

.list-bullet {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ==========================================================================
   Comparison Table Section
   ========================================================================== */
.comparison-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-main);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  background: var(--bg-surface-elevated);
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.comparison-table .highlight-col {
  background: rgba(99, 102, 241, 0.05);
  color: #e0e7ff;
}

/* ==========================================================================
   Principles Grid
   ========================================================================== */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.principle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.principle-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.principle-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}

.principle-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #fff;
}

.principle-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.principle-tip {
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--accent-primary);
  padding: 0.6rem 0.8rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #cbd5e1;
}

.highlight-card {
  background: linear-gradient(145deg, #1e1b4b 0%, #171d2b 100%);
  border-color: rgba(139, 92, 246, 0.4);
}

.highlight-card .principle-num {
  font-size: 1.4rem;
}

/* ==========================================================================
   Prompt Lab (Tabs & Comparison)
   ========================================================================== */
.prompt-tabs-container {
  max-width: 960px;
  margin: 0 auto;
}

.tab-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-main);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-surface-elevated);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.prompt-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.prompt-box {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.prompt-box.bad {
  border-color: rgba(239, 68, 68, 0.2);
}

.prompt-box.good {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, var(--bg-main) 100%);
}

.prompt-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.red {
  background-color: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}

.status-indicator.green {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.box-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-grow: 1;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.prompt-content {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.35);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  flex-grow: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-result-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}

.prompt-result-note strong {
  color: var(--text-muted);
}

/* ==========================================================================
   Checklist Section
   ========================================================================== */
.checklist-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.progress-container {
  margin-bottom: 2rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text-muted);
}

.progress-percentage {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-cyan) 100%);
  border-radius: var(--radius-full);
  transition: width 0.35s ease;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.check-item:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
}

.check-item.completed {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.04);
}

.check-item.completed strong {
  color: var(--text-dim);
  text-decoration: line-through;
}

.check-input {
  display: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.check-input:checked + .custom-checkbox {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.check-input:checked + .custom-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
}

.check-text strong {
  display: block;
  font-size: 0.98rem;
  color: #fff;
  margin-bottom: 0.2rem;
  transition: color var(--transition-fast);
}

.check-text p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.completion-banner {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  color: #6ee7b7;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.hidden {
  display: none;
}

/* ==========================================================================
   Template Section
   ========================================================================== */
.template-box {
  max-width: 800px;
  margin: 2.5rem auto 0;
  position: relative;
  text-align: left;
}

.template-copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.template-code {
  background: #060911;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.65;
  color: #cbd5e1;
  overflow-x: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-main);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.btn-top {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-top:hover {
  background: var(--bg-surface-elevated);
  color: #fff;
  border-color: var(--border-strong);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  border: 1px solid var(--accent-primary);
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Animations & Responsive Breakpoints
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .hero-title {
    font-size: 2.75rem;
  }
  .grid-2col,
  .principles-grid,
  .prompt-compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .tab-buttons {
    flex-direction: column;
  }
  .hidden-mobile {
    display: none;
  }
  .checklist-card {
    padding: 1.5rem;
  }
}
