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

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666;
  --border: #e5e5e5;
  --accent: #1a1a1a;
  --accent-light: #f5f5f5;
  --code-bg: #fafafa;
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  margin-bottom: 28px;
  color: var(--text-secondary);
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 100px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cta-btn:active {
  opacity: 0.8;
}

/* Features */
.features {
  padding: 40px 0 60px;
}

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

.feature-card {
  padding: 24px;
  background: var(--code-bg);
  border-radius: var(--radius);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Editor */
.editor-section {
  padding: 20px 0 60px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.editor-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.editor-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.tab.active {
  background: var(--code-bg);
  color: var(--text);
}

.editor-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.action-btn:active {
  background: var(--accent-light);
}

/* Symbol Bar */
.symbol-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--code-bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.symbol-bar::-webkit-scrollbar {
  display: none;
}

.sym {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  min-width: 38px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.sym:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Editor Area */
.editor-wrap {
  position: relative;
  display: flex;
  min-height: 320px;
  max-height: 60vh;
  background: var(--code-bg);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  overflow: hidden;
}

.line-numbers {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 16px 0 16px 16px;
  min-width: 40px;
  text-align: right;
  color: #ccc;
  user-select: none;
  pointer-events: none;
  white-space: pre-line;
}

#codeArea {
  flex: 1;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 16px;
  border: none;
  background: transparent;
  color: var(--text);
  resize: none;
  outline: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
  tab-size: 2;
  -moz-tab-size: 2;
  caret-color: var(--accent);
  position: relative;
  z-index: 2;
}

#codeArea::placeholder {
  color: #ccc;
}

.highlight-layer {
  position: absolute;
  top: 0;
  left: 40px;
  right: 0;
  bottom: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 16px;
  margin: 0;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
  z-index: 1;
  color: transparent;
}

.highlight-layer code {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Syntax highlighting colors */
.hl-keyword { color: #d73a49; }
.hl-string { color: #032f62; }
.hl-comment { color: #6a737d; }
.hl-number { color: #005cc5; }
.hl-function { color: #6f42c1; }
.hl-tag { color: #22863a; }
.hl-attr { color: #6f42c1; }
.hl-operator { color: #d73a49; }
.hl-property { color: #005cc5; }
.hl-punctuation { color: #999; }

.editor-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}

/* How section */
.how-section {
  padding: 60px 0;
}

.how-section h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  flex-shrink: 0;
}

.step h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.step p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  padding: 40px 0;
  text-align: center;
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-sub {
  margin-top: 4px;
  font-size: 13px;
}

.footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 100px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
  .hero {
    padding: 60px 0 40px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-desc {
    font-size: 15px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .editor-wrap {
    min-height: 280px;
  }
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 56px;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}
