/* JexiDB - edenware.app/jexidb/
   Palette comes from the mascot: purple #856bb0 on the site's dark blue.
   The global header and footer come from /edenware-theme.css + /edenware-nav.js
   + /edenware-footer.js; the --ew-* tokens below are the ones they read. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --jdb-max: 1100px;
  --jdb-radius: 14px;
  --jdb-code-bg: #0b1120;
  --jdb-code-border: #26304a;
  --jdb-glow: rgba(133, 107, 176, 0.28);
  /* #856bb0 with white text lands at 4.44:1 - just under AA, so filled
     buttons use the next shade down (5.61:1) and keep the brand hue. */
  --jdb-btn: #755aa2;
  --jdb-btn-hover: #6a5096;

  --ew-primary: #856bb0;
  --ew-primary-hover: #70549c;
  --ew-primary-bg: rgba(133, 107, 176, 0.14);
  --ew-primary-light: #b9a5e0;
  --ew-primary-gradient: linear-gradient(135deg, #856bb0, #4b1484);
}

[data-theme="light"] {
  --ew-primary-light: #5f4785;
  --jdb-glow: rgba(133, 107, 176, 0.18);
}

html {
  scroll-padding-top: 80px;
  scroll-behavior: smooth;
  background: var(--ew-bg);
}

body {
  margin: 0;
  background: var(--ew-bg);
  color: var(--ew-text);
  font-family: var(--ew-font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ew-primary-light);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ew-text);
}

:focus-visible {
  outline: 3px solid var(--ew-primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ew-surface);
  color: var(--ew-text);
  border: 1px solid var(--ew-border);
  border-radius: 0 0 var(--ew-radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* ── layout ─────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--jdb-max);
  margin: 0 auto;
  padding: 0 22px;
}

.band {
  padding: 64px 0;
  border-top: 1px solid var(--ew-border);
}

.band--tight {
  padding: 48px 0;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ew-text-secondary);
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 4.6rem);
  font-weight: 800;
}

h2 {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 3.4vw, 2.1rem);
  font-weight: 700;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.section-intro {
  max-width: 62ch;
  margin: 0 0 30px;
  color: var(--ew-text-secondary);
  font-size: 1.02rem;
}

.section-intro--flush {
  margin-bottom: 0;
}

.section-intro--after {
  margin: 20px 0 0;
}

/* Heading + intro on the left, one mascot pose on the right. */
.section-head {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 30px;
}

.section-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.section-mascot {
  flex: 0 0 auto;
  width: 168px;
  height: auto;
  align-self: flex-end;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.4));
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: 54px 0 64px;
}

.hero .glow {
  position: absolute;
  inset: -30% 40% 40% -20%;
  /* Explicit radii so the fade reaches zero inside the box: a gradient still
     carrying colour when the element ends leaves a hard seam on light themes. */
  background: radial-gradient(58% 62% at 30% 35%, var(--jdb-glow), rgba(133, 107, 176, 0) 100%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
}

.hero-line {
  margin: 14px 0 0;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 600;
  color: var(--ew-text);
}

.lede {
  max-width: 46ch;
  margin: 14px 0 0;
  font-size: 1.02rem;
  color: var(--ew-text-secondary);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--jdb-btn);
  color: #fff;
}

.btn-primary:hover {
  background: var(--jdb-btn-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ew-text);
  border-color: var(--ew-border);
}

.btn-ghost:hover {
  background: var(--ew-primary-bg);
  border-color: var(--ew-primary);
  color: var(--ew-text);
}

/* install pill with copy button */
.install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 16px;
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: 999px;
}

.install code {
  font-family: var(--ew-font-mono);
  font-size: 0.92rem;
  white-space: nowrap;
  color: var(--ew-text);
}

.install .copy-btn {
  padding: 8px 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ew-text);
  background: var(--ew-primary-bg);
  border: 1px solid var(--ew-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.install .copy-btn:hover {
  background: var(--jdb-btn);
  color: #fff;
}

.install .copy-btn[data-copied="true"] {
  background: var(--jdb-btn);
  color: #fff;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--ew-text-secondary);
}

.badges li {
  padding: 5px 12px;
  border: 1px solid var(--ew-border);
  border-radius: 999px;
  background: var(--ew-surface);
}

.badges strong {
  color: var(--ew-text);
  font-weight: 700;
}

.hero-art {
  justify-self: center;
  max-width: 340px;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
}

/* The artwork is a cut-out scene with its own dark backdrop; the mask dissolves
   the rectangle into the page instead of showing a hard edge. */
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: radial-gradient(closest-side, #000 66%, transparent 99%);
  mask-image: radial-gradient(closest-side, #000 66%, transparent 99%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* ── cards ──────────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 22px;
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--jdb-radius);
}

.card p {
  margin: 0;
  color: var(--ew-text-secondary);
  font-size: 0.96rem;
}

.card .num {
  display: block;
  margin-bottom: 10px;
  font-family: var(--ew-font-mono);
  font-size: 0.78rem;
  color: var(--ew-primary-light);
}

/* ── fits / does not fit ────────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.panel {
  padding: 26px 24px;
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--jdb-radius);
}

.panel h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.12rem;
}

.panel .mark {
  font-family: var(--ew-font-mono);
  font-size: 1rem;
  color: var(--ew-primary-light);
}

.panel ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--ew-text-secondary);
  font-size: 0.97rem;
}

.panel li {
  margin-bottom: 9px;
}

.panel li:last-child {
  margin-bottom: 0;
}

.panel li b {
  color: var(--ew-text);
  font-weight: 600;
}

.panel--not {
  background: transparent;
  border-style: dashed;
}

/* ── tables ─────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ew-border);
  border-radius: var(--jdb-radius);
  background: var(--ew-surface);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

caption {
  caption-side: bottom;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--ew-text-secondary);
  text-align: left;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ew-border);
}

thead th {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ew-text-secondary);
  background: rgba(133, 107, 176, 0.08);
  white-space: nowrap;
}

tbody th {
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tr.is-current th,
tr.is-current td {
  background: var(--ew-primary-bg);
}

tr.is-current th {
  color: var(--ew-primary-light);
}

.caveat {
  display: block;
  margin: 0 0 18px;
  padding: 14px 18px;
  font-size: 0.92rem;
  color: var(--ew-text-secondary);
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-left: 3px solid var(--ew-primary);
  border-radius: 0 var(--ew-radius) var(--ew-radius) 0;
}

.caveat strong {
  color: var(--ew-text);
}

/* ── code ───────────────────────────────────────────────────────────────── */

.code-block {
  position: relative;
  margin: 0 0 18px;
  background: var(--jdb-code-bg);
  border: 1px solid var(--jdb-code-border);
  border-radius: var(--jdb-radius);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--jdb-code-border);
  font-family: var(--ew-font-mono);
  font-size: 0.76rem;
  color: #94a3b8;
}

.code-head .copy {
  padding: 6px 12px;
  font-family: var(--ew-font);
  font-size: 0.76rem;
  font-weight: 700;
  color: #e8e8e8;
  background: rgba(133, 107, 176, 0.22);
  border: 1px solid #3b2f5c;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.code-head .copy:hover {
  background: var(--jdb-btn);
  color: #fff;
}

pre {
  margin: 0;
  padding: 18px 18px 20px;
  overflow-x: auto;
  font-family: var(--ew-font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  color: #e4e7ef;
  tab-size: 2;
}

pre code {
  font: inherit;
}

.t-k {
  color: #c4a7ff;
}

.t-s {
  color: #9ae6b4;
}

.t-c {
  color: #8b98b8;
  font-style: italic;
}

.t-f {
  color: #8ec7ff;
}

.t-n {
  color: #f0c987;
}

/* ── proof ──────────────────────────────────────────────────────────────── */

.proof {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  padding: 26px 28px;
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-left: 3px solid var(--ew-primary);
  border-radius: 0 var(--jdb-radius) var(--jdb-radius) 0;
}

.proof p {
  max-width: 62ch;
  margin: 0;
  color: var(--ew-text-secondary);
}

.proof strong {
  color: var(--ew-text);
}

/* ── sponsorship ────────────────────────────────────────────────────────── */

.sponsor {
  padding: 32px;
  background: linear-gradient(160deg, var(--ew-primary-bg), rgba(133, 107, 176, 0) 70%);
  border: 1px solid var(--ew-border);
  border-radius: var(--jdb-radius);
}

.sponsor-row {
  display: flex;
  align-items: center;
  gap: 36px;
}

.sponsor-row .sponsor {
  flex: 1 1 auto;
  min-width: 0;
}

.sponsor-mascot {
  flex: 0 0 auto;
  width: 224px;
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.42));
}

.sponsor p {
  max-width: 64ch;
  color: var(--ew-text-secondary);
}

.sponsor-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.sponsor-note {
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--ew-text-secondary);
}

/* ── illustrations ──────────────────────────────────────────────────────── */

.mid-art {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.mid-art img {
  width: 200px;
  height: auto;
  -webkit-mask-image: radial-gradient(closest-side, #000 64%, transparent 99%);
  mask-image: radial-gradient(closest-side, #000 64%, transparent 99%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* ── shared-chrome contrast ─────────────────────────────────────────────── */

/* The injected footer's muted grey (#64748B) lands at 3.75:1 on the footer
   background. Scoped override only for this page - the shared stylesheet is
   not modified. */
#ew-footer-injected .ew-footer-copy,
#ew-footer-injected .ew-footer-extra,
#ew-footer-injected .ew-footer-social a {
  color: var(--ew-text-secondary);
}

/* ── table scroll hint ──────────────────────────────────────────────────── */

.table-hint {
  display: none;
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--ew-text-secondary);
}

/* ── small screens ──────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .hero-art {
    order: -1;
    max-width: 230px;
    justify-self: start;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .band {
    padding: 48px 0;
  }

  .sponsor {
    padding: 24px 20px;
  }

  .proof {
    padding: 22px 20px;
  }

  .sponsor-row {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .sponsor-mascot {
    order: -1;
    align-self: center;
    width: 150px;
  }
}

@media (max-width: 520px) {
  .install {
    width: 100%;
    justify-content: space-between;
  }

  .cta-row .btn {
    justify-content: center;
  }

  pre {
    font-size: 0.79rem;
    padding: 14px;
  }

  .hero-line {
    font-size: 1.1rem;
  }
}

/* Narrow screens: wrap code instead of scrolling it sideways. */
@media (max-width: 700px) {
  pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .table-hint {
    display: block;
  }

  /* Three mascot positions are enough on a phone; drop this one so the
     section intro keeps a full-width measure. */
  .section-mascot {
    display: none;
  }
}

/* Sections below the hero stay off the render path until they approach the
   viewport. `auto` in contain-intrinsic-size keeps the height the browser last
   measured, so the scrollbar settles after the first paint instead of jumping. */
.band {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
