:root {
  --bg: #0d1120;
  --bg-soft: #141a2e;
  --card: #171e35;
  --line: #26304f;
  --ink: #e8edfb;
  --muted: #9aa7c7;
  --blue: #2b8cff;
  --teal: #22d3c5;
  --violet: #8b5cf6;
  --grad: linear-gradient(90deg, #2b8cff 0%, #22d3c5 50%, #8b5cf6 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

header.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 17, 32, .86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
/* min-height, not height: the nav wraps on a narrow screen, and a fixed height would let it run
   out of the bar. */
header.top .wrap {
  display: flex; align-items: center; gap: 20px; min-height: 74px; padding-block: 8px;
}
header.top img { height: 55px; }
header.top nav { margin-left: auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
header.top nav a { color: var(--muted); font-size: 15px; position: relative; }
header.top nav a:hover { color: var(--ink); text-decoration: none; }
/* The same gradient as the wordmark, drawn in from the middle under the link being pointed at. */
header.top nav a::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: -4px; height: 2px;
  background: var(--grad); border-radius: 2px; transition: left .2s, right .2s;
}
header.top nav a:hover::after { left: 0; right: 0; }

/* Faint graph paper behind the hero — the ruled background of every schema drawing anybody has
   ever done on the back of a napkin. Fading out at the bottom keeps it out of the reading. */
.hero { padding: 72px 20px 56px; text-align: center; position: relative; isolation: isolate; }
/* The grid and its fade live on a layer of their own: a mask on the hero itself faded the buttons
   and the command below them along with the paper. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px, 34px 34px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 20%, #000 35%, transparent 78%);
  mask-image: radial-gradient(120% 80% at 50% 20%, #000 35%, transparent 78%);
}
/* A little light behind the headline, in the colours of the gradient it is written in. */
.hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 40px; width: min(820px, 100%); height: 340px; transform: translateX(-50%);
  background:
    radial-gradient(closest-side at 30% 50%, rgba(43, 140, 255, .18), transparent),
    radial-gradient(closest-side at 70% 50%, rgba(139, 92, 246, .16), transparent);
  filter: blur(20px);
}

.hero p.prompt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; color: var(--muted); margin: 0 0 14px; letter-spacing: .02em;
}
.hero p.prompt .kw { color: var(--teal); }
.hero p.prompt::after {
  content: "▌"; color: var(--teal); margin-left: 2px;
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero p.prompt::after { animation: none; }
}
.hero h1 {
  font-size: clamp(34px, 5vw, 56px); line-height: 1.12; margin: 0 0 18px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 720px; margin: 0 auto 28px; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 9px; font-weight: 600;
  border: 1px solid var(--line); color: var(--ink); background: rgba(23, 30, 53, .7);
  transition: border-color .15s, transform .15s, background .15s;
}
.btn:hover {
  text-decoration: none; border-color: var(--teal); transform: translateY(-1px); background: var(--card);
}
.btn.primary { background: var(--grad); color: #06101f; border: none; }

/* QuickRun's own element: its logo, our button. The custom properties cover what it draws itself,
   ::part(button) the rest — and `:not(:defined)` keeps the row from jumping while the module is
   still on its way (or never arrives, on a machine that cannot reach quickrun.org). */
quickrun-btn {
  --quickrun-bg: transparent;
  --quickrun-fg: #06101f;
  --quickrun-radius: 9px;
  --quickrun-padding: 11px 22px;
  --quickrun-size: 16px;
  --quickrun-weight: 600;
  --quickrun-font: inherit;
  display: inline-block;
}
quickrun-btn::part(button) {
  background: var(--grad);
  border: none;
  cursor: pointer;
  line-height: 1.2;
}
quickrun-btn::part(button):hover { filter: brightness(1.08); }
quickrun-btn:not(:defined) { display: none; }

pre.run {
  margin: 30px auto 0; max-width: 760px; text-align: left; overflow-x: auto;
  background: #0a0e1b; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, .8);
  padding: 16px 18px; font-size: 13.5px; color: #cdd7f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre.run .c { color: #6b7ba6; }
/* A shell block that looks like one. The prompt is decoration, so it is not selectable and copying
   the block still copies a command that runs. */
pre.run.shell::before {
  content: "$";
  color: var(--teal); font-weight: 600; margin-right: 8px;
  user-select: none; -webkit-user-select: none;
}

.engines { padding-block: 34px 8px; }
.engines h2, section h2 { font-size: 26px; margin: 0 0 6px; }
/* Every section heading reads like the line above a statement, because that is what they are. */
.engines h2::before, section h2::before {
  content: "--";
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--teal); opacity: .75; margin-right: 8px; font-size: .8em; font-weight: 600;
}
.engines p.sub, section p.sub { color: var(--muted); margin: 0 0 22px; }
.engine-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.engine {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, transform .15s;
}
.engine:hover { border-color: var(--teal); transform: translateY(-2px); }
.engine img { width: 26px; height: 26px; }
.engine span { font-size: 14px; }
/* The scheme is the part somebody types into WDS_CONN_*, so the card carries it rather than a
   decoration: reading the grid is reading the accepted spellings. */
.engine-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.engine-name code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; color: var(--muted); opacity: .85;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

section { padding: 44px 0; border-top: 1px solid var(--line); }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  position: relative;
  background: linear-gradient(180deg, #1a2240 0%, var(--card) 60%);
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
/* The site's gradient as a hairline along the top, shown when the card is pointed at. */
.card::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px;
  background: var(--grad); border-radius: 2px; opacity: 0; transition: opacity .2s;
}
.card:hover {
  border-color: #34406a; transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);
}
.card:hover::before { opacity: 1; }
.card h3 { margin: 0 0 8px; font-size: 17px; }
@media (prefers-reduced-motion: reduce) {
  .card, .engine, .btn { transition: none; }
  .card:hover, .engine:hover, .btn:hover { transform: none; }
}
.card p { margin: 0; color: var(--muted); font-size: 15px; }
/* An identifier in running text is an identifier, not emphasis. */
.card code, .compare code, p code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; color: var(--teal);
  background: rgba(34, 211, 197, .08);
  border: 1px solid rgba(34, 211, 197, .18);
  border-radius: 5px; padding: 1px 5px;
}

figure { margin: 22px 0 0; }
figure img {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; display: block;
  box-shadow: 0 22px 50px -30px rgba(0, 0, 0, .9);
}
figure figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; text-align: center; }

.shots { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }

table.compare {
  width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 18px;
  display: block; overflow-x: auto; white-space: nowrap;
}
table.compare th, table.compare td {
  border: 1px solid var(--line); padding: 9px 12px; text-align: left;
}
table.compare th { background: var(--bg-soft); font-weight: 600; }
table.compare tr:hover td { background: rgba(34, 211, 197, .04); }
table.compare td.yes { color: #4ade80; }
table.compare td.no { color: #f87171; }
table.compare td.part { color: #fbbf24; }
table.compare tr:first-child th:first-child { position: sticky; left: 0; }

.note { color: var(--muted); font-size: 13.5px; margin-top: 12px; }
/* A note that leads with a logo: the icon sits on the first line, the text wraps under itself. */
.note.with-icon { display: flex; gap: 10px; align-items: flex-start; }
.note.with-icon img { width: 26px; height: 26px; flex-shrink: 0; margin-top: 1px; }

/* --- lightbox ------------------------------------------------------------------ */
figure.zoomable img { cursor: zoom-in; transition: border-color .15s, transform .15s; }
figure.zoomable img:hover,
figure.zoomable img:focus-visible { border-color: var(--teal); transform: translateY(-2px); }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 24px;
  background: rgba(6, 9, 18, .92);
  backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0; max-width: min(1600px, 92vw); max-height: 90vh;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.lightbox-figure img {
  max-width: 100%; max-height: calc(90vh - 40px);
  object-fit: contain;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.lightbox-figure figcaption { color: var(--muted); font-size: 14px; text-align: center; }

.lightbox-nav, .lightbox-close {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; line-height: 1;
}
.lightbox-nav { width: 44px; height: 64px; font-size: 26px; flex-shrink: 0; }
.lightbox-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; font-size: 22px; }
.lightbox-nav:hover, .lightbox-close:hover { border-color: var(--teal); color: var(--teal); }

@media (max-width: 700px) {
  /* The wordmark gives up its size before the navigation gives up its place, and the navigation
     scrolls sideways rather than stacking three rows high. */
  header.top img { height: 34px; }
  header.top .wrap { gap: 14px; min-height: 60px; }
  header.top nav {
    flex-wrap: nowrap; overflow-x: auto; gap: 16px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
    padding: 6px 24px 6px 0;
  }
  header.top nav::-webkit-scrollbar { display: none; }
  header.top nav a { white-space: nowrap; }
  .hero { padding-top: 48px; }
  .shots { grid-template-columns: 1fr; }
  .lightbox { padding: 12px; }
  .lightbox-nav { width: 36px; height: 52px; font-size: 22px; }
}

footer {
  border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 14px;
}
footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
/* The icon carries no information the text does not, so it stays out of the accessible name. */
footer .by { display: inline-flex; align-items: center; gap: 6px; }
footer .by img { width: 18px; height: 18px; display: block; }
footer .spacer { margin-left: auto; }
/* On a phone the links simply follow the licence line instead of being pushed apart. */
@media (max-width: 700px) { footer .spacer { display: none; } footer .wrap { gap: 10px 18px; } }

@media (prefers-color-scheme: light) {
  /* The site keeps its dark palette on purpose: it shows the product in its default theme. */
}

/* The contact and support forms side by side, one above the other once there is no room. Both fill
   their column: the widget's own width attribute would make two cards of two different sizes. */
.connect {
  display: grid; gap: 20px; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
}
.connect > * { max-width: 100%; }

/* gilde.org's forms draw in a shadow root; the rest of their theme is in assets/widgets.js. What
   the host element itself does is decided out here, and an outer rule beats the widget's :host. */
gilde-contact, gilde-support { font-family: inherit; }
.connect gilde-contact, .connect gilde-support { display: block; width: 100%; }
