/* Stoxeon shared shell for inner pages. The homepage keeps its own inline styles
   around the WebGL hero; these rules only need to match its look. */

:root {
  color-scheme: dark;
  --ink: rgba(255, 255, 255, 0.96);
  --muted: rgba(255, 255, 255, 0.68);
  --dim: rgba(255, 255, 255, 0.52);
  --line: rgba(255, 255, 255, 0.13);
  --cyan: #46d8ff;
  --blue: #18baff;
  --pink: #ff4ee4;
  --cta: #079eea;
  --panel: rgba(7, 9, 14, 0.76);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 14% -4%, rgba(14, 202, 255, 0.10), transparent 30rem),
    radial-gradient(circle at 90% 4%, rgba(255, 66, 209, 0.09), transparent 34rem),
    linear-gradient(180deg, #000 0%, #020305 30%, #010101 100%);
  background-color: #010101;
  color: var(--ink);
  font-family: "Spline Sans", Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}

a { color: inherit; }

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: "Lexend Tera", Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark span { color: var(--cyan); }

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-size: 13.5px;
  letter-spacing: 0.04em;
}

.topnav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.topnav a:hover, .topnav a[aria-current="page"] { color: var(--cyan); }

/* ---------- page header ---------- */

.page-head { padding: clamp(40px, 7vw, 84px) 0 8px; }

.kicker {
  margin: 0 0 18px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.page-head h1 {
  margin: 0 0 18px;
  max-width: 900px;
  font-family: "Lexend Tera", Arial, sans-serif;
  font-size: clamp(27px, 4.6vw, 52px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.page-head .lede {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 18.5px;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 26px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 13.5px;
}

.byline b { color: var(--muted); font-weight: 500; }

/* ---------- article body ---------- */

.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: 40px 0 24px;
}

.article-main { min-width: 0; max-width: 780px; }

.article-main h2 {
  margin: 52px 0 18px;
  font-family: "Lexend Tera", Arial, sans-serif;
  font-size: clamp(21px, 2.6vw, 29px);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.005em;
  scroll-margin-top: 90px;
}

.article-main h3 {
  margin: 36px 0 12px;
  font-size: 20px;
  font-weight: 600;
  scroll-margin-top: 90px;
}

.article-main p { margin: 0 0 18px; color: var(--muted); }
.article-main li { color: var(--muted); margin: 0 0 10px; }
.article-main ul, .article-main ol { padding-left: 24px; margin: 0 0 20px; }
.article-main strong { color: var(--ink); font-weight: 600; }

.article-main a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(70, 216, 255, 0.35);
  text-underline-offset: 3px;
}

.article-main a:hover { text-decoration-color: var(--cyan); }

.article-main blockquote {
  margin: 26px 0;
  padding: 16px 22px;
  border-left: 2px solid var(--pink);
  background: rgba(255, 78, 228, 0.05);
  color: var(--muted);
}

.article-main blockquote p:last-child { margin-bottom: 0; }

.article-main figure { margin: 30px 0; }

.article-main figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-main figcaption { margin-top: 10px; color: var(--dim); font-size: 13.5px; }

/* data tables */
.table-wrap { overflow-x: auto; margin: 26px 0; border: 1px solid var(--line); border-radius: 8px; }

table.data {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.015);
  font-size: 15px;
}

table.data th, table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
  vertical-align: top;
  color: var(--muted);
}

table.data th {
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
}

table.data tr:last-child td { border-bottom: 0; }
table.data td b, table.data td strong { color: var(--ink); }

/* callout note */
.note {
  margin: 26px 0;
  padding: 18px 22px;
  border: 1px solid rgba(70, 216, 255, 0.28);
  border-radius: 8px;
  background: rgba(24, 186, 255, 0.05);
  color: var(--muted);
  font-size: 15.5px;
}

.note b { color: var(--cyan); }

/* TOC sidebar */
.side { position: sticky; top: 26px; display: grid; gap: 18px; }

.toc, .side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 22px 24px;
}

.toc b, .side-card b {
  display: block;
  margin-bottom: 12px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }

.toc li { counter-increment: toc; margin: 0; }

.toc a {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--cyan);
  font-family: "Spline Sans Mono", monospace;
  font-size: 12.5px;
  padding-top: 2px;
}

.toc a:hover { color: var(--ink); }

.side-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.side-card a.mini { color: var(--cyan); font-size: 14px; }

/* FAQ */
.faq { margin: 30px 0; }

.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  margin-bottom: 12px;
}

.faq summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  position: relative;
  padding-right: 44px;
  min-height: 44px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyan);
  font-family: "Spline Sans Mono", monospace;
  font-size: 18px;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details > div { padding: 0 20px 18px; color: var(--muted); }
.faq details > div p { margin: 0 0 12px; }

/* ---------- register card ---------- */

.reg-card {
  margin: 44px 0 10px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid rgba(35, 189, 255, 0.4);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(21, 43, 58, 0.62), rgba(36, 8, 34, 0.5)),
    rgba(7, 9, 14, 0.9);
  box-shadow: 0 0 44px rgba(7, 158, 234, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.reg-card h2, .reg-card h3 {
  margin: 0 0 10px;
  font-family: "Lexend Tera", Arial, sans-serif;
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.2;
}

.reg-card p.reg-sub { margin: 0 0 20px; color: var(--muted); font-size: 15.5px; max-width: 560px; }

.reg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 4px 18px;
  border: 1px solid rgba(70, 216, 255, 0.4);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
}

.code-chip .code-label { color: var(--dim); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }

.code-chip code {
  font-family: "Spline Sans Mono", monospace;
  font-size: 17px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.copy-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.copy-btn:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 1px solid rgba(35, 189, 255, 0.54);
  border-radius: 999px;
  background: var(--cta);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 34px rgba(7, 158, 234, 0.28);
}

.btn-cta:hover { filter: brightness(1.12); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  white-space: nowrap;
}

.fine { margin: 16px 0 0; color: var(--dim); font-size: 12.5px; line-height: 1.55; }

/* ---------- tools ---------- */

.tool-panel {
  position: relative;
  border: 1px solid rgba(70, 216, 255, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 10% -10%, rgba(70, 216, 255, 0.07), transparent 55%),
    radial-gradient(120% 90% at 100% 110%, rgba(255, 78, 228, 0.05), transparent 55%),
    linear-gradient(180deg, rgba(14, 20, 30, 0.92), rgba(7, 10, 16, 0.94));
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: clamp(24px, 4vw, 42px);
  margin: 32px 0;
  overflow: hidden;
}

.tool-panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(70, 216, 255, 0.55), rgba(255, 78, 228, 0.4), transparent);
}

.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 26px; }

.field { display: grid; gap: 9px; }

.field label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.field input, .field select {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.32));
  color: var(--ink);
  font-family: "Spline Sans Mono", monospace;
  font-size: 17px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.3); }

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='9' viewBox='0 0 13 9'%3E%3Cpath d='M1.5 1.5l5 5 5-5' fill='none' stroke='%2346d8ff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.32));
  background-repeat: no-repeat, no-repeat;
  background-position: right 16px center, 0 0;
  background-size: 13px, auto;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: rgba(70, 216, 255, 0.7);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(70, 216, 255, 0.16), 0 0 24px rgba(70, 216, 255, 0.15);
}

.field .hint { color: var(--dim); font-size: 12px; line-height: 1.5; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn-run {
  min-height: 52px;
  padding: 0 32px;
  border: 1px solid rgba(70, 216, 255, 0.55);
  border-radius: 999px;
  background: linear-gradient(180deg, #26b2f1, #0a84d6);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(7, 158, 234, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-run:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 14px 32px rgba(7, 158, 234, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.32); }
.btn-run:active { transform: translateY(0); filter: brightness(0.98); }

.btn-reset {
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-reset:hover { border-color: rgba(255, 255, 255, 0.34); color: var(--ink); background: rgba(255, 255, 255, 0.06); }

.results { margin-top: 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.result-box {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(70, 216, 255, 0.05), rgba(0, 0, 0, 0.32));
  padding: 20px 22px 22px 24px;
  overflow: hidden;
}

.result-box::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cyan);
  opacity: 0.55;
}

.result-box.accent {
  border-color: rgba(255, 78, 228, 0.32);
  background: linear-gradient(180deg, rgba(255, 78, 228, 0.09), rgba(0, 0, 0, 0.32));
  box-shadow: 0 0 36px rgba(255, 78, 228, 0.1);
}

.result-box.accent::before { background: var(--pink); opacity: 0.85; }

.result-box .r-label {
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result-box .r-value {
  display: block;
  margin-top: 10px;
  font-family: "Spline Sans Mono", monospace;
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.1;
  color: var(--cyan);
  overflow-wrap: break-word;
  text-shadow: 0 0 24px rgba(70, 216, 255, 0.28);
}

.result-box.accent .r-value { color: var(--pink); text-shadow: 0 0 24px rgba(255, 78, 228, 0.32); }

.tool-note {
  margin-top: 22px;
  padding: 14px 18px;
  border-left: 2px solid rgba(70, 216, 255, 0.32);
  background: rgba(70, 216, 255, 0.04);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

/* ---------- related / hub links ---------- */

.related { padding: 26px 0 10px; }

.related h2 {
  font-family: "Lexend Tera", Arial, sans-serif;
  font-size: 21px;
  margin: 0 0 20px;
}

.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.related-grid a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.5;
}

.related-grid a b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.related-grid a:hover { border-color: rgba(70, 216, 255, 0.45); color: var(--ink); }

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

.footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  padding: 44px 0 40px;
  font-size: 14px;
  color: var(--dim);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.footer b {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 0 0 9px; }
.footer a { color: var(--dim); text-decoration: none; line-height: 1.5; }
.footer a:hover { color: var(--cyan); }

.footer .legal {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 22px;
  font-size: 12.5px;
  line-height: 1.7;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .article { grid-template-columns: 1fr; }
  .side { position: static; }
  .side:has(.toc) { order: -1; }
  .results { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tool-grid { grid-template-columns: 1fr; }
  .results { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .reg-row { align-items: stretch; }
  .reg-row .btn-cta { width: 100%; }
  .code-chip { justify-content: space-between; }
  table.data { min-width: 460px; }
}

/* Cache-mix safety: an image stays inside its box even if stale CSS or raw height attrs load. */
img { max-width: 100%; height: auto; }
.wordmark img, .brand img, img.logo { max-height: 2.2rem; width: auto; }
