/* MiX Mobile Systems - front page.
   No JS and no inline styles anywhere: the Caddy CSP on this vhost is
   default-src 'none'; style-src 'self'; img-src 'self'
   so this file is the only styling channel, images must be same-origin
   files (no data: URIs), and there are no web fonts. Keep it that way. */

:root {
  --bg:      #000000;
  --panel:   #0d0d0d;
  --line:    #232323;

  /* The code block is the editor, so it uses the editor's own ground and text,
     not the site's panel tokens: ScreenColorMgr.SetNewDark()'s
     backgroundColor / foregroundColor. */
  --code-bg: #0e1310;
  --code-fg: #d8ddd9;
  --line-lit:#3a3a3a;
  --fg:      #f4f4f4;
  --fg-soft: #c9c9c9;
  --muted:   #8a8a8a;
  /* Lifted straight from the IDE's own dark theme -
     ScreenColorMgr.SetNewDark(). The wordmark green IS the editor's
     keywordColor, which is what lets the mark and the code sample be the
     only two coloured things on an otherwise black-and-white page. */
  --accent:      #3dee5c;   /* keywordColor       - 13.6:1 on black */
  --tok-string:  #d49060;   /* stringLiteralColor - italic in the IDE */
  --tok-global:  #5ac8e0;   /* globalColor - bold in the IDE. 9.6:1 here */
  /* commentColor, verbatim. An earlier note here claimed 2.3:1 and lifted this
     to #7c8d80; that figure was simply miscalculated - against the editor's
     own ground it is 3.26:1. Low, but comments are meant to recede, and this
     is what the editor actually looks like. */
  --tok-comment: #5a6a5e;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}

/* ---------- wordmark ---------- */

/* The mark is deliberately small - the same size as the words beside it.
   Nobody recognises this wordmark yet, so the headline is what earns the top
   of the page; the mark just signs it. */
.masthead {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 2.25rem;
}

.mark {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--accent);
  text-decoration: none;
  border: 0;
}

.mark-sub {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.hero {
  padding: 0 0 3.25rem;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6.4vw, 3.9rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.lede {
  margin: 1.5rem 0 0;
  max-width: 40rem;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--fg-soft);
}

.status {
  margin: 2rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.86rem;
}

/* inline, not flex: a flex row orphans the dot on its own line as soon as
   the text is too long to sit beside it. */
.dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.05em;
}

/* ---------- claim grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 3.25rem 0 0;
}

.card {
  background: var(--panel);
  padding: 1.6rem 1.5rem 1.75rem;
}

.card-wide { grid-column: 1 / -1; }

.card h2 {
  margin: 0 0 0.6rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--fg);
}

.card p {
  margin: 0;
  color: var(--fg-soft);
  font-size: 0.945rem;
  line-height: 1.62;
}

.card-wide p { max-width: 46rem; }

/* ---------- code sample ---------- */

.sample {
  margin: 3.75rem 0 0;
  position: relative;   /* contains the visually-hidden checkbox */
}

.sample h2,
.policy h2,
.cta h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.sample-lede {
  margin: 0.7rem 0 1.4rem;
  color: var(--muted);
  max-width: 38rem;
}

.code {
  margin: 0;
  padding: 1.35rem 1.4rem;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-lit);
  overflow-x: auto;
  font: 400 0.875rem/1.7 var(--mono);
  color: var(--code-fg);
  tab-size: 4;
}

.code code { font: inherit; }

/* Token styles mirror SourcePanel's live style table, not a generic
   highlighter: keyword is bold, string literal is italic, and function and
   class names get weight but no colour. */
.tok-k { color: var(--accent);     font-weight: 700; }
.tok-s { color: var(--tok-string); font-style: italic; }
.tok-g { color: var(--tok-global); font-weight: 700; }
.tok-c { color: var(--tok-comment); font-style: italic; }
.tok-b { font-weight: 700; }

/* ---------- the light-theme flip ----------
   No JavaScript exists on this page and none can (default-src 'none'), so this
   is a checkbox plus sibling combinators - which is why the input sits BEFORE
   the <pre> in the markup and the label after it. Both are later siblings, so
   "~" reaches them.

   It flips the CODE BLOCK only, not the page. Two reasons: the page's whole
   look is black and white with one colour, and a site-wide light mode would
   undo that; and with no JS the choice cannot persist a reload - which is
   irrelevant for a demo of the editor and annoying for a site preference.

   The light values are the IDE's own: keywordColor #4040ff and
   stringLiteralColor #8b4a1e out of ScreenColorMgr's light path, on white. */

.theme-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;      /* hidden but still focusable and still tabbable */
  margin: 0;
}

.theme-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.theme-label:hover { color: var(--fg-soft); }

/* the word beside the box names the theme currently ON SCREEN, and swaps with
   the checkbox - no JS, so it is two spans and one of them is hidden */
.theme-word { color: var(--fg-soft); }
.theme-word-on { display: none; }
.theme-toggle:checked ~ .theme-label .theme-word-off { display: none; }
.theme-toggle:checked ~ .theme-label .theme-word-on { display: inline; }

.theme-box {
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.25rem;
  flex: none;
  border: 1px solid var(--line-lit);
  background: transparent;
}

/* the box fills with the foreground, not the accent - the mark and the code
   sample stay the only coloured things on the page */
.theme-toggle:checked ~ .theme-label .theme-box {
  background: var(--fg);
  border-color: var(--fg);
}

.theme-toggle:focus-visible ~ .theme-label .theme-box {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.theme-toggle:checked ~ .code {
  background: #ffffff;
  color: #000000;
  border-color: #d9d9d9;
  border-left-color: #d9d9d9;
}

.theme-toggle:checked ~ .code .tok-k { color: #4040ff; }
.theme-toggle:checked ~ .code .tok-s { color: #8b4a1e; }
/* Was a lift, is now verbatim: ScreenColorMgr.SetLight() was fixed on
   2026-09-04 to this exact value, because Color(64,255,64) was 1.35:1 on white
   in the IDE too. */
.theme-toggle:checked ~ .code .tok-g { color: #157a2e; }
/* Also verbatim now, same fix: light commentColor was Color(0,255,255), cyan,
   1.25:1 on white. EVERY token colour on this page is the editor's own. */
.theme-toggle:checked ~ .code .tok-c { color: #2f6f6f; }

/* ---------- policy + cta ---------- */

.policy,
.cta {
  margin: 3.75rem 0 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.policy p,
.cta p {
  margin: 0.9rem 0 0;
  max-width: 44rem;
  color: var(--fg-soft);
}

.contact { font-size: 1.05rem; }

a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line-lit);
  padding-bottom: 1px;
}

a:hover,
a:focus-visible { border-bottom-color: var(--fg); }

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

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

.footer-tag { letter-spacing: 0.02em; }

/* ---------- 404 ---------- */

.short {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0;
}

.short .lede { margin-top: 1rem; }
.short .contact { margin-top: 1.5rem; }

@media (max-width: 34rem) {
  .wrap { padding: 1.75rem 1.15rem 2.5rem; }
  .card { padding: 1.35rem 1.2rem 1.45rem; }
  .code { font-size: 0.8rem; padding: 1.1rem; }
}
