/*
  Flint - REX Technologies. One stylesheet, no build step.

  The palette is the REX ink/signal system lifted verbatim from FlintColors (desktop, phone and
  television share it). Do not re-pick these values, and do not add a light variant: REX is a dark
  system by design.
*/

:root {
  --ink: #080A09;
  --panel: #111512;
  --raised: #181E19;
  --line: #29302A;
  --text: #F2F5EE;
  --muted: #858D83;
  --signal: #D7FF3F;
  --live: #FF774D;
  --signal-wash: rgba(215, 255, 63, 0.10);
  --live-wash: rgba(255, 119, 77, 0.10);

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;

  /* The sticky header's own height, so anchor targets can clear it. */
  --bar: 65px;
  --gutter: clamp(16px, 4vw, 32px);
  --page: 1120px;
  --section: clamp(48px, 8vw, 88px);

  --font: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, ui-monospace, Menlo, monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Sections that JS reveals or hides never leave a gap. */
[hidden] { display: none !important; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--signal); color: var(--ink);
  padding: 10px 14px; border-radius: var(--radius-s);
  font-weight: 700; z-index: 100;
}
.skip:focus { top: 12px; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(34px, 5.6vw, 60px); letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 3.2vw, 34px); }
h3 { font-size: 18px; }
h4 { font-size: 15px; }
p { margin: 0; }
strong { font-weight: 700; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* The signature of the system: small, bold, heavily tracked, upper-case. 11px on the web rather
   than the app's 9px, because a browser at arm's length is not a phone held close. */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0;
}
.eyebrow.signal { color: var(--signal); }
.eyebrow.live { color: var(--live); }

.wrap { width: min(var(--page), 100% - 2 * var(--gutter)); margin-inline: auto; }

/*
  Anchor targets clear the sticky header.

  A section has enough top padding of its own that its heading lands below the header already, so
  adding a margin there would only waste a strip of screen. These three do not: the download panel
  is flush, the hero's padding collapses on a phone, and an install panel is mid-section. Without
  this, the nav's Download button scrolled the panel's "pick a device" row to exactly underneath
  the header, where nobody could see it.
*/
.download, .hero, .panel { scroll-margin-top: calc(var(--bar) + 12px); }

/* ---------- Header ---------- */

.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8, 10, 9, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
/* Without scripting there is no menu button, so the links wrap under the brand instead. */
.no-js .bar-inner { flex-wrap: wrap; padding-bottom: 8px; }
.no-js .nav { flex-wrap: wrap; margin-left: 0; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; display: block; }
.brand .lockup { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.brand .name { font-size: 17px; font-weight: 700; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
  padding: 10px 12px; border-radius: var(--radius-s);
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--raised); }
.nav a.cta { color: var(--ink); background: var(--signal); margin-left: 6px; padding-inline: 16px; }
.nav a.cta:hover { opacity: 0.9; }

.menu-toggle {
  margin-left: auto; display: none;
  min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; align-items: center; gap: 8px;
}
.menu-toggle .burger { width: 16px; height: 2px; background: currentColor; position: relative; display: block; }
.menu-toggle .burger::before, .menu-toggle .burger::after {
  content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor;
}
.menu-toggle .burger::before { top: -5px; }
.menu-toggle .burger::after { top: 5px; }

@media (max-width: 959px) {
  .js .menu-toggle { display: inline-flex; }
  .js .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px var(--gutter) 16px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  }
  .js .nav.open { display: flex; }
  .js .nav a { font-size: 16px; padding: 12px 12px; }
  .js .nav a.cta { margin: 8px 0 0; justify-content: center; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-s);
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}
.btn.signal { background: var(--signal); color: var(--ink); }
.btn.signal:hover { opacity: 0.88; text-decoration: none; }
.btn.outline { border-color: var(--line); color: var(--text); background: transparent; }
.btn.outline:hover { border-color: var(--muted); text-decoration: none; background: var(--raised); }
.btn.big { min-height: 56px; padding: 0 28px; font-size: 13px; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Cards, pills, tables ---------- */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: clamp(18px, 3vw, 26px);
}
.card.signal { border-color: var(--signal); }
.card.live { border-color: var(--live); background: linear-gradient(180deg, var(--live-wash), transparent 60%), var(--panel); }
.card > * + * { margin-top: 12px; }
.card > .eyebrow + * { margin-top: 8px; }

.pill {
  display: inline-block; white-space: nowrap;
  border: 1px solid var(--muted); color: var(--muted);
  border-radius: 20px; padding: 4px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  line-height: 1.4;
}
.pill.signal { border-color: var(--signal); color: var(--signal); }
.pill.live { border-color: var(--live); color: var(--live); }

section { padding: var(--section) 0; border-top: 1px solid var(--line); }
.head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; max-width: 720px; }
.head p.lede { color: var(--muted); font-size: 17px; }

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
@media (min-width: 720px) {
  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 720px) and (max-width: 979px) {
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td .muted { display: block; }

/* Below tablet width a table becomes a stack of labelled rows: nothing scrolls sideways and
   nothing is clipped. The label comes from data-label on each cell. */
@media (max-width: 639px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 6px 0; }
  table.stack td[data-label]::before {
    content: attr(data-label);
    display: block; margin-bottom: 4px;
    color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  }
}

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Lists ---------- */

ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 16px; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; }
ol.steps li > div { min-width: 0; }
ol.steps li::before {
  content: counter(step);
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--signal);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
ol.steps h4 { margin-bottom: 4px; }
.card > p + ol.steps { margin-top: 18px; }
ol.steps pre { margin: 8px 0 10px; }

/* The dot is positioned rather than a grid column: a list item that holds inline markup would
   otherwise split into one grid cell per span. */
ul.dots { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
ul.dots li { position: relative; padding-left: 22px; }
ul.dots li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--muted);
}
ul.dots.signal li::before { background: var(--signal); }

code, pre { font-family: var(--mono); }
code { background: var(--raised); padding: 2px 6px; border-radius: 5px; font-size: 0.9em; color: var(--text); word-break: break-word; }
pre {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 16px; overflow-x: auto; font-size: 13px; line-height: 1.65; margin: 0;
}
pre code { background: none; padding: 0; word-break: normal; }

kbd { font-family: var(--font); font-weight: 700; color: var(--text); }
.path { color: var(--text); font-weight: 600; }

/* ---------- Hero and the download panel ---------- */

.hero { padding: clamp(40px, 7vw, 84px) 0 clamp(36px, 6vw, 64px); border-top: 0; }
.hero .lede { max-width: 640px; margin-top: 18px; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); }
.hero .head { margin-bottom: 0; max-width: 780px; }

.download {
  margin-top: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line); border-radius: var(--radius-l);
  background: var(--panel); overflow: hidden;
}
.download-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px clamp(16px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}
.download-top .detected { font-size: 14px; color: var(--muted); }
.download-top .detected strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 20px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--ink); background: var(--signal); border-color: var(--signal); }

.primary {
  display: grid; gap: 18px; align-items: center;
  padding: clamp(20px, 3.5vw, 32px) clamp(16px, 3vw, 24px);
}
@media (min-width: 720px) { .primary { grid-template-columns: minmax(0, 1fr) auto; } }
.primary > div { min-width: 0; }
.primary h2 { font-size: clamp(22px, 2.8vw, 30px); }
.primary .req { color: var(--muted); margin-top: 8px; max-width: 560px; }
.primary .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.primary .meta b { color: var(--text); font-weight: 600; }
.primary .actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
@media (min-width: 720px) { .primary .actions { align-items: flex-end; } }
.primary .actions .btn { width: 100%; }
@media (min-width: 720px) { .primary .actions .btn { width: auto; min-width: 260px; } }
.primary .fine { font-size: 12px; color: var(--muted); text-align: left; }
@media (min-width: 720px) { .primary .fine { text-align: right; max-width: 280px; } }

.others {
  display: grid; gap: 1px; background: var(--line);
  border-top: 1px solid var(--line);
}
/* auto-fit rather than three fixed tracks: the platform leading the panel is hidden here, and a
   fixed third column would sit empty beside the other two. */
@media (min-width: 720px) { .others { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.other {
  background: var(--panel); padding: 18px clamp(16px, 3vw, 22px);
  display: flex; flex-direction: column; gap: 8px;
}
.other h3 { font-size: 15px; }
.other p { font-size: 13px; color: var(--muted); }
.other .row { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.other .btn { min-height: 40px; padding: 0 14px; font-size: 11px; }
.other .pill { align-self: flex-start; }

/* With scripting off every platform is offered equally: the primary panel shows the neutral
   copy and the chips are hidden, because nothing could act on them. */
.no-js .chips { display: none; }

/* ---------- Tabs (install) ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tab {
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab:hover { color: var(--text); border-color: var(--muted); }
.tab[aria-selected="true"] { color: var(--ink); background: var(--signal); border-color: var(--signal); }
.panel[hidden] { display: none; }
.no-js .tabs { display: none; }
.no-js .panel { display: block !important; margin-bottom: 14px; }
.no-js .panel > .card::before { content: attr(data-heading); display: block; margin-bottom: 12px; color: var(--signal); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- TV check ---------- */

.tv-path { font-size: 17px; }

/* ---------- Footer ---------- */

footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
footer .row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
footer .row + .row { margin-top: 18px; }
footer a { color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
footer a:hover { color: var(--signal); }
