/* SPARQL Anything site styles. Colours come from the logo. */
:root {
  --ink: #172036;
  --muted: #4b5671;
  --blue: #274597;
  --blue-deep: #1b3170;
  --green: #0c8a35;
  --paper: #ffffff;
  --mist: #f1f4fa;
  --line: #d8dfec;
  --code-bg: #121d42;
  --code-ink: #e6ebf7;
  --code-dim: #8e9bc0;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 72rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

code, pre { font-family: var(--mono); font-size: 0.875rem; }
:not(pre) > code {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.3em;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
pre {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.55;
  tab-size: 2;
}
pre.output { background: var(--paper); border-style: dashed; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--paper); padding: 0.5rem 0.75rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(6px)) { .topbar { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(6px); } }
.topbar-inner { display: flex; align-items: center; gap: 1rem; min-height: 3.75rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--blue); text-decoration: none; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; padding: 0.3rem 0; }
.site-nav a:hover { color: var(--blue); text-decoration: underline; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-block; font: inherit; font-size: 0.95rem;
    background: none; border: 1px solid var(--line); border-radius: 6px; padding: 0.35rem 0.8rem; color: var(--ink); cursor: pointer;
  }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.5rem 1.25rem 1rem; }
  .site-nav a { display: block; padding: 0.5rem 0; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.5rem 0 1rem; }
.btn {
  display: inline-block; padding: 0.6rem 1.05rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-weight: 500; text-decoration: none; line-height: 1.3;
}
.btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }

/* Hero */
.hero { padding: 2.75rem 0 2.5rem; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -0.025em; margin-bottom: 0.35em; }
.lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.2rem); color: var(--muted); max-width: 40rem; }
.release-line { font-size: 0.92rem; color: var(--muted); }

/* The example: one file, its Façade-X view, and the query */
.demo {
  margin: 2.25rem 0 0;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 0 rgba(23, 32, 54, 0.04), 0 18px 40px -24px rgba(27, 49, 112, 0.55);
}
.demo pre {
  background: transparent; border: 0; padding: 0.25rem 0 0; margin: 0;
  color: var(--code-ink); font-size: 0.86rem;
}
.demo-tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; background: rgba(255, 255, 255, 0.07); border-radius: 8px; margin-bottom: 0.9rem; }
.demo-tabs button {
  font: 500 0.9rem var(--sans); color: var(--code-dim);
  background: none; border: 0; border-radius: 6px; padding: 0.35rem 0.9rem; cursor: pointer;
}
.demo-tabs button:hover { color: #fff; }
.demo-tabs button[aria-selected="true"] { background: var(--paper); color: var(--blue); }
html:not(.js) .demo-tabs { display: none; }
html:not(.js) .demo-panel + .demo-panel { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.12); }

.demo-panel { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 0; }
.demo-pane { padding: 0.75rem 1rem 1rem; min-width: 0; }
.demo-out { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.pane-title { font-size: 0.85rem; color: var(--code-dim); }
.demo-out .pane-title { color: #9fe0b2; }
.demo-query {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1rem 0.25rem;
}
.demo-query pre { font-size: 0.8rem; color: var(--code-dim); }
.demo figcaption { color: var(--code-dim); font-size: 0.9rem; padding: 0.75rem 1rem 0.25rem; max-width: 52rem; }
.demo figcaption a { color: #c9d5ff; }
.demo figcaption code { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: var(--code-ink); }
.demo-panel[hidden] { display: none; }

@media (max-width: 760px) {
  .demo { padding: 0.75rem; border-radius: 10px; }
  .demo-panel { grid-template-columns: minmax(0, 1fr); }
  .demo-pane { padding: 0.5rem 0.25rem 0.75rem; }
  .demo-out { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 0.75rem; }
  .demo-query { padding: 0.75rem 0.25rem 0; }
}

/* Syntax colours */
.t-str { color: var(--green); }
.t-iri, .t-pn { color: var(--blue); }
.t-kw { font-weight: 500; }
.t-var { color: #8a4d00; }
.demo .t-str { color: #93e2aa; }
.demo .t-iri, .demo .t-pn { color: #b6c6ff; }
.demo .t-kw { color: #ffffff; }
.demo .t-var { color: #ffd38a; }
.demo-query .t-kw, .demo-query .t-iri, .demo-query .t-var { color: var(--code-ink); }

/* News */
.news { padding: 1.5rem 0 2.5rem; }
.news h2 { font-size: 1.15rem; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.5rem 2rem; }
.news-list li { display: grid; grid-template-columns: 6.2rem 1fr; gap: 0.75rem; padding: 0.6rem 0; border-top: 1px solid var(--line); font-size: 0.95rem; line-height: 1.45; }
.news-list a { text-decoration: none; }
.news-list a:hover { text-decoration: underline; }
.news-list time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Sections */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--mist); }
.section-alt :not(pre) > code, .section-alt pre { background: var(--paper); }
.section-intro { font-size: 1.1rem; color: var(--muted); max-width: 44rem; margin-bottom: 2rem; }

/* Getting started */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; max-width: 52rem; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.75rem 3rem; border-left: 2px solid var(--line); margin-left: 1rem; }
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0.5rem; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: -1.05rem; top: -0.1rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 600; font-size: 0.95rem;
  display: grid; place-items: center;
}
.steps h3 { margin-bottom: 0.6rem; padding-top: 0.15rem; }
.steps p { color: var(--muted); }

.alternatives {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.alternatives h3 { font-size: 1.05rem; }
.alternatives p { font-size: 0.95rem; color: var(--muted); }
.alternatives pre, pre.wrap-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.alternatives pre { font-size: 0.82rem; }

/* Façade-X terms */
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 2.5rem; margin: 0 0 2rem; }
.terms div { border-top: 3px solid var(--blue); padding-top: 0.9rem; }
.terms dt { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.35rem; }
.terms dd { margin: 0; color: var(--muted); }
.prefixes { font-size: 0.8rem; max-width: 44rem; }
#facade-x > .wrap > p:last-child { max-width: 44rem; }

/* Features */
.feature-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 4rem; max-width: 62rem; }
@media (max-width: 760px) { .feature-groups { grid-template-columns: minmax(0, 1fr); } }
.feature-groups ul { margin: 0; padding-left: 1.1rem; }
.feature-groups li { margin-bottom: 0.55rem; }
.feature-groups li::marker { color: var(--blue); }
.formats-title { margin-top: 3rem; }
.formats { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.formats a {
  display: inline-block; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--ink); font-size: 0.95rem;
}
.formats a:hover { border-color: var(--blue); color: var(--blue); }
.formats-note { font-size: 0.95rem; color: var(--muted); }

/* Tutorials */
.tutorials { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0 3rem; }
.tutorials > li { padding: 1.1rem 0 1.25rem; border-top: 1px solid var(--line); }
.tutorials h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.tutorials h3 a { text-decoration: none; }
.tutorials h3 a:hover { text-decoration: underline; }
.tutorials p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0.6rem; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tags li { font-size: 0.8rem; color: var(--blue); background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.4rem; }

/* Standard */
.section-standard { background: var(--blue); color: #fff; }
.section-standard a { color: #fff; }
.section-standard :not(pre) > code { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.standard-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; }
.standard-grid > div:first-child p { font-size: 1.1rem; max-width: 34rem; }
.standard-grid h3 { font-size: 1rem; margin-top: 0.25rem; }
.spec-list { list-style: none; padding: 0; margin: 0 0 1.75rem; }
.spec-list a { text-decoration: none; }
.spec-list a:hover { text-decoration: underline; }
.spec-list li { padding: 0.4rem 0; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.section-standard .note { font-size: 0.92rem; color: #dbe3ff; }
.btn-light { background: #fff; border-color: #fff; color: var(--blue) !important; }
.btn-light:hover { background: var(--mist); }
.btn-outline { background: transparent; border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.08); }
@media (max-width: 760px) { .standard-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0 0 2.5rem; max-width: 52rem; }
.pub { padding: 1rem 0; border-top: 1px solid var(--line); }
.pub-title { font-weight: 600; margin-bottom: 0.25rem; }
.pub-meta { color: var(--muted); font-size: 0.97rem; margin-bottom: 0.4rem; }
.pub details summary { cursor: pointer; font-size: 0.9rem; color: var(--blue); width: fit-content; }
.pub details pre { margin-top: 0.6rem; font-size: 0.8rem; }

/* Footer */
.footer { background: var(--mist); border-top: 1px solid var(--line); padding: 3rem 0 3.5rem; font-size: 0.97rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
.footer h2 { font-size: 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.4rem; }
.footer-about p { color: var(--muted); font-size: 0.92rem; }
.footer-about img { display: block; margin-bottom: 0.75rem; }
