/*
  frontql offline - shared site styles.

  index.html, docs.html and demo.html all load this: the dark,
  edge-of-the-network look, with a deep navy background, mint accent, a code
  window in the hero and quiet outlined cards underneath. demo.css layers the
  playground's own components (controls, inspector, tables) on top of it.
*/

:root {
  color-scheme: dark;
  --bg: #050914;
  --bg-soft: #07121b;
  --panel: rgba(17, 24, 39, 0.82);
  --panel-strong: #080d1c;
  --ink: #f8fafc;
  --muted: #b8c4d4;
  --soft: #8190a7;
  --line: rgba(148, 163, 184, 0.2);
  --line-strong: rgba(148, 163, 184, 0.32);
  --accent: #16d6a7;
  --accent-soft: rgba(22, 214, 167, 0.14);
  --rose: #ff6f91;
  --amber: #fbbf24;
  --blue: #22d3ee;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 51% 3%, rgba(15, 118, 110, 0.34), transparent 30rem),
    radial-gradient(circle at 93% 94%, rgba(34, 211, 238, 0.18), transparent 22rem),
    linear-gradient(135deg, #050914 0%, #050914 52%, #07121b 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.5;
}

/* Faint grid, fading out below the hero. */
body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), transparent 58%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 24px clamp(18px, 3.5vw, 50px) 50px;
}

/* ------------------------------------------------------------------ top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: #ffffff;
  font-size: 1.06rem;
  font-weight: 780;
  letter-spacing: -0.01em;
}

.brand-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  padding: 1px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-actions,
.cta-row,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-actions {
  justify-content: flex-end;
}

/* ------------------------------------------------------------------ buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 17px;
  font-size: 0.82rem;
  font-weight: 760;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: #03120f;
}

.button.primary:hover {
  background: #35e4b8;
}

.button.light {
  background: #ffffff;
  color: #050914;
}

.button.ghost {
  border-color: var(--line);
  background: rgba(8, 13, 28, 0.58);
  color: #dce5f2;
}

.button.ghost:hover {
  border-color: var(--line-strong);
  background: rgba(15, 23, 42, 0.82);
}

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(336px, 1.14fr);
  align-items: center;
  gap: clamp(22px, 4.2vw, 55px);
  min-height: calc(70vh - 105px);
  padding: 53px 0 62px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border: 1px solid rgba(22, 214, 167, 0.35);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #a8ffe9;
  padding: 0 11px;
  font-size: 0.74rem;
  font-weight: 650;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

.hero h1 {
  max-width: 15ch;
  margin-top: 24px;
  color: #ffffff;
  font-size: clamp(2.15rem, 4.9vw, 4.35rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
}

.hero-copy {
  max-width: 34.5rem;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(0.86rem, 1.18vw, 0.98rem);
  line-height: 1.7;
}

.hero-copy code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.13);
  padding: 0.08em 0.36em;
  color: #dbe7f5;
  font-family: var(--mono);
  font-size: 0.86em;
}

.cta-row {
  margin-top: 29px;
}

/* -------------------------------------------------------------- code window */

.code-shell {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(15, 23, 42, 0.78);
  box-shadow: var(--shadow);
  padding: 17px;
}

.code-shell::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  content: "";
  transform: translate(-14px, -14px);
  background: rgba(22, 214, 167, 0.08);
  filter: blur(2px);
}

.code-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  padding: 13px 17px 0;
}

.window-dots {
  display: inline-flex;
  gap: 6px;
}

.window-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.window-dot.rose {
  background: var(--rose);
}

.window-dot.amber {
  background: var(--amber);
}

.window-dot.green {
  background: var(--accent);
}

.code-label {
  color: var(--soft);
  font-size: 0.66rem;
  font-weight: 720;
}

.code-window pre {
  overflow-x: auto;
  padding: 22px 20px 24px;
  color: #d6deef;
  font-family: var(--mono);
  font-size: clamp(0.68rem, 0.76vw, 0.78rem);
  line-height: 1.85;
}

.code-window code {
  font: inherit;
}

.token-keyword {
  color: #f0a6ff;
}

.token-name {
  color: #d7e0ef;
}

.token-string {
  color: #45f0c0;
}

.token-number {
  color: #80d8ff;
}

.token-comment {
  color: #7c8ba5;
}

/* ------------------------------------------------------------------- cards */

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 14px;
}

.link-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(15, 23, 42, 0.68);
  padding: 21px;
}

.link-card h2 {
  color: #ffffff;
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.link-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.link-card .card-actions {
  margin-top: auto;
  padding-top: 17px;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-bottom: 1px solid rgba(22, 214, 167, 0.5);
  color: #9fffe6;
  font-size: 0.82rem;
  font-weight: 760;
}

.inline-link:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

/* ------------------------------------------------------------------ footer */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--soft);
  font-size: 0.76rem;
}

.footer a {
  color: #9fffe6;
}

.footer a:hover {
  color: #ffffff;
}

/* -------------------------------------------------------------------- docs */

.doc {
  max-width: 62rem;
  margin: 0 auto;
  padding: 44px 0 10px;
}

.doc h1 {
  color: #ffffff;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.doc .lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.15vw, 1rem);
  line-height: 1.75;
}

.doc h2 {
  margin-top: 2.7rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  color: #ffffff;
  font-size: clamp(1.1rem, 1.7vw, 1.32rem);
  letter-spacing: -0.01em;
}

.doc h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.doc h3 {
  margin-top: 1.7rem;
  color: #ffffff;
  font-size: 0.98rem;
}

.doc p {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.78;
}

.doc ul,
.doc ol {
  margin-top: 0.9rem;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc li {
  margin-top: 0.5rem;
  line-height: 1.72;
}

.doc b,
.doc strong {
  color: #e7eefb;
}

.doc a {
  color: #9fffe6;
  border-bottom: 1px solid rgba(22, 214, 167, 0.4);
}

.doc a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.doc code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.13);
  padding: 0.08em 0.36em;
  color: #dbe7f5;
  font-family: var(--mono);
  font-size: 0.84em;
}

.doc pre {
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 17px 19px;
  color: #d6deef;
  font-family: var(--mono);
  font-size: 0.79rem;
  line-height: 1.8;
}

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

.doc table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.doc th,
.doc td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  color: var(--muted);
  text-align: left;
}

.doc th {
  background: rgba(148, 163, 184, 0.1);
  color: #ffffff;
  font-weight: 700;
}

.doc dl {
  margin: 1rem 0 0;
}

.doc dt {
  margin-top: 0.95rem;
  color: #e7eefb;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.doc dd {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.doc .warning,
.doc h2.warning {
  color: #ff9db4;
}

.doc .warning code {
  color: inherit;
}

.doc h2.warning {
  border-top-color: rgba(255, 111, 145, 0.32);
}

/* ------------------------------------------------- code examples in docs */

/* The hero's code window, sized down for a page of many examples. The markup
   is a plain <pre>; code-shell.js wraps it in .code-shell / .code-window /
   .window-bar, and labels it from the enclosing section heading. */
.doc .code-shell {
  margin-top: 1rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.55);
  box-shadow: none;
  padding: 9px;
}

.doc .code-shell::before {
  display: none;
}

.doc .code-window {
  border-radius: 13px;
}

.doc .window-bar {
  padding: 9px 12px 0;
}

.doc .code-window pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 15px 16px 17px;
  font-size: 0.78rem;
  line-height: 1.8;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 49px;
  }

  .hero h1 {
    max-width: 18ch;
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 50% 1%, rgba(15, 118, 110, 0.32), transparent 19rem),
      linear-gradient(135deg, #050914 0%, #07121b 100%);
  }

  .shell {
    padding: 18px 16px 38px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .nav-actions .button,
  .cta-row .button {
    width: 100%;
    min-height: 38px;
  }

  .hero {
    gap: 24px;
    padding: 39px 0 36px;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 10.5vw, 2.9rem);
    line-height: 1;
  }

  .hero-copy {
    margin-top: 17px;
    font-size: 0.86rem;
    line-height: 1.62;
  }

  .code-shell {
    border-radius: 18px;
    padding: 10px;
  }

  .code-window {
    border-radius: 14px;
  }

  .window-bar {
    padding: 10px 12px 0;
  }

  .code-label {
    display: none;
  }

  .code-window pre {
    padding: 17px 13px 18px;
    font-size: 0.64rem;
    line-height: 1.72;
  }

  .link-card {
    padding: 18px;
  }

  .doc {
    padding-top: 32px;
  }

  .doc pre {
    font-size: 0.72rem;
  }
}
