@import url("tokens.css");

/* Styling for the public marketing site (helixaicloud.com).
 *
 * Same discipline as cloud/api/web: no framework, no build step, no web
 * fonts, no dependencies. The files are served straight off a static host
 * and the browser is the only runtime.
 *
 * This file CONSUMES tokens and never redefines one. tokens.css above is
 * a byte-identical copy of the canonical cloud/api/web/tokens.css, held
 * there by the drift test in cloud/api/src/web/tokens.test.ts — so the
 * site's glass, palette and motion are literally the product's, not an
 * approximation of them. Half this site's job is showing what the product
 * looks like; a marketing site with its own palette would be showing
 * something else.
 *
 * The class names deliberately echo app.css (.card, .btn, .pill) so a
 * screenshot of the product dropped into a page needs no reconciliation,
 * but the two files are separate: the site is deployed as its own Coolify
 * resource and cannot reach the API container's assets.
 *
 * Colour-blind safety carries over: no state is signalled by hue alone —
 * every coloured pill also carries a word, and the status glyphs come
 * from the tokens.
 */

* {
  box-sizing: border-box;
  margin: 0;
}
/* ------------------------------------------------- derived text inks
 * --accent and --muted are tuned as UI colours: borders, fills, the focus
 * ring, secondary labels. Measured in a real browser against the light
 * theme, --accent as body TEXT lands at 3.65:1 on --bg and 3.24:1 inside
 * the primary button — under the 4.5:1 the architecture commits to (§12,
 * WCAG AA). Dark passes everywhere; only light fails.
 *
 * tokens.css is canonical and shared byte-identical with two other
 * surfaces, so it is not touched. Instead the accent is mixed toward
 * --text wherever it carries TEXT. One rule serves both themes without a
 * second theme block, because --text is by definition the high-contrast
 * colour of whichever theme is live: in light the mix deepens the blue,
 * in dark it lifts it. These are not tokens — they are derived here and
 * exist only on this surface.
 *
 * Non-text uses of --accent keep the token exactly: the current-page
 * underline, the primary button's border and fill, the step numeral ring.
 * The bar there is 3:1 for non-text, which the token clears.
 *
 * The percentages were chosen by measuring, not by eye. Changing one
 * means re-measuring it.
 */
:root {
  --accent-ink: color-mix(in srgb, var(--accent) 70%, var(--text));
  --muted-ink: color-mix(in srgb, var(--muted) 78%, var(--text));
  --degraded-ink: color-mix(in srgb, var(--status-degraded) 78%, var(--text));
  --ok-ink: color-mix(in srgb, var(--status-ok) 78%, var(--text));
  --down-ink: color-mix(in srgb, var(--status-down) 78%, var(--text));
}


html {
  scroll-behavior: smooth;
  /* The sticky header would otherwise cover the target of an in-page
     anchor. */
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

html,
body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

/* ------------------------------------------------------------ typography */

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(30px, 6.2vw, var(--text-hero));
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(22px, 3.4vw, 34px);
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--text-lg);
}

h4 {
  font-size: var(--text-base);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong {
  font-weight: 650;
  color: var(--text);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

:not(pre) > code {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  padding: 1px 5px;
  word-break: break-word;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.tnum,
.num {
  font-variant-numeric: tabular-nums;
}

.lead {
  font-size: clamp(var(--text-lg), 2.2vw, 20px);
  color: var(--muted);
  max-width: 62ch;
}

/* The one-line label above a section heading. Not decoration: it tells
   you which of the three audiences the section is addressing. */
.eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: var(--space-2);
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 var(--space-4);
  }
}

section.band {
  padding: clamp(48px, 8vw, 88px) 0;
}

section.band + section.band {
  border-top: 1px solid var(--card-border);
}

.section-head {
  max-width: 68ch;
  margin-bottom: var(--space-7);
}

.section-head p {
  color: var(--muted);
  margin-top: var(--space-3);
}

.stack > * + * {
  margin-top: var(--space-4);
}

/* Skip link: the nav is five links deep before the content starts, and a
   keyboard user should not have to walk it on every page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  font-weight: 650;
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-2);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--card-border);
}

.site-header-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .site-header-inner {
    padding: var(--space-3) var(--space-4);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.2px;
  flex: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-glyph {
  display: inline-flex;
  align-self: center;
  color: var(--accent);
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  /* Takes the slack so the tools sit hard right on wide screens and the
     nav wraps to its own line on narrow ones — no menu button, no JS, and
     nothing that can fail to open. */
  margin-right: auto;
}

.site-nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  text-decoration: none;
}

/* The current page is marked from body[data-page] rather than by editing
   each copy of the nav — the chrome block is byte-identical across pages
   and a test holds it that way. The underline is a second, non-colour
   signal for the same reason status is never hue alone. */
body[data-page="nms"] .site-nav a[data-nav="nms"],
body[data-page="monitor"] .site-nav a[data-nav="monitor"],
body[data-page="monitor-features"] .site-nav a[data-nav="monitor"],
body[data-page="monitor-isps"] .site-nav a[data-nav="monitor"],
body[data-page="monitor-pricing"] .site-nav a[data-nav="monitor"],
body[data-page="monitor-docs"] .site-nav a[data-nav="monitor"],
body[data-page="download"] .site-nav a[data-nav="monitor"],
body[data-page="about"] .site-nav a[data-nav="about"],
body[data-page="contact"] .site-nav a[data-nav="contact"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* The Download control is a FILLED brand button, so the current-page
   treatment gives it a ring and deliberately does NOT touch its colour.
   The earlier version set `color: var(--text)` here and won on specificity
   over .btn-brand, painting light-grey text on bright aqua at 1.57:1 --
   found by measuring the rendered page, not by reading this file. */
body[data-page="download"] .site-header-tools a[data-nav="download"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-accent);
}

.site-header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.btn:hover {
  background: color-mix(in srgb, var(--text) 11%, transparent);
  text-decoration: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 13px 24px;
  font-size: var(--text-base);
  border-radius: var(--radius);
}

.btn-primary {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  backdrop-filter: blur(var(--glass-blur));
  min-width: 0;
}

.card h3 {
  margin-bottom: var(--space-2);
}

.card p {
  color: var(--muted);
}

.card p + p,
.card ul + p,
.card p + ul {
  margin-top: var(--space-3);
}

/* Hover lift is for cards that are themselves links; a static content
   card that rises under the pointer promises a click that is not there. */
a.card {
  display: block;
  color: inherit;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

a.card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-2px);
  text-decoration: none;
}

a.card h3 {
  color: var(--accent-ink);
}

/* 250px, not 270: the widest .grid on the site holds the four monitoring
   modes, and at a 270px floor the fourth wraps to its own row inside the
   1120px shell — four peers rendered as three-plus-one. */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

/* Two-up, deliberately. These sections are written in PAIRS — a claim and
   its counter-consideration, a capability and its limit — and at a 340px
   floor a four-card pair-set reflows to 3+1 on a wide screen, which reads
   as one orphan rather than two pairs. */
.grid-2 {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
}

/* ----------------------------------------------------------------- pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--muted-ink);
  white-space: nowrap;
}

.pill-accent {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.pill-ok {
  color: var(--ok-ink);
  background: var(--status-ok-soft);
  border-color: color-mix(in srgb, var(--status-ok) 40%, transparent);
}

.pill-ok::before {
  content: var(--status-ok-glyph);
}

.pill-warn {
  color: var(--degraded-ink);
  background: var(--status-degraded-soft);
  border-color: color-mix(in srgb, var(--status-degraded) 40%, transparent);
}

.pill-warn::before {
  content: var(--status-degraded-glyph);
}

.pill-err {
  color: var(--down-ink);
  background: var(--status-down-soft);
  border-color: color-mix(in srgb, var(--status-down) 40%, transparent);
}

.pill-err::before {
  content: var(--status-down-glyph);
}

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

.hero {
  padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px);
}

.hero h1 {
  max-width: 18ch;
}

.hero .lead {
  margin-top: var(--space-5);
  font-size: clamp(var(--text-lg), 2.4vw, 21px);
}

.hero .btn-row {
  margin-top: var(--space-6);
}

.hero-note {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ------------------------------------------------- hero illustration
 * The home hero carries one visual, and it is the product's signature
 * rather than a screenshot: a verdict beside the evidence that argues
 * against it. Two rules govern it. It is labelled "Illustration" in the
 * markup and to assistive technology, because a fabricated reading
 * presented as a real one would break the exact promise the page is
 * making. And the two evidence columns are named in words, not
 * distinguished by colour — the same rule the product's EvidencePair
 * follows.
 */

.hero-grid {
  display: grid;
  gap: clamp(var(--space-6), 5vw, var(--space-8));
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1000px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 430px);
  }
}

.demo-card {
  display: grid;
  gap: var(--space-4);
}

.demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.demo-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-verdict {
  font-size: var(--text-xl);
  margin: 0;
}

.demo-verdict + p {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: calc(var(--space-2) * -1 + 2px);
}

.evidence {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 520px) {
  .evidence {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ev h3 {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  padding-bottom: 5px;
}

.ev-for h3 {
  color: var(--ok-ink);
  border-bottom: 2px solid var(--status-ok);
}

.ev-against h3 {
  color: var(--degraded-ink);
  border-bottom: 2px solid var(--status-degraded);
}

.ev ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.45;
}

.demo-foot {
  border-top: 1px solid var(--card-border);
  padding-top: var(--space-3);
  font-size: var(--text-sm);
}

/* -------------------------------------------------------------- callouts */

.note {
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  padding: var(--space-4) var(--space-5);
}

.note strong:first-child {
  color: var(--accent-ink);
}

/* Used where the page has to warn rather than reassure — the unsigned
   installer, principally. It carries the word "Heads up", not just the
   colour. */
.note-warn {
  border-left-color: var(--status-degraded);
  background: var(--status-degraded-soft);
}

.note-warn strong:first-child {
  color: var(--degraded-ink);
}

/* ----------------------------------------------------------------- lists */

.ticks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.ticks li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
}

.ticks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ok-ink);
  font-weight: 700;
}

/* The deliberate-absence list. A cross is the point: these pages say what
   Helix does NOT do as plainly as what it does. */
.crosses {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.crosses li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
}

.crosses li::before {
  content: "✕";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--down-ink);
  font-weight: 700;
}

.prose ul,
.prose ol {
  padding-left: 22px;
  display: grid;
  gap: var(--space-2);
  color: var(--muted);
}

/* -------------------------------------------------- numbered step blocks */

.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: var(--gap);
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 52px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  margin-bottom: var(--space-2);
  padding-top: 5px;
}

.steps p {
  color: var(--muted);
  /* Without this the step body runs the full 1120px shell — around 150
     characters a line, which is roughly twice a comfortable measure. */
  max-width: 78ch;
}

/* --------------------------------------------------------------- pricing */

.price-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: start;
}

.price-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
}

.price-card .price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.price-card .price .per {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

.price-card .retention {
  font-size: var(--text-sm);
  color: var(--muted);
}

.price-card .retention b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.price-card ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: auto;
}

.price-card ul li::before {
  content: "·";
  color: var(--accent-ink);
  font-weight: 700;
  margin-right: 8px;
}

.price-card .btn {
  width: 100%;
}

/* ----------------------------------------------------------------- table */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur));
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 480px;
}

th,
td {
  text-align: left;
  padding: 11px var(--space-4);
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

th {
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}

td {
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ------------------------------------------------------------ docs pages */

.doc-layout {
  display: grid;
  gap: clamp(var(--space-5), 4vw, var(--space-8));
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 860px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-toc {
    position: static;
  }
}

.doc-toc {
  position: sticky;
  top: 88px;
  font-size: var(--text-sm);
}

.doc-toc h2 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.doc-toc ol {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.doc-toc a {
  display: block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--card-border);
  color: var(--muted);
}

.doc-toc a:hover {
  color: var(--text);
  border-left-color: var(--accent);
  text-decoration: none;
}

.prose {
  max-width: 74ch;
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2 {
  margin-top: var(--space-8);
  padding-top: var(--space-2);
  font-size: var(--text-2xl);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: var(--space-6);
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--text);
}

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

.site-footer {
  border-top: 1px solid var(--card-border);
  padding: var(--space-8) 0 var(--space-7);
  margin-top: var(--space-6);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.footer-grid h2 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--space-3);
  font-weight: 700;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.footer-grid a {
  color: var(--muted);
}

.footer-grid a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  color: var(--muted);
}

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

.centered {
  min-height: 52vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--space-8) 0;
}

.centered .lead {
  margin: var(--space-4) auto 0;
}
