/* fluxglow.com page chrome: landing, docs, editor, the viewer's corner links, 404.
   The board itself is styled in board.css. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #050607;
  --panel: #0b0d0f;
  --line: #1d2024;
  --line-strong: #2c3036;
  --text: #eceef0;
  --muted: #a0a7af;
  --dim: #6f767e;
  --green: #9bd82b;
  --green-ink: #0b1400;
  --amber: #ffb92e;
  --red: #ff6a4a;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3.1vw, 2.25rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.012em; line-height: 1.3; }
p { margin: 0; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: 0.88em; }
p code, li code, td code, th code { padding: 0.12em 0.38em; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: #d6dbe0; white-space: nowrap; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

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

.noscript { margin-top: 16px; color: var(--amber); }

/* ---------- header and footer ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding: 18px var(--gutter);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.06rem; font-weight: 650; letter-spacing: -0.02em; text-decoration: none; }

.brand-orb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #c4e665 0%, #84b324 55%, #50780b 100%);
  box-shadow: 0 0 0 1px rgb(155 216 43 / 0.5), 0 0 12px 1px rgb(155 216 43 / 0.55);
}

.site-head nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 26px); }
.site-head nav a:not(.btn) { color: var(--muted); font-size: 0.94rem; text-decoration: none; }
.site-head nav a:not(.btn):hover, .site-head nav a[aria-current="page"] { color: var(--text); }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: min(100%, var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.9rem;
}

.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { border-color: #4a5058; background: #101316; }
.btn-primary { border-color: var(--green); background: var(--green); color: var(--green-ink); }
.btn-primary:hover { border-color: #b4ea4d; background: #b4ea4d; box-shadow: 0 0 24px -4px rgb(155 216 43 / 0.6); }
.btn-small { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 0.9rem; }
.btn[aria-disabled="true"] { border-color: var(--line); background: #14171a; color: var(--dim); box-shadow: none; cursor: not-allowed; }

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

/* ---------- the framed board ---------- */

.screen {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #000;
}

.screen > div { position: absolute; inset: 0; }

.screen-hero { aspect-ratio: 16 / 8.4; margin-top: clamp(36px, 5vw, 60px); box-shadow: 0 60px 140px -70px rgb(155 216 43 / 0.28); }
.screen-one { aspect-ratio: 4 / 4.6; }
.screen-shape { aspect-ratio: 16 / 8.4; }
.screen-note { margin-top: 14px; color: var(--dim); font-size: 0.9rem; text-align: center; }

/* ---------- landing ---------- */

.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 88px); }
.hero h1 { max-width: 13em; }
.lede { max-width: 36em; margin-top: 22px; color: var(--muted); font-size: clamp(1.08rem, 1.5vw, 1.24rem); line-height: 1.55; }

.band { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.band h2 + p, .band h3 + p { margin-top: 14px; color: var(--muted); }
.narrow { max-width: 38em; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); gap: clamp(28px, 5vw, 72px); align-items: center; }

.shape { margin-top: clamp(40px, 6vw, 68px); }
.shape p { max-width: 44em; }
.shape .screen { margin-top: 24px; }

.code {
  margin: 22px 0 0;
  padding: 16px 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: #d0d6dc;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  tab-size: 2;
}

.code code { font-size: inherit; }

.picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.pick, .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.pick { font-family: var(--mono); font-size: 0.84rem; }
.pick:hover, .chip:hover { border-color: #4a5058; color: var(--text); }
.pick[aria-pressed="true"] { border-color: #5a616a; background: #14171a; color: var(--text); }
.chip[aria-disabled="true"] { border-color: var(--line); color: var(--dim); cursor: not-allowed; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: #3a3e44; }
.dot[data-state="ok"] { background: #9bd82b; box-shadow: 0 0 8px rgb(155 216 43 / 0.7); }
.dot[data-state="warn"] { background: #ffae1f; box-shadow: 0 0 8px rgb(255 174 31 / 0.7); }
.dot[data-state="bad"] { background: #ff4a26; box-shadow: 0 0 8px rgb(255 74 38 / 0.7); }
.dot[data-state="run"] { background: #3aa0ff; box-shadow: 0 0 8px rgb(58 160 255 / 0.7); }

/* The board on an office wall. office-wall.jpg is 1280x720 and its TV faces the camera squarely: the
   black panel runs from x 410 to 898 and y 153 to 436. .wall-tv is that rectangle less a 4px bezel, as
   percentages of the picture. The board inside is drawn at a fixed 960x548 and scaled by --k (home.js). */
.wall { margin: clamp(28px, 4vw, 44px) 0 0; }
.wall-frame { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: #000; }
.wall-scene { position: relative; aspect-ratio: 16 / 9; }
.wall-scene img { display: block; width: 100%; height: 100%; }
.wall-tv { position: absolute; left: 32.34%; top: 21.81%; width: 37.5%; height: 38.06%; overflow: hidden; background: #000; box-shadow: 0 0 calc(var(--k, 0.5) * 120px) rgb(190 215 255 / 0.1); }
.wall-tv > div { position: absolute; top: 0; left: 0; width: 960px; height: 548px; transform: scale(var(--k, 0.5)); transform-origin: 0 0; }
/* A little window light across the glass, so the board sits in the room instead of on top of it. */
.wall-tv::after { content: ""; position: absolute; inset: 0; background: linear-gradient(118deg, rgb(255 255 255 / 0.07) 0%, rgb(255 255 255 / 0.02) 28%, transparent 46%); pointer-events: none; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); margin: clamp(32px, 5vw, 52px) 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 18px; border-top: 1px solid var(--line-strong); }
.steps li::before { content: counter(step); display: block; margin-bottom: 14px; color: var(--green); font-family: var(--mono); font-size: 0.86rem; }
.steps p { margin-top: 10px; color: var(--muted); font-size: 0.98rem; }

.uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3.4vw, 40px) clamp(24px, 4vw, 48px); margin: clamp(32px, 5vw, 52px) 0 0; padding: 0; list-style: none; }
.uses li { padding-top: 18px; border-top: 1px solid var(--line-strong); }
.uses p { margin-top: 10px; color: var(--muted); font-size: 0.98rem; }

.aside { max-width: 44em; margin-top: clamp(32px, 5vw, 52px); padding-left: 18px; border-left: 2px solid var(--amber); color: var(--muted); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.soon { padding: 24px 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }

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

.docs { padding: clamp(28px, 5vw, 56px) 0 clamp(64px, 8vw, 104px); }
.docs-wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: 24px; display: grid; gap: 2px; padding-top: 10px; font-size: 0.9rem; }
.toc a { padding: 5px 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.docs article { max-width: 46em; min-width: 0; }
.docs h1 { font-size: clamp(2.1rem, 4.4vw, 3rem); }
.docs h2 { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 1.55rem; }
.docs h3 { margin-top: 34px; }
.docs article > p, .docs article > ul, .docs article > ol { margin-top: 16px; color: #c3c9cf; }
.docs article > .lede { margin-top: 18px; color: var(--muted); }
.docs ul, .docs ol { padding-left: 1.3em; }
.docs li + li { margin-top: 8px; }
.docs li::marker { color: var(--dim); }

.table { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
/* Narrow screens scroll the table sideways instead of squeezing the last column into a ribbon. */
table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.94rem; line-height: 1.5; }
th, td { padding: 11px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { border-top: 0; background: var(--panel); color: var(--dim); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
tbody th { font-weight: 500; white-space: nowrap; }
td { color: #c3c9cf; }

/* ---------- /privacy and /terms: many short sections, so the headings sit closer than in the docs ---------- */

.legal h2 { margin-top: 44px; padding-top: 0; border-top: 0; font-size: 1.28rem; }
.legal .updated { margin-top: 14px; color: var(--dim); font-size: 0.9rem; }
.legal article strong { color: var(--text); font-weight: 600; }

/* ---------- FAQ: the /faq list and the pages under it, on top of the docs styles ---------- */

.faq h1 { font-size: clamp(1.85rem, 3.5vw, 2.55rem); line-height: 1.1; letter-spacing: -0.03em; }
.toc-title { padding: 5px 0 8px; color: var(--dim); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-bottom: 18px; color: var(--dim); font-size: 0.88rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.docs article > .screen-example { aspect-ratio: 16 / 9; margin-top: 24px; }

.listing { margin: 22px 0 0; min-width: 0; }
.listing figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 8px 0 18px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: #08090b; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; overflow-wrap: anywhere; }
.listing .code { margin-top: 0; border-radius: 0 0 10px 10px; }
.screen-example + .listing { margin-top: 10px; }
.copy { flex: none; min-height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.78rem; font-weight: 500; cursor: pointer; }
.copy:hover { border-color: #4a5058; color: var(--text); }

.docs .howto { margin-top: 8px; padding-left: 0; list-style: none; counter-reset: step; }
.docs .howto > li { position: relative; margin-top: 26px; padding-left: 46px; counter-increment: step; }
.howto > li::before { content: counter(step); position: absolute; left: 0; top: -3px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--green); font-family: var(--mono); font-size: 0.82rem; }
.docs .howto h3 { margin-top: 0; }
.howto p { margin-top: 8px; }

.docs .faq-list { margin-top: 20px; padding-left: 0; list-style: none; }
.docs .faq-list li { margin-top: 0; padding: 20px 0; border-top: 1px solid var(--line); }
.docs .faq-list h3 { margin-top: 0; font-size: 1.1rem; font-weight: 600; }
.faq-list h3 a { color: var(--text); text-decoration: none; }
.faq-list h3 a:hover { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; }
.faq-list p { max-width: 42em; margin-top: 8px; color: var(--muted); font-size: 0.97rem; }

/* FAQ tables often have a sentence in the first column, which has to be allowed to wrap. */
.faq tbody th { min-width: 9em; white-space: normal; }

.uses .more { margin-top: 12px; font-size: 0.94rem; }
.also { max-width: 46em; margin-top: clamp(28px, 4vw, 40px); color: var(--muted); }

.try { margin-top: 64px; padding: 26px 28px 28px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel); }
.docs .try h2 { margin-top: 0; padding-top: 0; border-top: 0; font-size: 1.3rem; }
.try p { margin-top: 10px; color: var(--muted); }
.try .actions { margin-top: 20px; }

/* ---------- editor ---------- */

.editing { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.editor { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 var(--gutter) var(--gutter); }

.editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 6px 0 16px; }
.editor-bar h1 { margin-right: auto; font-size: 1.3rem; letter-spacing: -0.02em; }
.editor-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-hint { margin-right: 2px; color: var(--dim); font-size: 0.88rem; }
.editor .chip { border-radius: 8px; }

.editor-panes { flex: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; min-height: 480px; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-preview .screen { flex: 1; }

#source {
  flex: 1;
  width: 100%;
  min-height: 240px;
  padding: 16px 18px;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 0 0;
  background: var(--panel);
  color: #d6dbe0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
}

#source:focus-visible { outline-offset: -2px; border-radius: 14px 14px 0 0; }

.report { max-height: 34%; padding: 12px 18px 14px; overflow: auto; border: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 14px 14px; background: #08090b; font-size: 0.9rem; }
#status { display: flex; align-items: center; gap: 9px; font-weight: 600; }
#status::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #3a3e44; }
#status[data-kind="ok"]::before { background: var(--green); box-shadow: 0 0 8px rgb(155 216 43 / 0.7); }
#status[data-kind="warn"]::before { background: var(--amber); box-shadow: 0 0 8px rgb(255 174 31 / 0.7); }
#status[data-kind="bad"]::before { background: #ff4a26; box-shadow: 0 0 8px rgb(255 74 38 / 0.7); }
#issues { margin: 10px 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 0.8rem; line-height: 1.55; }
#issues li { padding: 3px 0 3px 18px; overflow-wrap: anywhere; }
#issues li[data-kind="bad"] { color: #ff9b84; }
#issues li[data-kind="warn"] { color: #f2c46a; }

/* ---------- the full-screen viewer ---------- */

.viewer { overflow: hidden; background: #000; }
.viewer #board { position: fixed; inset: 0; width: auto; height: auto; }
.viewer.is-still { cursor: none; }

.corner {
  position: fixed;
  left: 18px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  gap: 16px;
  color: #6b7178;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: opacity 0.6s ease;
}

.corner a { color: #9aa1a9; font-weight: 600; text-decoration: none; }
.corner a:hover { color: #fff; }
.is-still .corner { opacity: 0; pointer-events: none; }
@media (hover: none) { .corner span { display: none; } }

.panel { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: 32px; background: #000; }
.panel[hidden] { display: none; }
.panel > div { max-width: 40em; padding-left: 22px; border-left: 2px solid var(--amber); }
.panel h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.panel p { margin-top: 14px; color: var(--muted); overflow-wrap: anywhere; }
.panel ul { margin: 16px 0 0; padding: 0; list-style: none; color: #f2c46a; font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; overflow-wrap: anywhere; }

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

.lost { display: grid; align-items: center; min-height: 62vh; padding: 64px 0; }
.lost-orb { width: 72px; height: 72px; margin-bottom: 34px; border-radius: 50%; background: radial-gradient(circle at 50% 34%, #474b52 0%, #2a2d32 50%, #17191c 100%); box-shadow: inset 0 0 0 2px #0e0f11; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .split, .pair { grid-template-columns: minmax(0, 1fr); }
  .screen-shape { aspect-ratio: 16 / 10; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-wrap { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; padding: 14px 0; border-block: 1px solid var(--line); }
  /* An FAQ page's headings are too long for two columns, and the page is short enough to scroll. */
  .faq-page .toc, .legal .toc { display: none; }
  .toc-title { grid-column: 1 / -1; }
  .screen-one { aspect-ratio: 4 / 4; }
  .editor-panes { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .pane-preview { order: -1; }
  .pane-preview .screen { flex: none; aspect-ratio: 1 / 1.2; max-height: 70vh; }
  #source { min-height: 52vh; }
  .report { max-height: none; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .screen-hero { aspect-ratio: 3 / 4.3; }
  .screen-shape { aspect-ratio: 1 / 1.7; }
  .uses { grid-template-columns: minmax(0, 1fr); }
  .docs article > .screen-example { aspect-ratio: 1 / 1.05; }
  .try { padding: 22px 20px 24px; }
  /* Crop in on the TV: the picture is drawn half as wide again and slid left to keep the TV centred. */
  .wall-scene { width: 150%; margin-left: -26.6%; }
  .site-head nav a.btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
