/* ralphmania docs site styles */
:root {
  --accent: #1da462;
  --accent-light: #e8f8f0;
  --accent-dark: #158a50;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --font-sans:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--gray-100);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--gray-900);
  color: #e5e7eb;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--gray-900);
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 1.75rem;
}
h3 {
  font-size: 1.25rem;
}
h4 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* ─── Nav ───────────────────────────────────────────────── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.nav-brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  background: linear-gradient(
    135deg,
    var(--gray-50) 0%,
    var(--accent-light) 100%
  );
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

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

.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.hero h1 span {
  color: var(--accent);
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 2.5rem;
  line-height: 1.5;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gray-900);
  color: #e5e7eb;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.hero-install code {
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.375rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Section ───────────────────────────────────────────── */
.section {
  padding: 4rem 1.5rem;
}

.section-alt {
  background: var(--gray-50);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  margin-bottom: 0.5rem;
}

.section-title p {
  color: var(--gray-600);
  font-size: 1.05rem;
  margin: 0;
}

/* ─── Feature Cards ─────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.feature-card p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* ─── How it Works ──────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-num {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  margin-top: 0.1rem;
}

.step-body h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.step-body p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0;
}

/* ─── Content pages (quickstart, reference) ─────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 4.5rem;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: var(--gray-600);
  font-size: 0.875rem;
  transition: all 0.15s;
}

.sidebar-nav a:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.sidebar-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  padding: 0.75rem 0.75rem 0.25rem;
}

.content {
  min-width: 0;
}

.content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.content h2:first-child {
  margin-top: 0;
}

.content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.content ul, .content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content li {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 600;
  text-align: left;
  padding: 0.625rem 1rem;
  border-bottom: 2px solid var(--gray-200);
}

td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: top;
}

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

tr:hover td {
  background: var(--gray-50);
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-green {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ─── Callout ─────────────────────────────────────────────── */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}

.callout p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* ─── Section CTA ────────────────────────────────────────── */
.section-cta {
  text-align: center;
}

.section-cta-sub {
  color: var(--gray-600);
  margin: 1rem 0 2rem;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.875rem;
}

.footer a {
  color: var(--accent);
}

/* ─── Flow Diagrams ──────────────────────────────────────── */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.flow-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.flow-node {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  min-width: 100px;
  text-align: center;
}

.flow-node--active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.flow-node--decision {
  border-radius: 2px;
  transform: none;
  border-style: dashed;
}

.flow-node--terminal {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-600);
  border-radius: 20px;
}

.flow-node-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.flow-annotation {
  font-size: 0.65rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--accent);
  background: var(--white);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--accent);
  white-space: nowrap;
}

.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.15rem 0;
}

.flow-arrow-line {
  width: 2px;
  height: 20px;
  background: var(--gray-400);
  position: relative;
}

.flow-arrow-line::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gray-400);
}

.flow-arrow-label {
  font-size: 0.7rem;
  color: var(--gray-600);
  margin-top: 0.1rem;
  font-style: italic;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: none;
  }
}
