/* ==========================================================================
   Section Star — one stylesheet.
   Palette is pulled straight from the logo mark: blue tile, green and
   magenta shards, near-black wordmark.
   ========================================================================== */

:root {
  /* Brand, sampled from the app icon gradient (#015DE8 -> #00C2FA) */
  --blue:       #0177ED;
  --blue-deep:  #015DE8;
  --blue-bright:#0190F1;
  --cyan:       #00C2FA;

  /* Text */
  --ink:    #111111;
  --ink-2:  #353a42;
  --muted:  #6a7280;
  --faint:  #a3abb6;

  /* Surfaces */
  --bg:    #ffffff;
  --bg-2:  #f6f7f9;
  --bg-3:  #eef1f5;
  --rule:  #e4e7ec;
  --rule-strong: #c3cad4;

  --accent: var(--blue);
  /* Neutral highlight. Decorative only — never carries meaning on its own. */
  --pop:     #d4d9e0;
  --pop-ink: var(--blue-deep);
  --hover:   rgba(17, 24, 39, 0.035);

  /* The logo's blue sweep, deepened at the bright end so white text holds
     AA contrast (the literal #00C2FA cyan is only 2.08:1 against white).
     Min ratio across these stops: 4.51:1. */
  --brand-gradient: linear-gradient(135deg, #013C9E 0%, #0158DC 48%, #017ACC 100%);
  --on-brand:        #ffffff;
  --on-brand-muted:  rgba(255, 255, 255, 0.88);
  --on-brand-faint:  rgba(255, 255, 255, 0.68);
  --on-brand-rule:   rgba(255, 255, 255, 0.28);

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

  --wrap: 1040px;
  --gutter: 40px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:   #e9edf2;
    --ink-2: #c3cad4;
    --muted: #8b95a3;
    --faint: #5f6977;
    --bg:    #0d1117;
    --bg-2:  #141a22;
    --bg-3:  #1a2029;
    --rule:  #242c37;
    --rule-strong: #3d4756;
    --blue:  #4ea6ef;
    --blue-deep: #0d1117;
    --pop:   #39424f;
    --pop-ink: #4ea6ef;
    --hover: rgba(255, 255, 255, 0.04);
  }
}

:root[data-theme="dark"] {
  --ink:   #e9edf2;
  --ink-2: #c3cad4;
  --muted: #8b95a3;
  --faint: #5f6977;
  --bg:    #0d1117;
  --bg-2:  #141a22;
  --bg-3:  #1a2029;
  --rule:  #242c37;
  --rule-strong: #3d4756;
  --blue:  #4ea6ef;
  --blue-deep: #0d1117;
  --pop:   #39424f;
  --pop-ink: #4ea6ef;
  --hover: rgba(255, 255, 255, 0.04);
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
table { border-collapse: collapse; border-spacing: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; font-size: 13px;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* --- shared bits ---------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 2px;
  height: 13px;
  border-radius: 1px;
  background: var(--pop);
  flex: 0 0 auto;
}

.section-head { margin-bottom: 20px; }
.section-head h2 {
  font-size: 21px; font-weight: 700; letter-spacing: -0.025em;
  margin: 10px 0 0; color: var(--ink);
}
.section-head .sub {
  margin: 8px 0 0; font-size: 15px; color: var(--muted); max-width: 74ch;
}

section.block { padding: 52px 0; border-top: 1px solid var(--rule); }
/* Body sections stay flat white. The brand gradient is reserved for the
   hero and page titles; re-add a background here to bring back alternation. */
section.block.tinted { background: var(--bg); }

/* --- header --------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: 60;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.brand .brand-name {
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
}
.site-nav { display: flex; gap: 22px; font-size: 14px; margin-left: auto; }
.site-nav a { color: var(--ink-2); }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: var(--ink); font-weight: 700;
  box-shadow: inset 0 -1px 0 0 var(--pop);
}
.header-cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 7px;
  white-space: nowrap;
}
.header-cta:hover { background: var(--blue-deep); }
.header-cta svg { width: 14px; height: 14px; fill: currentColor; }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--rule); border-radius: 7px;
  padding: 7px 10px; color: var(--ink-2); cursor: pointer;
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .header-cta { display: none; }
  .site-nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 16px;
  }
  .site-nav.open a { padding: 10px 0; border-top: 1px solid var(--rule); }
}

/* --- home ----------------------------------------------------------------- */
.home {
  padding: 76px 0 64px;
  background: var(--brand-gradient);
  color: var(--on-brand);
}
.home h1 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(27px, 4.2vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin: 10px 0 0;
}
.home .tagline { margin: 18px 0 0; font-size: 16.5px; line-height: 1.7; color: var(--ink-2); max-width: 78ch; }
.home .tagline a, .prose a, .c-desc a {
  color: var(--accent); font-weight: 700;
  border-bottom: 1px solid var(--accent); padding-bottom: 1px;
}
.home .tagline a:hover, .prose a:hover { background: var(--hover); }

.home .facts {
  font-family: var(--mono);
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin: 26px 0 0; font-size: 13px; color: var(--muted);
  list-style: none;
}
.home .facts li { display: flex; align-items: center; gap: 8px; }
.home .facts li + li::before {
  content: ""; width: 1px; height: 12px; background: var(--rule);
  margin-right: 8px; flex: 0 0 auto;
}
.home .facts b { color: var(--ink); font-weight: 700; }

.home .actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #aab2bf; }
.btn.ghost:hover { background: var(--bg-2); border-color: var(--accent); color: var(--accent); }

/* --- listing table (the workhorse) ---------------------------------------- */
.listing { width: 100%; font-size: 14.5px; table-layout: fixed; }
.listing caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 12px; }
.listing td, .listing th { padding: 16px 18px; border-top: 1px solid var(--rule); vertical-align: top; text-align: left; }
.listing tr:first-child td, .listing tr:first-child th { border-top: 1px solid var(--rule-strong); }
.listing tr:last-child td { border-bottom: 1px solid var(--rule); }
.listing tr:hover td { background: var(--hover); }
.listing td:first-child, .listing th:first-child { padding-left: 0; }
.listing td:last-child, .listing th:last-child { padding-right: 0; }

.c-icon { width: 76px; }
.c-icon img {
  width: 60px; height: 45px; border-radius: 6px;
  border: 1px solid var(--rule); background: var(--bg-2);
  object-fit: cover; object-position: top center;
}
.c-icon .glyph {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--bg-2);
  font-family: var(--mono); font-size: 13px;
  display: flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.c-icon .glyph svg { width: 18px; height: 18px; }
.listing tr:hover .glyph { color: var(--pop-ink); }

.c-name { width: 34%; }
.c-name .name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--accent); }
.c-name .name::after { content: " \2197"; font-weight: 500; color: var(--faint); }
.c-name a.name:hover, .c-name a.name:hover::after { color: var(--pop-ink); }
.c-name .host { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); word-break: break-all; }

.c-desc { color: var(--ink-2); line-height: 1.6; }
.c-desc .meta {
  font-family: var(--mono);
  display: block; margin-top: 8px; font-size: 11.5px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint);
}
.rating { color: var(--pop-ink); font-weight: 700; text-transform: none; letter-spacing: 0.02em; }
.tag-premium { color: var(--accent); font-weight: 700; }

@media (max-width: 760px) {
  .listing, .listing tbody, .listing tr, .listing td { display: block; }
  .listing thead { display: none; }
  .listing tr {
    position: relative; border-top: 1px solid var(--rule);
    padding: 18px 0 18px 74px;
  }
  .listing tr:first-child { border-top: 1px solid var(--rule-strong); }
  .listing tr:last-child { border-bottom: 1px solid var(--rule); }
  .listing td { padding: 0; border: 0 !important; width: auto; }
  .listing tr:hover td { background: transparent; }
  .listing tr:hover { background: var(--hover); }
  .c-icon { position: absolute; left: 0; top: 18px; width: auto; }
  .c-desc { margin-top: 8px; }
}

/* --- page / article ------------------------------------------------------- */
.page-head {
  padding: 48px 0 40px;
  background: var(--brand-gradient);
  color: var(--on-brand);
}
.page-head h1 {
  font-size: clamp(25px, 3.4vw, 34px); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.15; margin: 10px 0 0;
}
.page-head .sub { margin: 14px 0 0; font-size: 16px; color: var(--ink-2); max-width: 78ch; }
.page-head .pagemeta {
  font-family: var(--mono);
  margin: 18px 0 0; font-size: 12px; color: var(--faint);
  letter-spacing: 0.04em; text-transform: uppercase;
}

.breadcrumb {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none;
}
/* The accent tick that used to sit on the eyebrow. */
.breadcrumb::before {
  content: "";
  width: 2px; height: 13px; border-radius: 1px;
  background: var(--pop); flex: 0 0 auto;
}
.breadcrumb li::after { content: "\203A"; margin-left: 8px; color: var(--faint); }
.breadcrumb li:last-child::after { content: ""; margin-left: 0; }
.breadcrumb a:hover { color: var(--accent); }

.page-body { padding: 36px 0 64px; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; align-items: start; }
@media (max-width: 900px) { .page-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

.prose { max-width: 78ch; }
.prose > * + * { margin-top: 18px; }
.prose h2 {
  font-size: 19px; font-weight: 700; letter-spacing: -0.015em;
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule);
}
.prose h3 { font-size: 16.5px; font-weight: 700; margin-top: 30px; color: var(--ink); }
.prose h4 { font-size: 15px; font-weight: 700; margin-top: 24px; color: var(--ink-2); }
.prose p { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.4em; color: var(--ink-2); }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 20px; }
.prose ul > li::before { content: "\2022"; position: absolute; left: 4px; color: var(--faint); }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 7px; }
.prose li::marker { color: var(--faint); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-3); border: 1px solid var(--rule);
  border-radius: 4px; padding: 1px 5px;
}
.prose pre {
  background: var(--bg-3); border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px; overflow-x: auto; font-size: 12.5px;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote {
  border-left: 2px solid var(--faint); padding-left: 16px; color: var(--muted);
}
.prose img { border: 1px solid var(--rule); border-radius: 8px; }
.prose iframe {
  width: 100%; height: 520px; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--bg-2);
}
.prose table { width: 100%; font-size: 13.5px; }
.prose table th, .prose table td {
  border-top: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top;
}
.prose table th { font-weight: 700; border-top: 1px solid var(--rule-strong); }
.prose table td:first-child, .prose table th:first-child { padding-left: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

/* --- aside / table of contents -------------------------------------------- */
.aside { font-size: 14px; position: sticky; top: 76px; }
.aside h2 {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin-bottom: 12px;
}
.aside h2::before {
  content: ""; width: 2px; height: 11px; border-radius: 1px;
  background: var(--pop); flex: 0 0 auto;
}
.aside ul { list-style: none; }
.aside li { border-top: 1px solid var(--rule); }
.aside li:last-child { border-bottom: 1px solid var(--rule); }
.aside a { display: block; padding: 9px 0; color: var(--ink-2); }
.aside a:hover { color: var(--accent); }
.aside .aside-note { color: var(--muted); line-height: 1.6; }

/* --- footer --------------------------------------------------------------- */
/* Same gradient as the hero. Its light end only clears AA against pure
   white, so footer hierarchy comes from size and weight, not opacity. */
.site-footer {
  margin-top: auto;
  background: var(--brand-gradient);
  color: var(--on-brand);
  padding: 48px 0 30px;
}
.site-footer .foot-mark {
  width: 34px; height: 34px; border-radius: 8px; margin-bottom: 20px;
  background: #fff; padding: 4px;
}
.site-footer .foot-def {
  font-size: 14.5px; color: var(--on-brand); max-width: 70ch; margin-bottom: 28px;
}
.foot-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 26px; margin-bottom: 28px;
}
.foot-cols h2 {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--on-brand); font-weight: 500; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--on-brand-rule);
}
.foot-cols ul { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.foot-cols a { color: var(--on-brand); }
.foot-cols a:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal {
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: 0.04em; color: var(--on-brand);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--on-brand-rule); padding-top: 22px;
}
.legal a { color: var(--on-brand); font-weight: 700; }
.legal a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 600px) {
  :root { --gutter: 22px; }
  .home { padding: 56px 0 40px; }
  section.block { padding: 40px 0; }
  .prose iframe { height: 420px; }
}


/* --- on the brand gradient ------------------------------------------------
   The hero and every page title sit on the logo gradient, so everything
   inside them inverts to white. Body content below is unaffected. */
.home h1,
.page-head h1 { color: var(--on-brand); }

.home .tagline,
.page-head .sub { color: var(--on-brand-muted); }

.home .eyebrow,
.page-head .eyebrow { color: var(--on-brand); }
.home .eyebrow::before,
.page-head .eyebrow::before { background: var(--on-brand-rule); }

.home .tagline a {
  color: var(--on-brand);
  border-bottom-color: var(--on-brand-rule);
}
.home .tagline a:hover { background: rgba(255, 255, 255, 0.16); }

.home .facts { color: var(--on-brand-muted); }
.home .facts b { color: var(--on-brand); }
.home .facts li + li::before { background: var(--on-brand-rule); }

.page-head .pagemeta { color: var(--on-brand-faint); }

.page-head .breadcrumb { color: var(--on-brand-faint); }
.page-head .breadcrumb a { color: var(--on-brand-muted); }
.page-head .breadcrumb a:hover { color: var(--on-brand); }
.page-head .breadcrumb li::after { color: var(--on-brand-faint); }
.page-head .breadcrumb::before { background: rgba(255, 255, 255, 0.55); }


/* Buttons invert: solid white primary, outlined white secondary. */
.home .btn {
  background: #fff;
  border-color: #fff;
  color: #0B5FD0;
}
.home .btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  color: #0B5FD0;
}
.home .btn.ghost {
  background: transparent;
  border-color: var(--on-brand-rule);
  color: var(--on-brand);
}
.home .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--on-brand);
  color: var(--on-brand);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
