/* LXNetTools site
   Palette: cool paper + logo black, with the app's own status colours
   used only where they mean something (ok / warning / fault / selected).
   Screenshots come from tools/stylegallery --showcase (see website/README.md). */

:root {
  --paper: #f2f3f4;
  --surface: #ffffff;
  --ink: #000000;
  --ink-2: #4a4f55;
  --ink-3: #6f757b;
  --rule: #c9cdd1;
  --rule-soft: #e1e4e7;
  --ok: #2e9a47;
  --warn: #c98a12;
  --fault: #d23f3f;
  --sel: #2f6fd6;
  --sel-ink: #ffffff;
  --console: #202020;      /* the app's own background */
  --console-2: #2a2a2a;
  --console-ink: #e6e6e6;
  --mark-filter: none;

  --font: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", "Arial Narrow", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.6rem, 5.4vw, 4.25rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17191b;
    --surface: #1f2224;
    --ink: #f2f3f4;
    --ink-2: #b1b7bd;
    --ink-3: #8b9197;
    --rule: #3a3f44;
    --rule-soft: #2b2f33;
    --sel: #3b7be0;
    --mark-filter: invert(1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17191b; --surface: #1f2224; --ink: #f2f3f4; --ink-2: #b1b7bd;
  --ink-3: #8b9197; --rule: #3a3f44; --rule-soft: #2b2f33; --sel: #3b7be0;
  --mark-filter: invert(1); color-scheme: dark;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 5rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sel); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-cond); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; font-family: var(--font-cond); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand img { width: 2rem; height: auto; filter: var(--mark-filter); }
.nav { margin-left: auto; display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: .45rem .75rem; border-radius: 3px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--rule-soft); }
.nav a[aria-current="page"] { color: var(--sel-ink); background: var(--sel); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 600 var(--step-0)/1 var(--font); text-decoration: none;
  padding: .85rem 1.3rem; border-radius: 3px; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--sel); color: var(--sel-ink); }
.btn-quiet { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-quiet:hover { border-color: var(--ink); }
.btn small { font-weight: 400; opacity: .75; font-size: var(--step--1); }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-copy { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 2.75rem); }
.eyebrow { font: 500 var(--step--1)/1.3 var(--font); letter-spacing: .04em; color: var(--ink-3); margin: 0 0 1rem; }
.hero h1 { font-size: var(--step-4); max-width: 18ch; }
.hero .lede { font-size: var(--step-1); color: var(--ink-2); max-width: 40ch; margin: 1.25rem 0 2rem; line-height: 1.45; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero .fine { color: var(--ink-3); font-size: var(--step--1); margin: 1rem 0 0; }
.hero-shot { box-shadow: 0 30px 60px -36px rgba(0,0,0,.55); }

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-rule { border-top: 1px solid var(--rule); }
.section-head { max-width: 40rem; margin-bottom: 2.25rem; }
.section-head h2 { font-size: var(--step-3); margin-bottom: .6rem; }
.section-head p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.45; margin: 0; }

/* Screenshot viewer with the app's own Boxes / List switch */
.viewer-bar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; }
.seg button { font: 500 var(--step--1)/1 var(--font); padding: .55rem 1rem; border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--sel); color: var(--sel-ink); }
.viewer-bar p { margin: 0; color: var(--ink-2); font-size: var(--step--1); }
/* App screenshots, framed like a window; <picture> swaps in the dark-mode capture */
.shot { margin: 0; background: var(--console); border-radius: 6px; padding: clamp(.4rem, 1vw, .75rem); overflow: hidden; }
.shot picture { display: block; }
.shot img { border-radius: 3px; width: 100%; }
.shot [hidden] { display: none; }
.shot-small { max-width: 34rem; justify-self: center; width: 100%; }

/* Screenshot beside its description, alternating sides */
.feature { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.feature + .feature { margin-top: clamp(3rem, 6vw, 4.5rem); }
.feature-flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.feature-flip > .shot { order: 2; }
.feature-wide { grid-template-columns: 1fr; }
.feature-wide .feature-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 clamp(1.5rem, 4vw, 3.5rem); }
.feature-wide .feature-copy h3 { grid-column: 1 / -1; }
.feature-wide .feature-copy p { margin: 0; }
.feature-copy h3 { font-size: var(--step-2); margin-bottom: .75rem; }
.feature-copy p { color: var(--ink-2); max-width: 46ch; }
.feature-copy p:last-child { margin-bottom: 0; }

/* Protocols as a patch sheet */
.patch { width: 100%; border-collapse: collapse; }
.patch th, .patch td { text-align: left; vertical-align: top; padding: 1.1rem 1rem 1.1rem 0; border-top: 1px solid var(--rule); }
.patch tr:last-child td, .patch tr:last-child th { border-bottom: 1px solid var(--rule); }
.patch th { font: 600 var(--step-1)/1.2 var(--font-cond); width: 26%; padding-right: 2rem; }
.patch td { color: var(--ink-2); max-width: 60ch; }
.patch th span { display: block; font: 400 var(--step--1)/1.4 var(--font); color: var(--ink-3); margin-top: .25rem; }

/* Diagnostics columns */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); }
.cols h3 { font-size: var(--step-2); margin-bottom: .6rem; }
.cols p { color: var(--ink-2); }
.status-key { list-style: none; padding: 0; margin: 0; }
.status-key li { padding: .45rem 0 .45rem .9rem; border-left: 3px solid var(--c); margin-bottom: .4rem; color: var(--ink-2); }
.status-key b { color: var(--ink); font-weight: 600; }

/* Closing band */
.closing { background: var(--ink); color: var(--paper); }
.closing h2 { font-size: var(--step-3); max-width: 20ch; margin-bottom: 1rem; }
.closing p { max-width: 44rem; color: color-mix(in srgb, var(--paper) 78%, transparent); font-size: var(--step-1); line-height: 1.45; margin-bottom: 1.75rem; }
.closing .btn-primary { background: var(--paper); color: var(--ink); }
.closing .btn-primary:hover { background: var(--sel); color: var(--sel-ink); }
.closing .btn-quiet { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.closing .btn-quiet:hover { border-color: var(--paper); }
.closing .actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { padding: 2rem 0 2.5rem; color: var(--ink-3); font-size: var(--step--1); }
.site-footer .wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- Inner pages ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.page-head h1 { font-size: var(--step-4); margin-bottom: .75rem; }
.page-head p { font-size: var(--step-1); color: var(--ink-2); max-width: 42rem; margin: 0; line-height: 1.45; }
.page-body { padding-top: 0; }

.notice { border-left: 3px solid var(--warn); background: var(--surface); padding: 1rem 1.25rem; color: var(--ink-2); max-width: 46rem; }
.notice[data-s="fault"] { border-color: var(--fault); }
.notice strong { color: var(--ink); }
.notice code { font-size: .9em; background: var(--rule-soft); padding: .1em .35em; border-radius: 2px; }
.loading { color: var(--ink-3); }

/* Latest release */
.latest { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2rem); }
.latest-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.25rem; margin-bottom: 1.25rem; }
.latest-top h2 { font-size: var(--step-3); }
.latest-top .meta { color: var(--ink-3); }
.tag { display: inline-block; font-size: var(--step--1); font-weight: 600; padding: .1rem .5rem; border-radius: 2px; color: #fff; background: var(--ok); vertical-align: .2em; }
.tag[data-k="pre"] { background: var(--warn); }
.dl-primary { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.dl-primary .hint { color: var(--ink-3); font-size: var(--step--1); }

.assets-wrap { overflow-x: auto; }
.assets { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 32rem; }
.assets th, .assets td { text-align: left; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--rule-soft); }
.assets th { color: var(--ink-3); font-weight: 500; }
.assets td.num { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.assets tr.match td:first-child a { font-weight: 600; }

.notes { margin-top: 1.75rem; border-top: 1px solid var(--rule-soft); padding-top: 1.25rem; max-width: 46rem; }
.notes h3 { font-size: var(--step-1); margin-bottom: .75rem; }
.notes :is(h1, h2, h3, h4) { font-size: var(--step-0); margin: 1.2em 0 .4em; }
.notes ul { padding-left: 1.2rem; }
.notes code { font-size: .9em; background: var(--rule-soft); padding: .1em .35em; border-radius: 2px; }

.older { margin-top: 3rem; }
.older-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.older-head h2 { font-size: var(--step-2); }
.check { display: inline-flex; gap: .5rem; align-items: center; color: var(--ink-2); font-size: var(--step--1); cursor: pointer; }
.check input { accent-color: var(--sel); width: 1rem; height: 1rem; }
details.rel { border-top: 1px solid var(--rule); }
details.rel:last-child { border-bottom: 1px solid var(--rule); }
details.rel summary { cursor: pointer; padding: .9rem 0; display: flex; gap: 1rem; align-items: baseline; list-style: none; }
details.rel summary::-webkit-details-marker { display: none; }
details.rel summary::before { content: "+"; width: 1rem; color: var(--ink-3); font-weight: 600; }
details.rel[open] summary::before { content: "\2212"; }
details.rel summary b { font-family: var(--font-cond); font-size: var(--step-1); font-weight: 600; }
details.rel summary .meta { color: var(--ink-3); font-size: var(--step--1); margin-left: auto; }
details.rel .rel-body { padding: 0 0 1.25rem 2rem; }

/* Requirements and install steps */
.install { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.install h2 { font-size: var(--step-2); margin-bottom: .75rem; }
.install ul, .install ol { margin: 0; padding-left: 1.2rem; color: var(--ink-2); }
.install li + li { margin-top: .5rem; }
.install code { font-size: .9em; background: var(--rule-soft); padding: .1em .35em; border-radius: 2px; }

/* Feedback */
.tips { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule-soft); }
.tips h3 { font-size: var(--step-1); margin-bottom: .5rem; }
.tips ul { margin: 0; padding-left: 1.2rem; color: var(--ink-2); font-size: var(--step--1); }
.tips li + li { margin-top: .35rem; }
.fb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.form { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2rem); }
.form h2, .issues h2 { font-size: var(--step-2); margin-bottom: 1rem; }
.kind { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 1.25rem; padding: 0; border: 0; }
.kind legend { padding: 0; margin-bottom: .5rem; font-weight: 600; }
.kind label { display: block; border: 1px solid var(--rule); border-radius: 3px; padding: .75rem .9rem; cursor: pointer; }
.kind label:has(input:checked) { border-color: var(--sel); box-shadow: inset 0 0 0 1px var(--sel); }
.kind input { accent-color: var(--sel); margin-right: .45rem; }
.kind small { display: block; color: var(--ink-3); margin-top: .2rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field .help { font-weight: 400; color: var(--ink-3); font-size: var(--step--1); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: var(--step-0); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: .6rem .7rem;
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--sel); outline-offset: 0; border-color: var(--sel); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form .fine { color: var(--ink-3); font-size: var(--step--1); margin: 1rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips label { position: relative; border: 1px solid var(--rule); border-radius: 3px; padding: .35rem .65rem; font-weight: 500; font-size: var(--step--1); cursor: pointer; }
.chips label:has(input:checked) { background: var(--sel); color: var(--sel-ink); border-color: var(--sel); }
.chips input { position: absolute; inset: 0; margin: 0; opacity: 0; pointer-events: none; }
.chips label:has(input:focus-visible) { outline: 3px solid var(--sel); outline-offset: 2px; }

.issues-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.issues-bar h2 { margin: 0; }
.issue-list { list-style: none; padding: 0; margin: 0; }
.issue-list li { border-top: 1px solid var(--rule-soft); }
.issue-list li:last-child { border-bottom: 1px solid var(--rule-soft); }
.issue-list a { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; padding: .75rem 0; text-decoration: none; }
.issue-list a:hover .t { text-decoration: underline; }
.issue-list .dot { width: .6rem; height: .6rem; border-radius: 2px; margin-top: .5rem; background: var(--c, var(--ink-3)); }
.issue-list .t { font-weight: 500; }
.issue-list .m { grid-column: 2; color: var(--ink-3); font-size: var(--step--1); }
.more-link { display: inline-block; margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .fb-grid, .feature, .install { grid-template-columns: 1fr; }
  .feature-flip { grid-template-columns: 1fr; }
  .feature-wide .feature-copy { grid-template-columns: 1fr; }
  .feature-wide .feature-copy p + p { margin-top: 1em; }
  .feature-flip > .shot { order: 0; }
  .cols { grid-template-columns: 1fr; }
  .patch th { width: auto; }
}
@media (max-width: 620px) {
  .site-header .wrap { flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; gap: .25rem 1rem; }
  .nav { margin-left: -0.75rem; width: 100%; }
  .patch, .patch tbody, .patch tr, .patch th, .patch td { display: block; width: 100%; }
  .patch th { border-top: 1px solid var(--rule); padding-bottom: .25rem; }
  .patch td { border-top: 0; padding-top: 0; }
  .patch tr:last-child th { border-bottom: 0; }
  .row2, .kind { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
