:root {
  --primary: #009639;
  --primary-dark: #007a2f;
  --primary-soft: #e8f5ec;
  --accent: #f26522;
  --text: #001a33;
  --muted: #4a6278;
  --surface: #fff;
  --border: #cfe0ef;
  --bg: #e6f2ff;
  --shadow: 0 4px 24px rgba(0, 26, 51, 0.08);
  --radius: 14px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, #f8fbff 45%, #fff 100%);
  line-height: 1.55;
}

a {
  color: var(--primary-dark);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* --- Header --- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 2rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 14px rgba(0, 150, 57, 0.35);
  position: relative;
}

.logo-mark::after {
  content: '';
  position: absolute;
  inset: 8px 10px 10px 8px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 6px 6px 6px 2px;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 150, 57, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-ghost {
  background: #fff;
  color: var(--primary-dark);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
}

/* --- Hero --- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

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

.badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.15;
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero-lead {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --- Pseudo diagram (hero) --- */

.hero-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-diagram::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.flow-box {
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  min-width: 4.5rem;
  border: 2px solid var(--border);
  background: #f8fbff;
}

.flow-box--user {
  background: var(--primary-soft);
  border-color: rgba(0, 150, 57, 0.35);
  color: var(--primary-dark);
}

.flow-box--llm {
  background: #fff4ed;
  border-color: rgba(242, 101, 34, 0.4);
  color: #b84a12;
}

.flow-box--db {
  background: #eef3ff;
  border-color: #b8c9e8;
  color: #1a3a6e;
}

.flow-arrow {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  opacity: 0.6;
}

.flow-caption {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

/* --- Sections --- */

section {
  margin-bottom: 3rem;
}

.section-title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
}

.section-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 42rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 26, 51, 0.04);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.card-icon--green {
  background: var(--primary);
}

.card-icon--orange {
  background: var(--accent);
}

.card-icon--blue {
  background: #2563eb;
}

.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Architecture stack --- */

.arch {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.arch-layers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.arch-layer {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #fafcff;
  position: relative;
}

@media (max-width: 560px) {
  .arch-layer {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.arch-layer::after {
  content: '▼';
  position: absolute;
  left: 50%;
  bottom: -0.55rem;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--muted);
  background: var(--surface);
  padding: 0 0.25rem;
  line-height: 1;
}

.arch-layer:last-child::after {
  display: none;
}

.arch-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.arch-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
}

.chip--highlight {
  background: var(--primary-soft);
  border-color: rgba(0, 150, 57, 0.3);
  color: var(--primary-dark);
}

/* --- Pipeline pseudo-chart --- */

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  align-items: stretch;
}

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

.pipe-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 26, 51, 0.04);
}

@media (min-width: 721px) {
  .pipe-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -0.55rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-weight: 800;
    z-index: 1;
  }
}

.pipe-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.pipe-step h4 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.pipe-step p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Compare block --- */

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

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

.compare-col {
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 2px solid var(--border);
}

.compare-col--bad {
  background: #fff8f8;
  border-color: #f0caca;
}

.compare-col--good {
  background: var(--primary-soft);
  border-color: rgba(0, 150, 57, 0.35);
}

.compare-col h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.compare-col ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.compare-col li + li {
  margin-top: 0.35rem;
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer a {
  margin-right: 1rem;
}
