/* redicon.pk/docs — shared stylesheet for the Velocity Bridge user guide.
 *
 * Light by default, dark on request. That is the opposite of the marketing
 * site, and deliberate: the home page is a dark hero you glance at, this is
 * long-form text somebody reads for ten minutes. The toggle lives in the
 * header and the choice is remembered.
 *
 * Everything is driven by the variables in :root / [data-theme="dark"], so a
 * page never names a colour directly — add a page, inherit the theme.
 *
 * Fonts are the site's own, self-hosted from ../fonts/. No Google Fonts here
 * for the same reason as everywhere else on this domain.
 */

@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:400;font-display:swap;src:url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:500;font-display:swap;src:url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:600;font-display:swap;src:url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:700;font-display:swap;src:url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;src:url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:600;font-display:swap;src:url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:'Archivo';font-style:normal;font-weight:800;font-display:swap;src:url("../fonts/archivo-latin-800-normal.woff2") format("woff2")}

/* ── Light, the default ─────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --page:      #ffffff;
  --surface:   #f7f8fa;
  --sunken:    #f0f2f5;
  --line:      #e2e6ec;
  --line-soft: #eef1f5;

  --ink:       #14181f;   /* headings */
  --body:      #39414e;   /* paragraphs — 9.1:1 on white */
  --muted:     #66707e;   /* captions — 5.2:1 on white */

  --accent:      #c9391f;
  --accent-soft: #fdf0ed;
  --accent-line: #f3c9c0;

  /* Borrowed from the app so the docs name colours the reader can see on
     screen: local is amber, remote is cyan, in both themes. */
  --local:   #b26b00;
  --remote:  #0f7d8c;

  --note:      #eef5fd;
  --note-line: #c5ddf5;
  --warn:      #fdf4e7;
  --warn-line: #f0d9ae;

  --shadow: 0 1px 2px rgba(20, 24, 31, .05), 0 8px 24px rgba(20, 24, 31, .05);

  --chrome:      #0b0e14;  /* header and footer stay dark in both themes */
  --chrome-ink:  #e6ecf3;
  --chrome-mute: #8b98a9;
  --chrome-line: #1e2633;
}

/* ── Dark ───────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  color-scheme: dark;

  --page:      #0b0e14;
  --surface:   #10141c;
  --sunken:    #0e121a;
  --line:      #1e2633;
  --line-soft: #171d27;

  --ink:       #e9eef5;
  --body:      #b3becc;
  --muted:     #8491a1;

  --accent:      #f0705a;
  --accent-soft: #1d1210;
  --accent-line: #40221c;

  --local:   #f6a72b;
  --remote:  #3ee0f5;

  --note:      #0e1722;
  --note-line: #1c3346;
  --warn:      #1c1710;
  --warn-line: #3d3018;

  --shadow: none;

  --chrome:      #070a10;
  --chrome-ink:  #e6ecf3;
  --chrome-mute: #8b98a9;
  --chrome-line: #161d27;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.dh {
  position: sticky; top: 0; z-index: 40;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-line);
  color: var(--chrome-ink);
}
.dh-in {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 18px;
}
.dh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.dh-brand svg { width: 19px; height: 21px; display: block; }
.dh-brand b {
  font-family: Archivo, 'IBM Plex Sans', sans-serif; font-weight: 800;
  font-size: 16px; letter-spacing: -.03em; color: var(--chrome-ink);
}
.dh-sep { color: var(--chrome-mute); opacity: .5; }
.dh-title { font-size: 14.5px; font-weight: 500; color: var(--chrome-mute); text-decoration: none; }
.dh-title:hover { color: var(--chrome-ink); }
.dh-spacer { flex: 1; }
.dh-link {
  font-size: 13.5px; font-weight: 500; color: var(--chrome-mute);
  text-decoration: none; padding: 6px 0;
}
.dh-link:hover { color: var(--chrome-ink); }

.dh-theme {
  display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px;
  border: 1px solid var(--chrome-line); border-radius: 16px; background: transparent;
  color: var(--chrome-mute); font: 500 12.5px 'IBM Plex Sans', sans-serif;
  cursor: pointer;
}
.dh-theme:hover { border-color: #33404f; color: var(--chrome-ink); }
.dh-theme svg { width: 14px; height: 14px; }
.dh-theme .on-light { display: inline; }
.dh-theme .on-dark { display: none; }
[data-theme="dark"] .dh-theme .on-light { display: none; }
[data-theme="dark"] .dh-theme .on-dark { display: inline; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.dwrap {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 52px;
  align-items: start;
}
.dnav {
  position: sticky; top: 60px; max-height: calc(100vh - 60px);
  overflow-y: auto; padding: 34px 0 48px;
}
.dnav h4 {
  margin: 22px 0 9px; font: 600 10.5px 'IBM Plex Mono', monospace;
  letter-spacing: .16em; color: var(--muted); text-transform: uppercase;
}
.dnav h4:first-child { margin-top: 0; }
.dnav a {
  display: block; padding: 5px 11px; margin-left: -11px; border-radius: 6px;
  font-size: 14.5px; color: var(--body); text-decoration: none;
}
.dnav a:hover { background: var(--surface); color: var(--ink); }
.dnav a[aria-current="page"] {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}

.dmain { padding: 40px 0 96px; min-width: 0; max-width: 760px; }

/* ── Type ───────────────────────────────────────────────────────────────── */
.eyebrow {
  font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: .2em;
  color: var(--muted); text-transform: uppercase;
}
h1 { margin: 10px 0 14px; font-size: 40px; line-height: 1.12; letter-spacing: -.03em; color: var(--ink); font-weight: 700; }
h2 { margin: 52px 0 14px; font-size: 25px; letter-spacing: -.02em; color: var(--ink); font-weight: 600;
     padding-top: 14px; border-top: 1px solid var(--line-soft); }
h3 { margin: 32px 0 10px; font-size: 18.5px; letter-spacing: -.01em; color: var(--ink); font-weight: 600; }
h4 { margin: 24px 0 8px; font-size: 16px; color: var(--ink); font-weight: 600; }
p { margin: 0 0 16px; }
.lede { font-size: 19px; line-height: 1.62; color: var(--muted); margin-bottom: 30px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

code {
  font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  font-size: .875em; background: var(--sunken); border: 1px solid var(--line-soft);
  border-radius: 4px; padding: .1em .38em; color: var(--ink);
}
pre {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 9px;
  padding: 15px 17px; overflow-x: auto; margin: 0 0 20px;
}
pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.65; }

kbd {
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px;
  background: var(--page); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
  color: var(--ink); white-space: nowrap;
}

/* ── Blocks ─────────────────────────────────────────────────────────────── */
.note, .warn {
  border: 1px solid var(--note-line); background: var(--note);
  border-radius: 9px; padding: 15px 18px; margin: 0 0 22px;
}
.warn { border-color: var(--warn-line); background: var(--warn); }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }
.note b, .warn b { color: var(--ink); }

table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
     font-family: 'IBM Plex Mono', monospace; font-weight: 600; border-bottom-color: var(--line); }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* The FUI glossary table: term on the left in the theme's own type, plain
   English on the right. The visual contrast is the point of the chapter. */
.gloss td:first-child {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: .08em;
  color: var(--remote); white-space: nowrap; font-weight: 600;
}
.gloss td:nth-child(2) { font-weight: 600; color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 14px; margin: 0 0 26px; }
.card {
  border: 1px solid var(--line); border-radius: 11px; padding: 18px 20px;
  background: var(--surface); text-decoration: none; display: block; box-shadow: var(--shadow);
}
a.card:hover { border-color: var(--accent-line); }
.card b { display: block; font-size: 15.5px; color: var(--ink); margin-bottom: 5px; }
.card span { font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ── Screenshots ────────────────────────────────────────────────────────────
 *
 * Every figure is written into the page with its final filename and caption,
 * whether or not the image file exists yet. A missing file is replaced at
 * runtime by a labelled placeholder naming the file that is expected, so the
 * gap is obvious to us and never a broken-image icon to a reader.
 *
 * `.wide` breaks out of the text column for full-window captures, which are
 * unreadable at 760px.
 */
.shot { margin: 26px 0 30px; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--sunken); box-shadow: var(--shadow);
}
.shot figcaption {
  margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--muted);
  padding-left: 13px; border-left: 2px solid var(--line);
}
.shot.wide { margin-left: -60px; margin-right: -60px; }
@media (max-width: 1100px) { .shot.wide { margin-left: 0; margin-right: 0; } }

/* Stand-in for a screenshot that has not been taken yet. */
.shot-missing {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 190px; padding: 26px 22px; text-align: center;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--sunken);
}
.shot-missing b {
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px;
  color: var(--accent); font-weight: 600; word-break: break-all;
}
.shot-missing span { font-size: 13.5px; color: var(--muted); max-width: 52ch; line-height: 1.5; }
.shot-missing em { font-style: normal; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; font-family: 'IBM Plex Mono', monospace; color: var(--muted); opacity: .7; }

.pager { display: flex; gap: 14px; margin-top: 60px; padding-top: 26px; border-top: 1px solid var(--line); }
.pager a { flex: 1; text-decoration: none; border: 1px solid var(--line); border-radius: 9px; padding: 14px 17px; }
.pager a:hover { border-color: var(--accent-line); }
.pager small { display: block; font: 600 10.5px 'IBM Plex Mono', monospace; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.pager b { color: var(--ink); font-weight: 600; }
.pager .next { text-align: right; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.dfoot {
  background: var(--chrome); border-top: 1px solid var(--chrome-line);
  color: var(--chrome-mute); font-size: 14px; margin-top: 60px;
}
.dfoot-in { max-width: 1180px; margin: 0 auto; padding: 30px 24px; display: flex; gap: 20px; flex-wrap: wrap; }
.dfoot a { color: var(--chrome-mute); text-decoration: none; }
.dfoot a:hover { color: var(--chrome-ink); }
.dfoot .grow { flex: 1; }

/* ── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dwrap { grid-template-columns: 1fr; gap: 0; }
  .dnav {
    position: static; max-height: none; padding: 22px 0 6px;
    border-bottom: 1px solid var(--line); margin-bottom: 8px;
  }
  .dnav-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .dnav h4 { display: none; }
  .dnav a { white-space: nowrap; margin-left: 0; border: 1px solid var(--line); }
  .dmain { padding-top: 26px; }
  h1 { font-size: 31px; }
  .dh-link { display: none; }
}
