/* AZ Tools - documentation pages (tools/*.html). Independent of styles.css, which lays
   out the single centred landing page. Same palette and type as the landing page. */

:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #0b0b0b;
  --panel: #131417;
  --panel-2: #191b20;
  --line: #262931;
  --text: #f0f1f4;
  --muted: #9aa0aa;
  --accent: #5b8def;        /* Rigging colour of the AZ Tools icons */
  --accent-soft: rgba(91, 141, 239, 0.14);
  --ok: #9fd39a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(11, 11, 11, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
}
.topbar__brand:hover { text-decoration: none; }
.topbar__brand img { width: 26px; height: 26px; object-fit: contain; }

.topbar__nav {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}
.topbar__nav a {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}
.topbar__nav a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.topbar__nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }

/* page */
.doc {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) 1rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem 1.3rem;
  align-items: center;
  margin-bottom: 2.2rem;
}
.hero__icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.hero h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.hero__tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}
.pills {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pills li {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
}
.pills li.accent { color: #cfe0ff; border-color: #3b5a9c; background: var(--accent-soft); }

section { margin-top: 2.4rem; }
h2 {
  font-size: 1.25rem;
  margin: 0 0 0.8rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 1rem; margin: 1.3rem 0 0.4rem; color: #cfe0ff; }
p { margin: 0.55rem 0; }
p.lead { font-size: 1.08rem; }
ul, ol { padding-left: 1.3rem; margin: 0.5rem 0; }
li { margin: 0.35rem 0; }
li::marker { color: var(--accent); }
code, kbd {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08em 0.4em;
  color: #e6ebf5;
}
b { color: #fff; }

/* window reference */
.ref { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.ref > div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.6rem 1rem;
  padding: 0.75rem 0.95rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ref dt { margin: 0; font-weight: 650; color: #fff; }
.ref dd { margin: 0; color: var(--text); }
.ref dd small { color: var(--muted); }
@media (max-width: 560px) {
  .ref > div { grid-template-columns: 1fr; gap: 0.2rem; }
  .hero { grid-template-columns: 1fr; }
  .hero__icon { width: 64px; height: 64px; }
}

/* under-the-hood diagram */
.diagram {
  margin: 1rem 0 0.6rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
}
.diagram svg { display: block; width: 100%; height: auto; max-width: 720px; margin: 0 auto; }
.diagram text { font-family: inherit; font-size: 13px; fill: var(--text); }
.diagram .box { fill: var(--panel-2); stroke: #3a4150; stroke-width: 1.2; rx: 9; }
.diagram .box.accent { stroke: var(--accent); }
.diagram .box.dim { stroke-dasharray: 4 3; }
.diagram .edge { stroke: #7f8794; stroke-width: 1.4; fill: none; marker-end: url(#arrow); }
.diagram .edge.accent { stroke: var(--accent); }
.diagram .note { fill: var(--muted); font-size: 11.5px; }

.callout {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 12px 12px 0;
}
.callout p { margin: 0.25rem 0; }

.cta {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: #fff;
  color: #0b0b0b;
  font-weight: 650;
}
.cta:hover { text-decoration: none; background: #e9ecf3; }

footer {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

/* catalogue */
.doc--wide { width: min(100%, 62rem); }
.hero--plain { grid-template-columns: 1fr; }
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: -0.6rem 0 1.2rem;
}
.cats a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem 0.4rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 0.86rem;
}
.cats a:hover { text-decoration: none; border-color: #3a4150; background: var(--panel-2); }
.cats img, .cat h2 img { width: 22px; height: 22px; border-radius: 6px; }
.cat h2 { display: flex; align-items: center; gap: 0.6rem; }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.85rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 15.5rem;
  padding: 1.25rem 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #16181d 0%, #121317 100%);
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.tile:hover { text-decoration: none; }
a.tile:hover {
  transform: translateY(-3px);
  border-color: #3b5a9c;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}
.tile > img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 0.9rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}
.tile__logo { object-fit: contain; padding: 10px; background: var(--panel-2); }
.tile h3 {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  line-height: 1.25;
  color: #fff;
}
.tile p {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.tile__meta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.tile__meta b { color: #cfe0ff; font-weight: 650; }
.tile__meta em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.tile__meta em.lic { color: #cfe0ff; border-color: #3b5a9c; background: var(--accent-soft); }
.tile__meta em.free { color: var(--ok); border-color: #2f5a30; background: rgba(159, 211, 154, 0.1); }
.tile__more {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--accent);
}
.tile--plugin { border-style: dashed; background: var(--panel); }
.tile--plugin > img { box-shadow: none; }
@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .tile { min-height: 0; padding: 1rem 0.6rem 0.85rem; }
  .tile > img { width: 56px; height: 56px; }
}

/* gallery on a tool page */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.9rem;
  margin: 0.9rem 0 0.4rem;
}
.shots.single { grid-template-columns: 1fr; }
figure.shot {
  margin: 0;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
figure.shot img,
figure.shot video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
  background: #1d1d20;
}
figure.shot figcaption {
  margin: 0.55rem 0.15rem 0;
  font-size: 0.84rem;
  color: var(--muted);
}
figure.shot.fit img, figure.shot.fit video { width: auto; max-width: 100%; max-height: 640px; margin: 0 auto; }

/* Lab pages (lab/*.html): the same layout in the Lab colour of the AZ Tools icons */
.lab-page {
  --accent: #b8e04a;
  --accent-soft: rgba(184, 224, 74, 0.12);
}
.lab-page h3 { color: #e2f3b5; }
.lab-page .pills li.accent { color: #e2f3b5; border-color: #5c7424; }
.lab-page a.tile:hover { border-color: #5c7424; }
.lab-page .tile__meta b { color: #e2f3b5; }
.tile__meta em.lab { color: #d9f09a; border-color: #5c7424; background: rgba(184, 224, 74, 0.1); }

/* article: formulas, step chains, small code blocks */
.eq {
  margin: 0.9rem 0;
  padding: 0.35rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}
.eq .katex-display { margin: 0.55rem 0; }
.katex { font-size: 1.08em; }
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
  margin: 0.9rem 0;
}
.flow span {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.84rem;
  white-space: nowrap;
}
.flow span.hot { border-color: #5c7424; color: #e2f3b5; background: var(--accent-soft); }
.flow i { color: var(--muted); font-style: normal; }
pre.block {
  margin: 0.9rem 0;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #e6ebf5;
}
pre.block .dim { color: var(--muted); }
.swatch {
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  margin-right: 0.35em;
  border-radius: 50%;
  vertical-align: -0.06em;
}
table.data {
  width: 100%;
  margin: 0.9rem 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.88rem;
}
table.data th, table.data td { padding: 0.5rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }
table.data th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.05em; text-transform: uppercase; }
table.data td { background: var(--panel); }
table.data td.num { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: #e2f3b5; white-space: nowrap; }
.wrap-x { overflow-x: auto; }

/* contact links in the footer */
.social { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.social__name { color: var(--text); font-weight: 600; margin-right: 0.3rem; }
.social a, .contact a {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.social a:hover, .social a:focus-visible { text-decoration: none; transform: translateY(-1px); outline: none; }
.social svg, .contact svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.s-mail:hover, .s-mail:focus-visible { color: #b8e04a; border-color: #5c7424; }
.s-tg:hover, .s-tg:focus-visible { color: #2aabee; border-color: #1f6f99; }
.s-in:hover, .s-in:focus-visible { color: #4d9fff; border-color: #1d5aa6; }
.s-yt:hover, .s-yt:focus-visible { color: #ff3b3b; border-color: #8a2323; }
