:root {
  --bg: #f9fbff;
  --panel: #ffffff;
  --text: #142033;
  --muted: #62718d;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --line: #d6e4f2;
  --shadow: 0 20px 50px rgba(20, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

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

.site-header {
  padding: 24px 0 16px;
}

.header-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 520px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid rgba(20, 32, 51, 0.08);
  border-bottom: 1px solid rgba(20, 32, 51, 0.08);
  margin-bottom: 28px;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.nav a:hover {
  background: var(--accent-soft);
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 40px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.75rem;
}

.hero h2 {
  margin: 0;
  font-size: clamp(2.5rem, 3.1vw, 3.6rem);
  line-height: 1.02;
}

.hero p {
  max-width: 680px;
  color: var(--muted);
  margin: 20px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: white;
}

.btn.outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.hero-cards {
  display: grid;
  gap: 18px;
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.feature {
  padding: 24px;
}

.feature strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

.section {
  margin-bottom: 42px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.section-header h3 {
  margin: 0;
}

.section-header p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 620px;
}

.search-field input,
#search {
  width: 100%;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 1rem;
}

.modules-grid,
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card.module {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  min-height: 130px;
}

.card.module:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.card.module::before {
  content: '•';
  color: var(--accent);
  margin-right: 8px;
}

.templates-section .template-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.template-tab {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.template-tab.active {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

.template-body {
  display: grid;
  gap: 18px;
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.template-type {
  margin: 0;
  font-weight: 700;
}

.template-content {
  margin: 0;
  padding: 20px;
  background: #f4f7ff;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  color: var(--text);
}

.publish-card,
.feature-card {
  padding: 24px;
  border-radius: 22px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.feature-card h4,
.publish-card h4 {
  margin-top: 0;
}

.publish-card ol {
  padding-left: 18px;
  margin: 12px 0 0;
  color: var(--muted);
}

.publish-card .muted {
  margin-top: 18px;
  color: var(--muted);
}

.site-footer {
  padding: 28px 0 32px;
  border-top: 1px solid rgba(20, 32, 51, 0.08);
  background: transparent;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.site-footer strong {
  display: block;
  margin-bottom: 6px;
}

.site-footer small {
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .header-grid,
  .footer-grid,
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .template-header {
    flex-direction: column;
    align-items: stretch;
  }
}

body.dark {
  --bg: #020913;
  --panel: #081222;
  --text: #e2ebff;
  --muted: #93a5c2;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --line: rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at top left, rgba(91, 140, 255, 0.1), transparent 35%), #020913;
}

body.dark .site-header,
body.dark .nav,
body.dark .hero,
body.dark .card,
body.dark .template-panel,
body.dark .feature-card,
body.dark .publish-card {
  background: #081222;
}

body.dark .nav a:hover,
body.dark .btn.outline,
body.dark .template-tab,
body.dark .template-tab.active {
  background: rgba(255, 255, 255, 0.08);
}

body.dark .template-content {
  background: rgba(255, 255, 255, 0.04);
}

body.dark .btn.primary {
  background: #5b8cff;
}

body.dark .card.module {
  background: linear-gradient(180deg, #091823, #0f1f34);
}
