/* WQX. Static, no build step.
 *
 * Craft taken from the bittensor-hub archive: warm off-white, hairline borders,
 * one mono label primitive, structure instead of decoration.
 *
 * Two things deliberately NOT taken: the custom cursor, which is a usability tax
 * including for motor impairment, and any scrolling that moves a different
 * distance than the input asks for. The hero scene and smooth scrolling are
 * here at Q's direction (T-495, 2026-09-23); smooth scrolling is off entirely
 * under prefers-reduced-motion, and it eases the same distance the wheel asks
 * for, which is the difference between smooth and hijacked.
 *
 * THE LABEL RULE, and it is the one that matters:
 *   .label is mono, uppercase, 11px, wide tracking. It sets labels, nav, and
 *   data. It NEVER sets a sentence. Headlines and body are the body face at
 *   sentence case. Mono uppercase setting a sentence photographs well and
 *   loses the reader who is not looking for a terminal.
 */

/* The archive's two typefaces, self-hosted (T-339), so no request leaves the site. Latin subset, which holds
 * French's accents, oe ligature and guillemets; variable weight. SIL Open Font License 1.1: fonts/OFL-*.txt.
 * From the @fontsource-variable packages, 2026-09-22; sizes and SHA-256 in site/README.md. */
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  /* optional, not swap: the mono sets labels, never a sentence, and swapping it late re-measured
   * the nav and cost 0.021 of layout shift. Optional means it is used when it is ready and
   * skipped for this load when it is not, which is invisible at label size and never shifts. */
  font-display: optional;
  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 {
  /* Strict black and white (T-495 item 4). Every grey is black at an opacity, so there is one
   * colour decision on the page and the rest are degrees of it. */
  --bg: #ffffff;
  --fg: #000000;
  --muted: #f4f4f4;
  --muted-fg: #565656;                 /* 7.4:1 on white, so a label is still readable text */
  --border: rgba(0, 0, 0, 0.13);
  --border-strong: rgba(0, 0, 0, 0.32);

  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* One spacing grid, 8px, used for every gap on the page. Sections are the only place that
   * leaves the grid, because they scale with the viewport. */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --s7: 96px;
  --section: clamp(72px, 9vw, 144px);

  --measure: 62ch;
  --gutter: 24px;
  --max: 1180px;
}

@media (min-width: 640px) {
  :root { --gutter: 40px; }
}

/* Lenis 1.3.26's own rules, copied from vendor/lenis-1.3.26.css (MIT, pinned beside the script)
 * rather than linked, so the page still loads one stylesheet. Change them there first. */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent],
.lenis [data-lenis-prevent-wheel],
.lenis [data-lenis-prevent-touch],
.lenis [data-lenis-prevent-vertical],
.lenis [data-lenis-prevent-horizontal] {
  overscroll-behavior: contain;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

.lenis.lenis-autoToggle {
  transition-property: overflow;
  transition-duration: 1ms;
  transition-behavior: allow-discrete;
}

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

html {
  color-scheme: light;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

a { color: inherit; text-decoration: none; }
a:not(.label):not(.brand) {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
}
a:not(.label):not(.brand):hover { border-bottom-color: var(--fg); }

/* ---------- the label primitive ---------- */

.label {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

a.label:hover { color: var(--fg); }

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

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 50;
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 8px 12px;
}

header.site {
  border-bottom: 1px solid var(--border);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
}
/* The wordmark (T-495). Provisional: traced from Q's PNG with potrace, and the Q-tail and the X
 * alignment may still change. The solid mark is used here, in the footer and in the icons; the
 * hero uses the ASCII form instead. */
.brand {
  display: inline-flex;
  align-items: center;
}
.wordmark {
  display: block;
  width: auto;
  height: 20px;
}
@media (min-width: 640px) {
  .wordmark { height: 22px; }
}
.footer-mark { margin-bottom: 18px; }
.footer-mark .wordmark { height: 16px; }
header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
header.site nav a[aria-current="page"] { color: var(--fg); }

main { display: block; }

/* Air instead of rules: sections are separated by space, and only the last band before the
 * footer keeps a line. Fewer elements per section is the point of the pass. */
section {
  padding: var(--section) 0;
  border-bottom: 0;
}
section + section { padding-top: 0; }
section.ruled { border-top: 1px solid var(--border); padding-top: var(--section); }

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.022em;
  text-transform: none;
  margin: 0;
  text-wrap: balance;
}

/* The scale steps by about 1.33, and the two ends are set against the viewport so the headline
 * is the same gesture on a phone as on a desktop. */
h1 {
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.06;
  max-width: 20ch;
}

h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.12;
  max-width: 22ch;
}
h3 {
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.3;
}

p, li { max-width: var(--measure); }
p { margin: var(--s2) 0 0; }
h2 + p, h3 + p { margin-top: var(--s3); }
.label + h2, .label + h1 { margin-top: var(--s2); }

.lede {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.5;
  color: var(--fg);
}

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

strong { font-weight: 600; }

ul, ol { margin: 16px 0 0; padding-left: 20px; }
li + li { margin-top: 8px; }

ul.plain { list-style: none; padding-left: 0; }
ul.plain li {
  border-top: 1px solid var(--border);
  padding: 12px 0;
  max-width: var(--measure);
}

/* ---------- structural blocks, no decoration ---------- */

.rule { border-top: 1px solid var(--border); margin-top: var(--s5); padding-top: var(--s5); }

.box {
  border: 1px solid var(--border);
  padding: 20px;
}
@media (min-width: 640px) {
  .box { padding: 28px; }
}

.grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: var(--s5);
}
@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}
.grid > * {
  background: var(--bg);
  padding: var(--s4);
  margin: 0;
}
.grid > * > :first-child { margin-top: 0; }
.grid p { max-width: 46ch; }

/* numbered steps: the number is data, so it is mono */
ol.steps { list-style: none; padding-left: 0; counter-reset: step; margin-top: 8px; }
ol.steps > li {
  counter-increment: step;
  border-top: 1px solid var(--border);
  padding: 20px 0 0;
  margin-top: 20px;
  max-width: none;
}
ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted-fg);
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 15px;
}
caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-fg);
  padding-bottom: 12px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--border);
}
th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted-fg);
  /* No nowrap below 640px: a mono uppercase header row is wide enough to
     force horizontal page scroll on a phone, which it did. */
  white-space: normal;
}
/* Below 640px a three-column table of long unbreakable words (Responsible,
   Conservation, Communication) is wider than a 320px phone. Hyphenate by
   the page's lang first; break mid-word only as a last resort. */
@media (max-width: 639px) {
  th, td, caption { hyphens: auto; overflow-wrap: anywhere; }
}
@media (min-width: 640px) {
  th { white-space: nowrap; }
}
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

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

/* ---------- section reveals ----------
 * The only motion on the page besides the hero: a section lifts a few pixels into place the
 * first time it is seen, once, and never again. Under prefers-reduced-motion nothing moves, and
 * with JavaScript off nothing is hidden, because the hidden state is only ever set by script. */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 620ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal].seen {
  opacity: 1;
  transform: none;
  will-change: auto;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal].seen { opacity: 1; transform: none; transition: none; }
}

/* ---------- the one call to action ---------- */

.cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  padding: 15px var(--s3);
  margin-top: var(--s5);
}
.cta:hover { background: var(--bg); color: var(--fg); }

/* ---------- intake ---------- */

form.intake { margin-top: 32px; max-width: var(--measure); }
.field { border-top: 1px solid var(--border); padding: 24px 0 0; margin-top: 24px; }
.field:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.field label { display: block; }
.field .q {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.field .hint { color: var(--muted-fg); font-size: 15px; margin-top: 6px; }
.field input, .field textarea, .field select {
  display: block;
  width: 100%;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 17px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 11px 12px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 1px solid var(--fg);
  outline-offset: 0;
  border-color: var(--fg);
}

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

footer.site {
  border-top: 1px solid var(--border);
  padding: var(--s6) 0 var(--s6);
}
footer.site .wrap {
  display: grid;
  gap: var(--s4);
}
@media (min-width: 720px) {
  footer.site .wrap {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
  footer.site nav { justify-content: flex-end; }
}
/* The footer mark sits above the legal line, not beside it. */
.footer-mark { grid-column: 1 / -1; margin-bottom: 0; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------- landing hero ----------
 * The first screen is the mark alone: the WQX in three dimensions, drawn in characters by
 * site/hero-3d.js over a field of code fragments, edge to edge and the full height of the viewport
 * (P-ops-26). The headline follows below the fold, word for word. The <pre> marks in the markup
 * are the first paint and the fallback when WebGL is missing; the script fades them out once it
 * has drawn three frames. */

/* On the home pages the header floats over the scene so the hero is the whole first screen. */
body.home header.site {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  border-bottom: 0;
}

.hero {
  position: relative;
  display: block;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}
.hero-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;           /* the static mark and the line under it, packed in the middle */
  background: var(--bg);
  touch-action: pan-y;             /* a sideways drag spins the mark; the page still scrolls */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.hero-scene.dragging { cursor: grabbing; }
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 700ms ease;
}
.hero-scene.live .hero-canvas { opacity: 1; }
.hero-scene.live .hero-mark { opacity: 0; }

/* The static mark (T-495 item 3b), built from the same source as the vector by
 * site/brand/ascii-logo.mjs: first paint, and the fallback. Sized to the viewport so it is never
 * clipped: 121 columns at 0.6 em each stay inside 88% of the width, 60 columns below 900 px. */
.hero-mark {
  position: relative;
  z-index: 1;
  pointer-events: none;
  transition: opacity 700ms ease;
}
.hero-ascii {
  margin: 0;
  font-family: var(--mono);
  font-weight: 400;
  font-size: min(2.4vw, 12px);
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--fg);
  white-space: pre;
}
.hero-ascii--big { display: none; }
/* The line beneath the mark (T-876 v6, point 2): page text, letter-spaced monospace capitals on a
 * quiet backing, centred. Before the scene is live it follows the static mark in flow; live,
 * hero-3d.js publishes the 3D mark's bottom edge at rest as --mark-bottom on the section and the
 * line sits under that, so it stays still while the mark sways. The last letter's tracking is
 * pulled back so the text is centred on its letters, not on the trailing space. */
.hero-sub {
  position: relative;
  z-index: 1;
  margin: clamp(14px, 2.5vh, 26px) 0 0;
  padding: 6px 10px 5px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.86);
  pointer-events: none;
}
.hero-scene.live .hero-sub {
  position: absolute;
  left: 50%;
  top: calc(var(--mark-bottom, 62%) + clamp(14px, 2.5vh, 26px));
  transform: translateX(-50%);
  margin: 0;
}
@media (min-width: 640px) {
  .hero-sub { font-size: 12px; letter-spacing: 0.34em; text-indent: 0.34em; }
}
@media (min-width: 900px) {
  .hero-ascii { font-size: clamp(3px, 1.2vw, 14px); }
  .hero-ascii--small { display: none; }
  .hero-ascii--big { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-canvas, .hero-mark { transition: none; }
}

/* The headline, in its own band below the fold. The section rule above strips the top padding of
 * a section that follows another; the hero is edge to edge, so the band that follows it gets its
 * air back. */
.hero + section { padding-top: var(--section); }
.hero-copy {
  max-width: 26ch;
  margin: 0;
}
@media (min-width: 900px) {
  .hero-copy { max-width: 30ch; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: hero-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* The corner (T-876 v5, point 5): the tagline alone, bottom right, small monospace on a quiet
 * backing so it reads over the field. The mark is framed inside 78% of the width and 62% of the
 * height, so the corner is clear of it on a landscape screen. Under 900 px it sits at the bottom,
 * centred, above the home indicator. */
.hero-cta {
  position: absolute;
  right: clamp(16px, 4vw, 56px);
  bottom: clamp(20px, 5vh, 56px);
  z-index: 2;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.86);
  max-width: calc(100vw - 32px);
}
.hero-tagline {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--fg);
  white-space: nowrap;
}
@media (max-width: 899px) {
  .hero-cta {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    max-width: none;
  }
  .hero-tagline { white-space: normal; font-size: 12px; }
}

@media print {
  header.site, footer.site nav, .cta, .hero-scene, .hero-cta { display: none; }
  body { font-size: 11pt; }
}

/* ---------- the Start form (T-166) ---------- */

.intake {
  display: grid;
  gap: 18px;
  max-width: var(--measure);
  margin-top: 24px;
}
.intake[hidden] { display: none; }
.intake label {
  display: grid;
  gap: 6px;
}
.intake .opt { color: var(--muted-fg); }
.intake input,
.intake textarea {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 10px 12px;
  width: 100%;
}
.intake textarea { min-height: 88px; resize: vertical; }
.intake input:focus,
.intake textarea:focus { outline: 1px solid var(--fg); outline-offset: 2px; }
.intake .cta { justify-self: start; margin-top: 8px; cursor: pointer; }
.intake .cta[disabled] { opacity: 0.5; cursor: default; }
.intake .trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.intake-status { margin-top: 16px; }
.intake-status:empty { display: none; }
.fallback { margin-top: 20px; }
.intake-questions { margin-top: 20px; padding-left: 1.4em; }
.intake-questions li + li { margin-top: 6px; }
.intake-preview { margin-top: 20px; padding: 10px 12px; border: 1px dashed var(--border-strong); color: var(--muted-fg); }
.intake-sent { margin-top: 16px; padding: 12px; border: 1px solid var(--border); font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
