:root {
  --bg: #ffffff;
  --text: #0e1829;
  --muted: #5b6475;
  --border: #e6e3f0;
  --accent: #7538f1;
  --accent-soft: #f3eeff;
  --card: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --text: #f5f5f7;
    --muted: #a3abbd;
    --border: #222b3d;
    --accent: #a07cff;
    --accent-soft: #1d1838;
    --card: #111a2c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  border-top: 4px solid var(--accent);
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px 80px;
}

header.site { margin-bottom: 40px; }
header.site img { display: block; height: 40px; width: auto; }

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 40px 0 8px; padding-top: 16px; border-top: 1px solid var(--border); }
h1 + .muted { font-size: 1.1rem; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
h3 { font-size: 1rem; margin: 24px 0 4px; }
p, li { color: var(--text); }
.muted { color: var(--muted); }
a { color: var(--accent); }
ul { padding-left: 1.25rem; }
li + li { margin-top: 4px; }

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap { overflow-x: auto; }

footer { margin-top: 64px; font-size: 0.9rem; color: var(--muted); }

/* ---------------------------------------------------------------- product cards */
.products { margin-top: 56px; }
.section-title {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.product-card {
  --brand: var(--accent);
  --brand-2: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: 0 12px 32px -16px color-mix(in srgb, var(--brand) 55%, transparent);
}
.product-card.flowable { --brand: #4e7fbb; --brand-2: #36f1c5; }

.product-card-head { display: flex; align-items: center; gap: 14px; }
.product-card h3 { margin: 0; font-size: 1.25rem; }
.product-card p { margin: 0; color: var(--muted); }

.product-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand) 12%, var(--card));
}

.tag {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.features li { position: relative; padding-left: 24px; font-size: 0.95rem; }
.features li + li { margin-top: 0; }
.features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--brand-2);
  border-bottom: 2px solid var(--brand-2);
  transform: rotate(-45deg);
}

.product-links { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; white-space: nowrap; }
.product-links .dot { color: var(--muted); }
.product-links a { font-weight: 500; text-decoration: none; color: var(--brand); }
.product-links a:hover { text-decoration: underline; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- product pages */
body.flowable { --accent: #3f6fae; --accent-soft: #eaf2fd; border-image: linear-gradient(90deg, #4e7fbb, #36f1c5) 1; }

.product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 40px;
}
.product-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
}
.product-header .by { font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.product-header .by:hover strong { color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .product-card.flowable { --brand: #86c1f6; }
  body.flowable { --accent: #86c1f6; --accent-soft: #14243a; }
}
.tag-beta { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
