/* ============================================================================
   Basalt — the pieces every page shares
   ----------------------------------------------------------------------------
   tokens.css owns colour, type, rhythm and the mark. THIS file owns the shell,
   the grain, the nav and the footer — the furniture that is identical on every
   page. Anything that appears on one page only stays in that page's own <style>.

   Load order is tokens.css, then this. Both are imported, never forked.
   ========================================================================== */

*{ box-sizing: border-box; }

/* Horizontal padding as two properties, NEVER the `padding: 0 32px` shorthand.
   The shorthand is the same specificity as .hero/.opener/.major/.minor in
   tokens.css and loads after it, so it silently zeroes every vertical value.
   Measured when it happened: all eight sections came back 0px/0px while the
   source looked correct, and the uneven rhythm — the main defence against the
   page reading as a list — was gone on screen. */
.shell{
  max-width: var(--w-page);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}
section{ position: relative; }

/* ------------------------------------------------------------------ grain -- */
/* Film grain, one fixed layer above everything, no pointer events. The tile
   recipe is hermes-agent's, read off the live site on 2026-08-07 rather than
   remembered: fractalNoise, four octaves, desaturated, 128px. Not copied: their
   color-burn blend, which crushes to black on a near-black page, and the soft
   gradient vignette beside it, which is a glow.

   0.035 is measured, not chosen. The tile is mean luma 93.6, sigma 24.2, so
   0.035 lays 0.85 luma units of variation over a field whose own luma is 8.93 —
   enough that a flat digital field stops reading as a template, small enough
   that the contrast sweep still passes with the grain composited in. It cost
   --mute a lift from #767C85 to #7C828B; see BRAND.md section 2.

   No prefers-reduced-motion rule. Grain does not move. */
.grain{
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .035;
  background-size: 128px 128px;
  /* Promoted to its own compositor layer. Without this the full-viewport fixed
     tile is re-rasterised against the page on every scroll frame, which is the
     single most expensive paint on the page. */
  transform: translateZ(0);
  backface-visibility: hidden;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* There were three more rules here, halving the grain on a light page because
   the same grey tile darkens one rather than texturing it, which reads as dirt.
   Gone with the light palette on 2026-08-11 — see tokens.css. The site is dark,
   the one opacity above is the measured one, and a second value that can never
   apply is a value that drifts out of step with the contrast sweep silently.
   The sweep reads .grain's opacity and composites it into every ratio it
   measures, so it must be a single number. */

/* ------------------------------------------------------- page transition -- */
/* Route changes are otherwise instantaneous, which reads as a hard cut. A short
   fade with a 6px settle gives the eye something to follow without delaying the
   content. Motion is opt-out for reduced-motion users. */
@keyframes page-enter{
  from{ opacity: 0; transform: translate3d(0,6px,0); }
  to  { opacity: 1; transform: translate3d(0,0,0); }
}
/* Only opacity and transform animate, so the whole enter runs on the compositor
   with no layout or paint work. will-change is cleared by the animation ending
   (both/forwards keeps the end state, the hint is dropped with the class on the
   next route swap) so idle pages do not hold an extra layer. */
.page-enter{
  animation: page-enter .32s cubic-bezier(.22,.61,.36,1) both;
  will-change: opacity, transform;
}
@media (prefers-reduced-motion: reduce){
  .page-enter{ animation: none; will-change: auto; }
}

/* ----------------------------------------------------------- scroll progress -- */

/* A 2px hair of the bone accent that grows with scroll. Kept above the grain
   layer so it stays crisp, and kept translucent so it reads as a navigational
   hint rather than a bright rule. */
.scroll-progress{
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 10000;
  background: var(--bone);
  opacity: .75;
  pointer-events: none;
  will-change: transform;
}

/* --------------------------------------------------------- raised panels -- */
/* A panel that sits ABOVE the page field. Use these two classes rather than
   writing `background: var(--surface2)` into a page's own CSS, because the raise
   carries a second obligation with it.

   --mute is the quiet token for the PAGE FIELD only. Measured in the browser
   2026-08-07, both themes, grain composited, worst of clean / grain / 3 sigma:

                       dark          light
     --mute on --bg     4.87 pass     4.62 pass
     --mute on --surface  4.66 pass   4.97 pass
     --mute on --surface2 4.44 FAIL   4.75 pass
     --mute on --surface3 4.15 FAIL   4.33 FAIL
     --dim  on --surface3 6.13 pass   5.60 pass

   So a quiet grey stops being legible exactly where the field gets lighter, and
   --dim clears 4.5:1 on every surface in both themes with room to spare.
   --bone-dim was the other candidate and is out: 4.55 on --surface3 dark is a
   0.05 margin, and in light it fails on all four (3.44–4.04).

   The reassignment lives on the raise, not on each text rule, because an opt-out
   written rule by rule is the thing that gets forgotten on the next panel added.
   Recession inside a raised panel is carried by SIZE, not by a lower contrast.

   The selector is doubled on purpose. site.css loads BEFORE each page's own
   <style>, so a single class here ties on specificity with any page rule and
   loses on source order — `.tier{background:var(--surface)}` in pricing.html
   would have silently eaten the lead tier's raise while KEEPING the --mute
   reassignment, which is the worst of both. Doubling makes the pair atomic. */
.raise2.raise2{ background: var(--surface2); --mute: var(--dim); }
.raise3.raise3{ background: var(--surface3); --mute: var(--dim); }

/* ---------------------------------------------------------- prose links -- */
/* Every link written inside running text, on every page, present and future.
   Without this the browser's default link blue applies, which measures 2.12:1
   on the dark field — it is not a near miss, it is unreadable. That is exactly
   what happened the first time a paragraph link was written outside .doc
   (support.html, "the terms page"), and a per-page rule would let it happen
   again on the next page someone adds.

   Excluded on purpose: .nav a, .foot a and .btn, which are furniture and carry
   their own colour. The underline is --bone-dim rather than the text colour so
   the link reads as a link without shouting; it is decoration, never the sole
   carrier of meaning, so its contrast is not load-bearing. */
p a:not(.btn), li a:not(.btn), .lane a:not(.btn), .doc a:not(.btn){
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--bone-dim);
  text-underline-offset: 3px;
}
p a:not(.btn):hover, li a:not(.btn):hover, .lane a:not(.btn):hover, .doc a:not(.btn):hover{
  text-decoration-color: var(--bone);
}

/* -------------------------------------------------------------------- nav -- */
/* Does not stick, does not shrink, does not reappear. It scrolls away at 88px
   and there is no back-to-top button. */
.nav{ display: flex; align-items: center; justify-content: space-between; height: 88px; }
.nav .brand{
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text); min-height: 44px;
}
.nav .brand span{ font-variation-settings: 'wdth' 88, 'wght' 600; font-size: 20px; letter-spacing: -.02em; }
.nav .right{ display: flex; align-items: center; gap: 28px; }
.nav a.link{
  color: var(--dim); text-decoration: none; font-size: 15px;
  display: inline-flex; align-items: center; min-height: 44px;
  position: relative;
  transition: color 0.2s ease;
}
.nav a.link::after{
  content: '';
  position: absolute; left: 0; right: 0; bottom: 10px;
  height: 1px;
  background: var(--bone);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav a.link:hover{ color: var(--text); }
.nav a.link:hover::after{ transform: scaleX(1); }
.nav a.link[aria-current="page"]{ color: var(--text); }
.nav a.link[aria-current="page"]::after{ transform: scaleX(1); }

/* ----------------------------------------------------------------- footer -- */
.foot{
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; padding-top: 34px; flex-wrap: wrap;
}
.foot .brand{ display: flex; align-items: center; gap: 12px; }
.foot .brand span{ font-variation-settings: 'wdth' 88, 'wght' 600; font-size: 18px; }
.foot nav{ display: flex; gap: 26px; }
.foot nav a{
  color: var(--mute); text-decoration: none; font-size: 14.5px;
  display: inline-flex; align-items: center; min-height: 44px;
  transition: color 0.2s ease;
}
.foot nav a:hover{ color: var(--text); }
.build{ color: var(--mute); font-size: 13.5px; margin: 22px 0 0; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ page intro -- */
/* Every page below Home opens the same way: label, serif headline, one sentence.
   Home does NOT use this — its hero is its own construction. */
.intro h1{ max-width: 16ch; }
.intro .lede{ margin-bottom: 0; }

/* ------------------------------------------------- documents ------------- */
/* Terms, Privacy and Support. One reading column, no instruments, no panels —
   these pages are read, not scanned, and giving them the marketing furniture
   would be dressing up a legal document. */
.doc{ max-width: var(--w-col); }
.doc h2{ font-size: var(--t-h2); margin-top: 56px; }
.doc h2:first-of-type{ margin-top: 34px; }
.doc p, .doc li{ color: var(--dim); font-size: 17px; }
.doc b, .doc strong{ color: var(--text); font-weight: 400; }
.doc ul{ padding-left: 20px; margin: 0 0 20px; }
.doc li{ margin-bottom: 10px; }
.doc li::marker{ color: var(--bone-dim); }

/* The draft banner. It is --warn, the same value the site uses for every other
   honest limit, because that is what this is. */
.draft{
  border-left: 2px solid var(--warn);
  padding: 4px 0 4px 22px;
  margin: 0 0 40px;
  max-width: var(--w-col);
}
.draft p{ margin: 0; color: var(--warn); font-size: 16px; }

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 1000px){
  .shell{ padding-left: 22px; padding-right: 22px; }
}

/* The nav is the one row on this site that cannot shrink to fit. Measured at
   375 on 2026-08-12: `.nav .right` — three text links and the solid button —
   is 327px wide, and the content column between the 22px shell paddings is
   331px. So the wordmark and those four items cannot share a line, and they
   were not sharing one: the row ran to a right edge of 445, `scrollWidth` came
   back 446 against a 375 viewport, and the whole document scrolled sideways.
   On every page, because this file is the furniture.

   It survived a full sweep at "390" twice, which is the part worth keeping.
   The viewport had not actually been applied — `innerWidth` read 445 while the
   assertion compared against the number that had been requested — so the gate
   measured a desktop layout and called it a phone. Any sweep row at a given
   width is worthless unless the run also prints the width it really got.

   Wrapping to two rows rather than hiding the links or adding a hamburger: a
   hamburger is a new construction and a script, and this site's nav has
   neither. Nothing is removed and nothing needs JavaScript. */
@media (max-width: 720px){
  .nav{ flex-wrap: wrap; height: auto; padding-top: 20px; padding-bottom: 20px; row-gap: 4px; }
  .nav .right{ width: 100%; justify-content: flex-start; gap: 22px; flex-wrap: wrap; }
  /* Wrapping the ROW is fine; wrapping a LABEL is not. The first version left
     the four items at their desktop size and they filled the 331px exactly, so
     `space-between` had no slack and the text broke inside the items instead —
     "How it works" over two lines at 49px tall, the button at 77. Nothing
     overflowed and no gate fired, because a ragged nav is legal. Labels are
     held on one line now, and the row may wrap rather than run off the edge on
     a screen narrower than the one this was measured on.

     THE NAV'S BUTTON IS GONE HERE, and that is the reason two rows fit instead
     of three. Holding it made the row 335px against 331px of column — four
     pixels — and it dropped to a line of its own, giving a 196px nav before a
     phone sees any of the page. The hero's `Get Basalt` is the very next thing
     below it either way, so nothing became unreachable and R5 still has its
     solid button in the first screenful. Reversible in one line if that reads
     wrong on a real handset. */
  .nav a.link{ font-size: 14px; white-space: nowrap; }
  .nav .right .btn{ display: none; }
}
