:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #475569;
  --bg-color: #f8fafc;
  --bg-light: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --editor-bg: #1e1e1e;
  --editor-text: #d4d4d4;
  --editor-border: #333333;
  --editor-toolbar: #2d2d2d;
  --editor-btn: #3d3d3d;
  --editor-btn-hover: #4d4d4d;
  --success: #10b981;
  --error: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

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

/* Header */
.header {
  background-color: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}
.logo:hover { text-decoration: none; color: var(--primary); }

.nav-menu ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-menu a {
  color: var(--secondary);
  font-weight: 500;
}

.nav-menu a:hover, .nav-menu a.active {
  color: var(--primary);
  text-decoration: none;
}

.btn-nav-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background 0.2s;
}
.btn-nav-cta:hover {
  background: var(--primary-hover) !important;
  text-decoration: none;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  stroke: var(--text-main);
  display: block;
}

/* Hero Section */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-color) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2rem;
}

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

/* Editor Section */
.editor-section {
  padding: 3rem 0;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  background: var(--editor-bg);
  border-radius: var(--radius);
  border: 1px solid var(--editor-border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: 650px;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--editor-toolbar);
  border-bottom: 1px solid var(--editor-border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar-title {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-editor {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #e5e5e5;
  background: var(--editor-btn);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-editor:hover { background: var(--editor-btn-hover); }
.btn-editor.primary { background: var(--primary); color: #fff; }
.btn-editor.primary:hover { background: var(--primary-hover); }

.select-indent {
  background: var(--editor-btn);
  color: #e5e5e5;
  border: 1px solid transparent;
  padding: 0.375rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  outline: none;
  cursor: pointer;
}

.editor-area {
  flex-grow: 1;
  width: 100%;
  padding: 1rem;
  background: var(--editor-bg);
  color: var(--editor-text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  border: none;
  resize: none;
  outline: none;
  white-space: pre;
  overflow: auto;
}

.editor-area::placeholder { color: #666; }

.editor-footer {
  padding: 0.5rem 1rem;
  background: var(--editor-toolbar);
  border-top: 1px solid var(--editor-border);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
}

/* Typography & Prose */
.content-section {
  padding: 4rem 0;
}
.bg-white { background-color: var(--bg-light); }

.prose {
  max-width: 800px;
  margin: 0 auto;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}
.prose h1 { font-size: 2.5rem; margin-top: 0; margin-bottom: 1.5rem; }
.prose h2 { font-size: 2rem; }
.prose h3 { font-size: 1.5rem; }

.prose p { margin-bottom: 1.25rem; font-size: 1.125rem; color: var(--secondary); }
.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.5rem; color: var(--secondary); font-size: 1.125rem; }
.prose li { margin-bottom: 0.5rem; }
.prose a { text-decoration: underline; }
.prose a:hover { color: var(--primary-hover); }

.prose pre {
  background: var(--editor-bg);
  color: var(--editor-text);
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.prose code {
  background: var(--border-color);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text-main);
}
.prose pre code { background: transparent; padding: 0; color: inherit; }

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.breadcrumbs a { color: var(--primary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span { margin: 0 0.5rem; }

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.feature-card {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  stroke-width: 2;
  display: block;
}
.feature-card h3 { font-size: 1.25rem; margin-bottom: 1rem; color: var(--text-main); }
.feature-card p { color: var(--secondary); font-size: 1.0625rem; margin: 0; }

/* Before / After */
.ba-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 3rem 0;
}
.ba-col {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ba-header {
  padding: 1rem;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  text-align: center;
  color: var(--text-main);
}
.ba-col pre { margin: 0; padding: 1.5rem; border-radius: 0; box-shadow: none; height: 100%; border: none; }

/* Blog Cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.blog-card {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.blog-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
}
.blog-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.blog-title a { color: var(--text-main); text-decoration: none; }
.blog-title a:hover { color: var(--primary); }
.blog-excerpt {
  color: var(--secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  flex: 1;
}
.blog-read-more {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.blog-read-more:hover { text-decoration: none; gap: 0.5rem; }

/* FAQ */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border-color);
}
.faq-btn {
  text-align: left;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  background: none;
  border: none;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.faq-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.faq-btn svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  display: block;
  transition: transform 0.3s;
  color: var(--secondary);
}
.faq-btn[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--primary); }
.faq-content { overflow: hidden; max-height: 0; transition: max-height 0.3s ease-out; }
.faq-inner { padding-bottom: 1.5rem; color: var(--secondary); font-size: 1.0625rem; line-height: 1.6; }
.faq-inner p:last-child { margin-bottom: 0; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg-light);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; box-shadow: var(--shadow-md); color: #fff; }
.btn-outline { border: 1px solid var(--border-color); background: var(--bg-light); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-color); border-color: var(--secondary); text-decoration: none; }

/* Toast */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--primary); }

/* Footer */
.footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 3rem; }
.footer-brand p { color: var(--secondary); margin-top: 1rem; max-width: 400px; }
.footer h4 { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text-main); }
.footer ul { list-style: none; }
.footer li { margin-bottom: 0.75rem; }
.footer a { color: var(--secondary); transition: color 0.2s; }
.footer a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 2rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* Responsive */
@media (max-width: 1024px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-panel { height: 500px; }
  .ba-container { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
  }
  .nav-menu.active { display: block; }
  .nav-menu ul { flex-direction: column; gap: 0; align-items: stretch; }
  .nav-menu a { display: block; padding: 1rem 1.5rem; }
  .btn-nav-cta { margin: 1rem 1.5rem; text-align: center; display: block; }
  .hamburger { display: block; }
  .hero h1 { font-size: 2.25rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .toolbar-actions { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 0.25rem; }
}
.logo svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  display: block;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  .prose h1 {
    font-size: 2rem;
  }
  .hero {
    padding: 3rem 0 2rem;
  }
  .feature-card {
    padding: 1.5rem;
  }
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    align-items: stretch;
  }
  .toast {
    width: 100%;
    max-width: 100%;
  }
  .editor-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .toolbar-actions {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
  .editor-panel {
    height: 400px;
  }
  .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .toolbar-actions .btn-editor {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
  }
}

.faq-btn span { flex: 1; min-width: 0; padding-right: 1rem; }

.prose {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

pre { overflow-x: auto; max-width: 100%; box-sizing: border-box; }
