:root {
  /* Brand */
  --accent: #fd6c1d;
  --accent-dark: #e65a0d;

  /* Light-mode surfaces and text (defaults) */
  --text: #505050;
  --muted: #8a8a8a;
  --bg: #ffffff;
  --bg-light: #f9f9f9;
  --bg-dark: #2d2d2d;          /* historic name — used by sections that are intentionally dark in light mode (performance, footer); does NOT flip in dark mode */
  --card-bg: #ffffff;
  --input-bg: rgba(0, 0, 0, 0.03);
  --code-bg: #f5f5f5;
  --code-bg-block: #f8f8f8;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --nav-mobile-bg: rgba(255, 255, 255, 0.98);

  /* Borders */
  --border-color: rgba(0, 0, 0, 0.06);
  --border-color-strong: rgba(0, 0, 0, 0.1);
  --border-color-subtle: rgba(0, 0, 0, 0.04);

  /* Shadows (alpha components only — combine with X/Y/blur per component) */
  --shadow-soft: rgba(0, 0, 0, 0.04);
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.12);

  /* Hover wash — used wherever the accent-tinted hover background appears */
  --hover-bg: rgba(253, 108, 29, 0.08);

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Dark-mode token overrides. Every component that references the tokens
   above flips automatically; per-component .dark-mode rules should only
   exist for things that aren't expressible as a single token (e.g. text
   colors of code-highlight spans). */
html.dark-mode {
  --text: #e0e0e0;
  --muted: #a0a0a0;
  --bg: #1a1a1a;
  --bg-light: #242424;
  --card-bg: #242424;
  --input-bg: rgba(255, 255, 255, 0.04);
  --code-bg: rgba(255, 255, 255, 0.06);
  --code-bg-block: #161616;
  --nav-bg: rgba(26, 26, 26, 0.92);
  --nav-mobile-bg: rgba(26, 26, 26, 0.98);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-strong: rgba(255, 255, 255, 0.12);
  --border-color-subtle: rgba(255, 255, 255, 0.06);

  --shadow-soft: rgba(0, 0, 0, 0.3);
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-strong: rgba(0, 0, 0, 0.5);

  --hover-bg: rgba(253, 108, 29, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: #ff8c42
}

.accent {
  color: var(--accent)
}

/* ===== NAVIGATION ===== */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.landing-nav.scrolled {
  box-shadow: 0 2px 20px var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  height: 60px;
}

.nav-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
}

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

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

/* Dropdown Navigation */
.nav-dropdown {
  position: relative;
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
  background: transparent;
  display: none;
}

.nav-dropdown:hover::before {
  display: block;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--shadow-strong);
  border: 1px solid var(--border-color);
  min-width: 200px;
  padding: 8px 0;
  z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-content {
  display: block;
}

.nav-dropdown-content a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-dropdown-content a:hover {
  background: rgba(253, 108, 29, 0.08);
  color: var(--accent);
  padding-left: 24px;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(253, 108, 29, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(253, 108, 29, 0.4);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--accent);
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: 2px solid var(--accent);
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(253, 108, 29, 0.1);
  transform: translateY(-2px);
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-light) 100%);
  padding: 120px 32px 80px;
}

.parallax-section {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(253, 108, 29, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(253, 108, 29, 0.08) 0%, transparent 50%);
  z-index: 0;
}

.parallax-bg-light {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg) 100%);
  z-index: 0;
}

.parallax-bg-dark {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(253, 108, 29, 0.1);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 24px 0;
  color: var(--text);
  animation: fadeInUp 0.6s ease 0.1s backwards;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--muted);
  margin: 0 0 48px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.6s ease 0.2s backwards;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease 0.3s backwards;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-stat i {
  font-size: 32px;
  color: var(--accent);
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  max-width: 150px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  animation: fadeInUp 0.6s ease 0.4s backwards;
}

/* ===== SECTIONS ===== */
.section-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 32px;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-badge {
  display: inline-block;
  background: rgba(253, 108, 29, 0.1);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.section-badge.light {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.section-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.section-title.light {
  color: white;
}

/* ===== BENEFITS SECTION ===== */
.benefits-section {
  background: var(--bg);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 32px;
}

.team-grid {
  grid-template-columns: repeat(3, 1fr);
}

.benefit-card {
  background: var(--card-bg);
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 2px 8px var(--shadow-soft);
  transition: all 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px var(--shadow-strong);
}

.benefit-card.accent-border {
  border-left: 4px solid var(--accent);
}

.benefit-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.benefit-icon i {
  font-size: 28px;
  color: white;
}

.benefit-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.benefit-card p {
  font-size: 14px;
  color: var(--accent);
  margin: 0 0 16px 0;
  font-weight: 500;
}

.benefit-detail {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== FEATURES SECTION ===== */
.features-section {
  background: var(--bg-light);
  position: relative;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.features-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--accent);
}

.feature-icon {
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-card img {
  height: 40px;
  width: auto;
  margin-bottom: 16px;
  object-fit: contain;
}

.feature-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ===== HOW IT WORKS SECTION ===== */
.how-it-works-section {
  background: var(--bg);
}

.architecture-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.flow-step {
  position: relative;
  text-align: center;
  max-width: 200px;
}

.flow-number {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.flow-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto 16px;
}

.flow-icon i {
  font-size: 32px;
  color: white;
}

.flow-step h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.flow-step p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.flow-arrow {
  font-size: 24px;
  color: var(--accent);
  opacity: 0.4;
}

.tech-stack {
  text-align: center;
  background: var(--bg-light);
  padding: 32px;
  border-radius: 16px;
}

.tech-stack h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 32px 0;
  color: var(--text);
}

.tech-logos {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tech-item i {
  font-size: 48px;
  color: var(--accent);
}

.tech-item img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.tech-item span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ===== PERFORMANCE SECTION ===== */
.performance-section {
  background: var(--bg-dark);
  color: white;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.metric-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
}

.metric-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: white;
}

.metric-card canvas {
  margin-bottom: 16px;
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.metric-footer i {
  color: #4ade80;
}

/* ===== CTA SECTION ===== */
.cta-section {
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  padding: 80px 32px;
  text-align: center;
}

.cta-container h2 {
  font-size: 40px;
  font-weight: 700;
  color: white;
  margin: 0 0 16px 0;
}

.cta-container p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 32px 0;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

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

.cta-buttons .btn-secondary {
  background: transparent;
  color: white;
  border-color: white;
}

.cta-buttons .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(253, 108, 29, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(253, 108, 29, 0.5);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

/* ===== FOOTER ===== */
.landing-footer {
  position: relative;
  z-index: 10;
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.8);
  padding: 64px 32px 32px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-links {
  flex: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.footer-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.footer-brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.footer-column h4 {
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-column a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  padding-bottom: 0;
}

.footer-bottom p {
  margin: 0;
  padding-bottom: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

/* ===== RULES SHOWCASE SECTION ===== */
.rules-showcase-section {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg) 50%, var(--bg-light) 100%);
  position: relative;
  overflow: hidden;
}

.rules-showcase-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(253, 108, 29, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 85% 50%, rgba(253, 108, 29, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.rules-showcase-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.rules-showcase-text {
  z-index: 1;
  position: relative;
}

.rules-showcase-text .section-badge {
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rules-showcase-text .section-title {
  text-align: left;
  margin-bottom: 16px;
}

.rules-showcase-text .section-intro {
  text-align: left;
  margin-bottom: 32px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.rules-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.rules-feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.rules-feature-item:hover {
  transform: translateX(8px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(253, 108, 29, 0.15);
}

.rules-feature-item i {
  font-size: 24px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
}

.rules-feature-item h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text);
}

.rules-feature-item p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.rules-cta-container {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.rules-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: gap 0.3s ease;
  width: 75%;
  max-width: 600px;
}

.rules-cta:hover {
  gap: 16px;
}

.rules-showcase-visual {
  position: relative;
  z-index: 1;
  min-height: 400px;
}

.rule-editor-preview {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 8px 32px var(--shadow-strong);
  border: 1px solid var(--border-color-strong);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.rule-editor-preview:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(253, 108, 29, 0.2);
}

.rule-editor-header {
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}

.rule-editor-header i {
  font-size: 18px;
}

.rule-editor-section-preview {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.rule-editor-section-preview:last-child {
  border-bottom: none;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.section-label i {
  color: var(--accent);
  font-size: 16px;
}

.ai-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.ai-badge i {
  font-size: 14px;
}

.rule-form-field {
  margin-bottom: 16px;
}

.rule-form-field:last-child {
  margin-bottom: 0;
}

.rule-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.rule-form-field-sm {
  /* Inherits from parent */
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-value {
  background: var(--input-bg);
  border: 1px solid var(--border-color-strong);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.cache-key-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--input-bg);
  border: 1px solid var(--border-color-strong);
  border-radius: 6px;
}

.cache-key-chips .chip {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.json-preview {
  background: var(--code-bg-block);
  border: 1px solid var(--border-color-strong);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.json-line {
  color: var(--text);
}

.json-indent {
  padding-left: 20px;
}

.json-key {
  color: #d73a49;
  font-weight: 600;
}

.json-string {
  color: #032f62;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 24px;
    align-items: center;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hamburger-menu {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background: var(--nav-mobile-bg);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    box-shadow: -4px 0 20px var(--shadow-strong);
    transition: right 0.3s ease;
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
  }

  /* Remove button styling from Dashboard link on mobile */
  .nav-links .btn-primary {
    background: none;
    color: var(--text);
    padding: 12px 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    display: block;
    width: 100%;
    text-align: center;
  }

  .nav-links .btn-primary:hover {
    color: var(--accent);
    transform: none;
    box-shadow: none;
  }

  /* Mobile dropdown styles */
  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 8px 0 0 0;
    background: rgba(253, 108, 29, 0.05);
    border-radius: 4px;
  }

  .nav-dropdown.active .nav-dropdown-content {
    display: block;
  }

  .nav-dropdown-content a {
    font-size: 16px;
    padding: 10px 16px;
    border-bottom: none;
  }

  .nav-dropdown > a::after {
    content: " \25BC";
    font-size: 10px;
    margin-left: 8px;
  }

  .nav-dropdown.active > a::after {
    content: " \25B2";
  }

  .architecture-flow {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  .footer-container {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section-title {
    font-size: 28px;
  }

  .benefits-grid,
  .features-grid,
  .features-grid-2col,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  /* Rules Showcase Section - Mobile */
  .rules-showcase-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .rules-showcase-text .section-title,
  .rules-showcase-text .section-intro {
    text-align: center;
  }

  .rules-showcase-text .section-badge {
    display: flex;
    justify-content: center;
  }

  .rules-showcase-visual {
    min-height: auto;
  }

  .rule-editor-preview {
    font-size: 13px;
  }

  .rule-form-row {
    grid-template-columns: 1fr;
  }

  .json-preview {
    font-size: 11px;
  }

  .rules-cta-container {
    margin-top: 32px;
  }

  .rules-cta {
    width: 100%;
    max-width: none;
  }
}

/* ===== Header docs-search box (shared across marketing + docs pages) ===== */
.docs-search-box {
  position: relative;
  display: flex;
  align-items: center;
}
input.docs-search-input,
.docs-search-input {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border-color-strong);
  border-radius: 8px;
  padding: 8px 36px 8px 36px;
  width: 220px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.docs-search-input::placeholder { color: var(--muted); }
.docs-search-input:focus {
  background: var(--card-bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(253, 108, 29, 0.12);
}
.docs-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.docs-search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.docs-search-kbd {
  position: absolute;
  right: 10px;
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-bg);
  border: 1px solid var(--border-color-strong);
  border-radius: 4px;
  padding: 2px 6px;
  pointer-events: none;
}
.docs-search-input:focus + .docs-search-kbd,
.docs-search-results-open ~ .docs-search-kbd { display: none; }
.docs-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 460px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color-strong);
  border-radius: 12px;
  box-shadow: 0 12px 40px var(--shadow-strong);
  z-index: 1100;
}
.docs-search-results-open { display: block; }
.docs-search-result {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color-subtle);
  transition: background 0.12s ease;
}
.docs-search-result:last-child { border-bottom: none; }
.docs-search-result:hover,
.docs-search-result-active { background: var(--hover-bg); }
.docs-search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.docs-search-result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.docs-search-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.docs-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--hover-bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.docs-search-chip i { font-size: 10px; }
.docs-search-result-summary {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.docs-search-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 1024px) {
  .docs-search-input { width: 180px; }
  .docs-search-results { width: 360px; }
}
@media (max-width: 768px) {
  .docs-search-box { width: 100%; }
  .docs-search-input { width: 100%; }
  .docs-search-results { width: 100%; right: auto; left: 0; }
}

/* ===================================================================== */
/* THEME TOGGLE BUTTON                                                   */
/* Auto-injected by /lib/theme.js into .nav-links on every page.         */
/* ===================================================================== */
.nav-theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.nav-theme-toggle:hover {
  color: var(--accent);
  background: var(--hover-bg);
  border-color: rgba(253, 108, 29, 0.2);
}
.nav-theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===================================================================== */
/* DARK MODE — syntax-highlight overrides only.                          */
/*                                                                       */
/* Everything else flips automatically because the components reference  */
/* tokens (--bg, --card-bg, --border-color, --code-bg, --shadow, etc.)   */
/* that get redefined under html.dark-mode at the top of this file. If   */
/* you find yourself adding a new `.dark-mode .x { ... }` rule below,    */
/* the right move is almost always to refactor `.x` to use a token       */
/* instead — see the :root block for the full token vocabulary.          */
/* ===================================================================== */

/* JSON syntax colors — light-mode greens/reds wash out on dark, so we
   substitute GitHub-dark-style hues. Cannot be expressed as a token
   override because the light values are component-specific. */
.dark-mode .json-key { color: #ff7b72; }
.dark-mode .json-string { color: #79c0ff; }
.dark-mode .cache-key-chips .chip {
  background: rgba(59, 130, 246, 0.18);
  color: #7eaaff;
}

/* ===================================================================== */
/* PRINT                                                                 */
/* The nav is position:fixed and the footer is page chrome — both would  */
/* overlap content or reprint on every sheet. Hide them, and reclaim the */
/* top padding the content wrappers reserve for the fixed nav. Applies   */
/* site-wide (marketing, docs, articles).                                */
/* ===================================================================== */
@media print {
  .landing-nav,
  .landing-footer,
  .docs-footer,
  .hamburger-menu,
  .nav-theme-toggle,
  .docs-search-box,
  .gs-float-nav { display: none !important; }

  /* These wrappers pad their top to clear the fixed nav — reclaim it. */
  .article-page,
  .docs-article-page { padding-top: 0 !important; min-height: 0 !important; }
  .docs-hero,
  .cache-hero { padding-top: 24px !important; }
  .docs-hero::before,
  .cache-hero::before { display: none !important; }

  /* Don't strand a heading at the bottom of a page. */
  h1, h2, h3 { break-after: avoid-page; }
  pre, blockquote, table, figure, li { break-inside: avoid; }
}
