/*
  The landing page's styles.

  The look is the app's own: quiet graphite surfaces, Geist, and colour kept
  for what means something. Amber is the rule a person set. Green and red are
  a buy and a sell, a rise and a fall. The greens of the mark belong to the
  mark, and to the field: fine lines in those greens behind the first words
  and under the foot of the page, as on the store pictures and the app's icon,
  and running out from the whistle when an alert is told: in the ring round it
  on the board, and through the first story's panel.
  The colours below are the ones in mobile/src/theme.ts, and a test holds the
  two together.

  Every gap and fixed size is a step on a 4px grid.

  The page is laid out twice. Without the `live` class it is a plain, finished
  page read from top to bottom. The script adds `live` once it is running, and
  then the two stories stay in place while they are scrolled through.
*/

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #141415;
  --card: #19191b;
  --raised: #232325;
  --hairline: rgba(237, 237, 237, 0.08);
  --focus: rgba(237, 237, 237, 0.28);
  --text: #ededed;
  --secondary: #a1a1a6;
  --muted: #85858b;
  --accent: #d28e05;
  --positive: #4cc38a;
  --negative: #e5484d;

  /* The hairline as it looks on the page colour, for frames. And a wire, a step brighter, so it reads as a line of its own. */
  --line: #252526;
  --wire: #323234;

  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* On the field: the words, the quieter words, and the frame round a screen, as the store's pictures have them. */
  --on-field: #f2fbf6;
  --on-field-quiet: #a6dcc5;
  --field-ground: #04140e;
  --frame: #0a110e;
  --rim: rgba(170, 240, 208, 0.28);

  /* One curve and three durations, as in the app. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --press: 140ms;
  --shift: 280ms;
  --enter: 700ms;

  /* The height of the top bar, the page's side margin, and the height of a row in a list. */
  --top: 56px;
  --gutter: 32px;
  --row: 32px;

  /* The widest the page's contents go, side margins included. */
  --wide: 1344px;

  /* The height of the screen. On a phone that is the height with the browser's bars showing, where a browser can say so. */
  --screen: 100vh;

  color-scheme: dark;
}

@supports (height: 100svh) {
  :root {
    --screen: 100svh;
  }
}

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

html {
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--top);
  /*
    The page stops at its top and at its bottom. Pulled past either, it would
    spring back over bare ground, and the lines under the foot, which run off
    the bottom edge, would be seen to end.
  */
  overscroll-behavior-y: none;
}

/* The colours and the face are said on the body as well, so a host that sets its own there does not win. */
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
p,
dl,
dt,
dd,
figure {
  margin: 0;
  font-weight: 400;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

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

[hidden] {
  display: none !important;
}

/* Read out, not shown: what the moving wall is, for someone who cannot see it. */
.spoken {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- The top bar: the mark and the name on one side, the way around and when it comes on the other. ---- */

.top {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  height: var(--top);
  background: var(--page);
  box-shadow: 0 1px 0 var(--line);
}

/*
  On the first page the bar has no ground of its own until the visitor
  scrolls: the field runs up behind it, as it runs to the top of the store's
  pictures. Only on the running page, which is the one that knows when the
  visitor has scrolled. Without the script the bar is as it is everywhere.
*/
.top {
  transition:
    background-color var(--shift) var(--ease),
    box-shadow var(--shift) var(--ease);
}

.live .top.home:not(.scrolled) {
  background-color: transparent;
  box-shadow: 0 1px 0 transparent;
}

.live .top.home:not(.scrolled) .links a:not(:hover),
.live .top.home:not(.scrolled) .soon {
  color: var(--on-field-quiet);
}

.live .top.home:not(.scrolled) .soon {
  border-color: var(--rim);
}

.top-in {
  max-width: var(--wide);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.links {
  display: flex;
  gap: 24px;
  font-size: 14px;
  line-height: 20px;
}

.links a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--press) var(--ease);
}

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

/* The link to where the visitor is, or to the shelf the page stands on, is as bright as the name. */
.links a[aria-current='page'] {
  color: var(--text);
}

.soon {
  font-size: 14px;
  line-height: 20px;
  color: var(--secondary);
}

/* In the bar it is set in a frame of its own, as a thing that is so rather than a thing to press. */
.top .soon {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}

.name {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.mark svg,
.brand-mark svg,
.note-mark svg {
  display: block;
  overflow: visible;
}

/* ---- The first screen: the first words on the field, and under them the product. ---- */

/*
  The first screen is the store's film made into a page: the field, moving,
  with the whistle and the one line on it, and the product itself under them,
  the web app in a browser with the phone app standing in front of it. The
  owner chose it from three shown live ("B"), and with it that the field opens
  and closes the page and is not under all of it ("2"), as long as it is
  seamless.

  So the field has no bottom edge. It is painted on a canvas as wide as the
  screen (src/hero.ts) that reaches down to where the product stands, and its
  lower half is let go a little at a time, until what is left is the page's
  own graphite. The web app stands across that, its top on the field and its
  foot on the plain page, which is what makes the two one surface.
*/
.hero {
  position: relative;
  isolation: isolate;
  max-width: var(--wide);
  margin: 0 auto;
  /* How far down the first words begin: under the top bar, with less room above them on a short screen, so the product is on it too. */
  --above: calc(var(--top) + clamp(24px, calc(var(--screen) * 0.07), 76px));
  padding: var(--above) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--on-field);
}

/*
  Before the script has painted it, and for a visitor whose browser runs none,
  the canvas is the field's ground alone. The fade is long and has many steps,
  each a little more than the last, so the eye finds no line where it begins
  or ends.
*/
.hero-field {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: 100vw;
  height: min(100%, calc(var(--screen) * 1.32));
  transform: translateX(-50%);
  background: var(--field-ground);
  pointer-events: none;
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 44%,
    rgba(0, 0, 0, 0.97) 50%,
    rgba(0, 0, 0, 0.9) 56%,
    rgba(0, 0, 0, 0.79) 62%,
    rgba(0, 0, 0, 0.65) 68%,
    rgba(0, 0, 0, 0.5) 74%,
    rgba(0, 0, 0, 0.35) 80%,
    rgba(0, 0, 0, 0.21) 86%,
    rgba(0, 0, 0, 0.1) 92%,
    rgba(0, 0, 0, 0.03) 97%,
    transparent 100%
  );
}

/*
  The field at the foot of the page: a picture drawn by the build
  (src/field.ts), as wide as the screen whatever the page's own width, and
  laid behind the small print. It fades out inside itself, so it has no edge
  to hide here.
*/
.foot {
  position: relative;
  isolation: isolate;
}

.foot::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-repeat: no-repeat;
  /* Stretched to fill its room exactly, so that its fade ends where the room does, on a screen of any shape. */
  background-size: 100% 100%;
  pointer-events: none;
  /* It reaches up past the foot's own top, where it has all but faded, so the lines seem to come from under the page. */
  bottom: 0;
  height: calc(100% + 120px);
  background-image: url('/field-foot.svg');
}

/*
  On the running first page the foot is the same weave as the top: the field
  itself, moving, on a canvas of its own, in place of the picture. It comes in
  as the top went out, a little at a time from nothing, so the page's graphite
  becomes the field with no line between them. It is faint behind the small
  print and whole in the strip under it.
*/
.foot-field {
  display: none;
  position: absolute;
  z-index: -1;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: calc(100% + 200px);
  transform: translateX(-50%);
  pointer-events: none;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.03) 8%,
    rgba(0, 0, 0, 0.08) 17%,
    rgba(0, 0, 0, 0.15) 27%,
    rgba(0, 0, 0, 0.23) 37%,
    rgba(0, 0, 0, 0.32) 47%,
    rgba(0, 0, 0, 0.44) 57%,
    rgba(0, 0, 0, 0.58) 67%,
    rgba(0, 0, 0, 0.72) 77%,
    rgba(0, 0, 0, 0.86) 87%,
    rgba(0, 0, 0, 0.96) 95%,
    #000 100%
  );
}

.live .foot-field {
  display: block;
}

.live .foot:has(.foot-field)::before {
  display: none;
}

/* Over the field the small print is in the field's own quiet tone, as the first words are. */
.live .foot:has(.foot-field) .soon,
.live .foot:has(.foot-field) .foot-small {
  color: var(--on-field-quiet);
}

/*
  The board is the product as a diagram: charts on one side, the whistle in
  the middle, the alerts on the other, and a wire from each chart through the
  whistle to the alerts. The wires are drawn by the script, behind everything
  else, from where these rules have put things.
*/
.board {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 280px;
  margin-top: clamp(24px, calc(var(--screen) * 0.06), 56px);
  display: grid;
  grid-template-columns: minmax(0, 3fr) 224px minmax(0, 2fr);
  align-items: center;
}

.wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.wire,
.wire-lit,
.wire-light {
  fill: none;
  stroke-width: 1;
}

.wire {
  stroke: var(--wire);
}

/* Where a wire leaves a chart and where the last one reaches the alerts: a small open point, as on a diagram. */
.port {
  fill: var(--page);
  stroke: var(--wire);
  stroke-width: 1;
}

/* A wire a light has just run along stays lit for a moment, then lets go slowly. */
.wire-lit {
  stroke: transparent;
  transition: stroke var(--enter) var(--ease);
}

.wire-lit.on {
  transition-duration: 0s;
}

.wire-lit.on.buy {
  stroke: var(--positive);
}

.wire-lit.on.sell {
  stroke: var(--negative);
}

/* The light itself: a short bright stroke that the script sends from one end of a wire to the other. */
.wire-light {
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
}

.wire-light.buy {
  stroke: var(--positive);
}

.wire-light.sell {
  stroke: var(--negative);
}

/* The spine runs between the two rows of charts, so the rows stand apart by its room. */
.wall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 16px;
}

.tile {
  --surface: var(--page);
  position: relative;
  min-width: 0;
  height: clamp(96px, calc(var(--screen) * 0.17), 152px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition:
    border-color var(--enter) var(--ease),
    background-color var(--enter) var(--ease);
}

/*
  A frame lights in the colour of what was said: at once, and then it lets go
  slowly. A chart's frame when its alert happens, the whistle's as the light
  reaches it, and the story's panel when its alert is told.
*/
.tile.lit,
.hub.lit,
.stage.lit {
  transition-duration: var(--press);
}

.tile.lit {
  --surface: var(--card);
}

.tile.lit.buy,
.hub.lit.buy,
.stage.lit {
  border-color: var(--positive);
}

.tile.lit.sell,
.hub.lit.sell {
  border-color: var(--negative);
}

.hub {
  position: relative;
  justify-self: center;
  width: 144px;
  height: 144px;
  display: grid;
  place-items: center;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: border-color var(--enter) var(--ease);
}

.hub .mark {
  width: 104px;
  height: 104px;
}

/*
  The same sound as in the story's panel (see `.stage` below), in the ring
  round the whistle. Each time an alert reaches the whistle and its ring
  lights, two rings of the field's lines leave the middle, cross to the edge
  and are gone. Nothing shows in the ring between alerts.

  `--blow` is how far the first of the two has got, as a share of the way to
  the edge, so the same rule serves the ring at every size it has. It is over
  before the ring's light is let go (`LIT_FOR` in src/wall.ts), since that is
  what ends it. Quiet, as in the panel. The lines stay the whistle's green when
  the alert is a sell: they are its sound, and the frame says which it was.
*/
@property --blow {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}

.hub {
  isolation: isolate;
}

.hub::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 50%;
  background: url('/field-hub.svg') center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
  mask-image:
    radial-gradient(circle closest-side, transparent calc(var(--blow) - 44%), #000 calc(var(--blow) - 26%), #000 calc(var(--blow) - 12%), transparent var(--blow)),
    radial-gradient(circle closest-side, transparent calc(var(--blow) - 104%), #000 calc(var(--blow) - 90%), #000 calc(var(--blow) - 80%), transparent calc(var(--blow) - 70%));
}

.hub.lit::before {
  animation: blow 1300ms cubic-bezier(0.3, 0.5, 0.6, 1) both;
}

@keyframes blow {
  0% {
    --blow: 30%;
    opacity: 0.6;
  }

  80% {
    opacity: 0.6;
  }

  100% {
    --blow: 205%;
    opacity: 0;
  }
}

.tile-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 12px 0;
  font-size: 12px;
  line-height: 16px;
}

.sym,
.pct {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.tile-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}

.pct.up,
.said.buy,
.up {
  color: var(--positive);
}

.pct.down,
.said.sell,
.down {
  color: var(--negative);
}

.plot {
  position: relative;
  flex: 1;
  min-height: 0;
}

.plot > svg,
.chart > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The lines are drawn in a box that is stretched to fit, and keep their thickness as it is. */
.price,
.rule {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.price {
  stroke: var(--text);
}

.rule {
  stroke: var(--accent);
}

/* The newest price. */
.head {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--text);
}

/*
  The app's signature: a filled dot where a rule said buy and an open dot where
  it said sell. The ring round it is the surface it sits on, so the line stops
  short of the dot rather than running through it.
*/
.dot {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface, var(--page));
}

.dot.buy {
  background: var(--positive);
}

.dot.sell {
  background: var(--surface, var(--page));
  border: 2px solid var(--negative);
}

.dot.large {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  box-shadow: 0 0 0 3px var(--surface, var(--page));
}

/* What a screen is doing, said at its head. When it changes, the new words come up into place rather than swap. */
.doing {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrives {
  animation: arrives var(--shift) var(--ease);
}

@keyframes arrives {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.pitch {
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* The whistle over the first words, as it is at the top of every screen of the app. */
.pitch-mark {
  width: clamp(64px, 6.4vw, 92px);
  height: clamp(64px, 6.4vw, 92px);
  margin-bottom: 4px;
}

/* A page's first words. Sized by the screen's height as well as its width. */
h1 {
  font-size: clamp(40px, min(5.6vw, calc(var(--screen) * 0.1)), 80px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 500;
  text-wrap: balance;
}

/* One line where there is room for it, and two even ones where there is not. */
.lede {
  margin: 20px auto 0;
  max-width: 46em;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 28px;
  color: var(--secondary);
  text-wrap: balance;
}

/* On the first screen the headline is one line where there is room, a little smaller, so the screen holds the product under it. */
.pitch h1 {
  font-size: clamp(36px, min(4.5vw, calc(var(--screen) * 0.082)), 68px);
  line-height: 1.04;
}

/* What it does is said plainly and how soon is said quietly, as on the store's pictures. */
.pitch h1 span {
  color: var(--on-field-quiet);
}

.pitch .lede {
  margin-top: 18px;
  max-width: 41em;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.5;
  color: var(--on-field-quiet);
}

/* The one thing to press, and beside it what is so. */
.pitch-go {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  font-size: 14px;
  line-height: 20px;
  color: var(--on-field-quiet);
}

/* Off-white, as the app's own main button is. It answers a pointer with its colour, and does not move. */
.act {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: #e9ecea;
  color: #0b1410;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--press) var(--ease);
}

.act:hover {
  background: #fff;
}

.act:active {
  background: #d5d9d6;
}

/*
  The product under the first words: the web app in a browser, and the phone
  app in front of its left side. Both are photographs of the real thing. A
  frame is what the store's pictures put round a screen: nearly black, with a
  hairline of the field's own green.
*/
.showcase {
  position: relative;
  width: min(100%, 1180px);
  margin-top: clamp(32px, calc(var(--screen) * 0.065), 68px);
  padding-left: 14.5%;
}

.frame {
  background: var(--frame);
  box-shadow: 0 0 0 1px var(--rim);
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
}

.window {
  padding: 6px;
  border-radius: 16px;
}

.window img {
  border-radius: 11px;
}

/*
  A phone, with the app's screen in it. Its shape is the screen's own with a
  rim round it, and everything in it is a share of that, so it is a phone at
  any size. It is not called a phone here: that name is the stories' panel.
*/
.handset {
  position: relative;
  aspect-ratio: 635 / 1343;
  border-radius: 15.5% / 7.3%;
}

.frame.handset img {
  position: absolute;
  top: 1.2%;
  left: 2.52%;
  width: 94.96%;
  height: 97.6%;
  border-radius: 13.8% / 6.4%;
}

/* The island, which the screen's own picture leaves room for at its top. */
.handset::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 2.3%;
  left: 34.5%;
  width: 31%;
  height: 3.4%;
  border-radius: 999px;
  background: #000;
}

.showcase .handset {
  position: absolute;
  top: -5.5%;
  left: 0;
  width: 21.5%;
}

.feed {
  position: relative;
  min-width: 0;
}

/* ---- A list, as the app draws one: a quiet heading row, then one line to a row. ---- */

.list {
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.list-head,
.row,
.reading {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.list-head {
  height: var(--row);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}

.row,
.reading {
  height: var(--row);
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  line-height: 20px;
}

.row > span,
.reading > span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.feed .list-head,
.row {
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 44px;
}

/* Four rows show. The list keeps a few more below, out of sight, so a row leaves without a jump. */
.rows {
  height: calc(4 * var(--row));
  overflow: hidden;
}

.rows-in {
  transition: transform var(--shift) var(--ease);
}

/* A new row has just been put on top: the list starts one row up, with no easing, and is let down. */
.rows-in.jumped {
  transform: translateY(calc(-1 * var(--row)));
  transition: none;
}

.when {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.what {
  color: var(--secondary);
}

.said {
  font-weight: 500;
}

/* A row that has only just come in is lit, and settles. */
.row.fresh {
  animation: fresh 1600ms var(--ease);
}

@keyframes fresh {
  from {
    background-color: var(--raised);
  }

  to {
    background-color: transparent;
  }
}

/* Said over the two stories: they are told on made-up prices. */
.demo {
  max-width: var(--wide);
  margin: 88px auto 0;
  padding: 0 var(--gutter);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  text-align: center;
}

/* ---- A story: its texts on one side and its panel on the other. ---- */

.scene {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 64px var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  align-items: start;
}

/* A story's texts, and over them its row of marks. */
.tell {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.says {
  display: grid;
  gap: 48px;
}

/*
  One mark for each stretch of a story. Each fills as its stretch is scrolled
  through, so it is plain that the scroll moves the story on and how much of it
  is left. They are only shown on the running page, which is the one that fills them.
*/
.ticks {
  display: none;
}

.tick {
  width: 32px;
  height: 2px;
  overflow: hidden;
  background: var(--wire);
  border-radius: 1px;
}

.tick-fill {
  display: block;
  height: 100%;
  background: var(--text);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.say h2,
.wont h2,
.watch h2,
.where h2 {
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 500;
  text-wrap: balance;
}

.say p {
  margin-top: 16px;
  max-width: 28em;
  font-size: 17px;
  line-height: 28px;
  color: var(--secondary);
  text-wrap: pretty;
}

/*
  A story's panel is the app's screen on a phone, since both stories are
  things done in the app. The owner chose this from three shown live, the
  other two being a wide panel with the chart handed to it and the panel as it
  was: asked "should we mockup an iphone in most of these screens", and then
  "A".

  `.phone` is the outline and `.stage` the screen in it. On a wide screen the
  phone is drawn at one size (`--tall` is its height, for the script) and made
  smaller as a whole where the screen is too short for it (`--fit`, from the
  script), so what is in it keeps its proportions. On a narrow screen there
  is no outline: a phone drawn on a phone would leave its screen too small to
  read, so the panel is the screen and fills the width. A screen that is wide
  but very short, such as a phone held on its side, has no outline either, for
  the same reason. What the panel does there is further down, under "A story
  on a phone".
*/
.phone {
  --tall: 0;
  min-width: 0;
}

.stage {
  --surface: var(--page);
  min-width: 0;
  height: 560px;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color var(--enter) var(--ease);
}

/* The top of the app's screen: its small whistle, which moves with what the app is doing. */
.app-top {
  flex: none;
  height: 40px;
  display: grid;
  place-items: end center;
}

.app-top .mark {
  display: block;
  width: 28px;
  height: 28px;
}

.island {
  display: none;
}

@media (min-width: 720px) and (min-height: 600px) {
  .phone {
    --tall: 700;
    justify-self: center;
    width: 340px;
    height: 700px;
    padding: 8px;
    background: #0b0b0c;
    border: 1px solid var(--wire);
    border-radius: 50px;
    zoom: var(--fit, 1);
  }

  .stage {
    height: 100%;
    padding: 0 16px 20px;
    border-radius: 42px;
  }

  /* Under the island. */
  .app-top {
    height: 84px;
    padding-bottom: 6px;
  }

  .app-top .mark {
    width: 30px;
    height: 30px;
  }

  .island {
    display: block;
    position: absolute;
    z-index: 6;
    top: 11px;
    left: 50%;
    width: 92px;
    height: 26px;
    margin-left: -46px;
    border-radius: 13px;
    background: #000;
  }
}

/*
  The sound of the whistle. When a panel's alert is told, the field's lines
  run out through the panel from the whistle on the alert, in two rings, and
  are gone. There are no lines in a panel before that or after it, so they
  mean one thing: it has just whistled. The lines are a picture drawn by the
  build (src/field.ts) and laid behind everything in the panel. What shows of
  it is only what the two rings leave, and `--ring` is how far they have got.
  The script says where the whistle is (`--sound-x`, `--sound-y`), as shares
  of the screen, since the alert sits where the screen's size puts it.

  They are quiet, at six parts in ten, which is the strength the owner chose.
  A visitor who has asked for less motion is shown none of it: the rule at the
  end of this file ends every movement at once, and this one ends on nothing.
*/
@property --ring {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

.stage {
  position: relative;
  isolation: isolate;
}

.stage::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: url('/field-box.svg') center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
  --from: var(--sound-x, 14%) var(--sound-y, 14%);
  mask-image:
    radial-gradient(circle at var(--from), transparent calc(var(--ring) - 170px), #000 calc(var(--ring) - 90px), #000 calc(var(--ring) - 30px), transparent var(--ring)),
    radial-gradient(circle at var(--from), transparent calc(var(--ring) - 430px), #000 calc(var(--ring) - 360px), #000 calc(var(--ring) - 310px), transparent calc(var(--ring) - 280px));
}

.stage.lit::before {
  animation: sound 3000ms cubic-bezier(0.3, 0.45, 0.45, 1) both;
}

@keyframes sound {
  0% {
    --ring: 0px;
    opacity: 0.6;
  }

  70% {
    opacity: 0.6;
  }

  100% {
    --ring: 1040px;
    opacity: 0;
  }
}

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
}

/*
  The field an alert is written in. What is still to be typed is there but
  unseen, so the field never changes size.

  Its edge is the edge of the box an alert is written in on the phone
  (BoxEdge in the app): a hairline at rest, lighter while it is typed in, and
  lit while the AI reads the words. Lit, the edge turns the whistle's green
  and two thick, a point of it outside the box and a point inside, and a band
  of light crosses it from left to right, again and again. There is no glow
  round the box. When the words are read the green fades, the band still
  going (the script keeps it for that long), and the hairline is back.

  The measures are the app's own (boxLight.ts there): how green, how wide the
  band, how long a crossing and the wait after it. A test holds these to
  those. A visitor who has asked for less motion gets the green edge and
  nothing that moves.
*/
.field {
  position: relative;
  padding: 8px 12px;
  background: var(--raised);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: 16px;
  line-height: 24px;
  transition: box-shadow var(--shift) var(--ease);
}

.field.writing {
  box-shadow: inset 0 0 0 1px var(--focus);
}

.field.working {
  box-shadow: inset 0 0 0 1px transparent;
}

/*
  The lit edge: a ring two thick, cut out of a sheet of the green with the band
  lying on it. The picture of a chart has the same edge while the AI reads it,
  as the app's box has for a picture as for words.
*/
.field,
.shot {
  --edge-green: #1eb482;
  --edge-light: #5fe0b1;
}

.field::before,
.shot::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 2px;
  border-radius: 11px;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(30 180 130 / 0), rgb(30 180 130 / 0.7) 45%, var(--edge-light) 72%, rgb(95 224 177 / 0)) -93.7% 0 / 46% 100% no-repeat,
    rgb(30 180 130 / 0.4);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  transition: opacity var(--shift) var(--ease);
}

.field.working::before,
.stage.reads .shot::before {
  opacity: 1;
}

.field.working::before,
.field.fading::before,
.stage.reads .shot::before {
  animation: swipe 1467ms linear infinite;
}

/*
  The band starts out of sight on the left and ends out of sight on the right.
  Its place is counted the way a background's is, as a share of the room left
  beside it, which is why neither end is a round number.
*/
@keyframes swipe {
  0% {
    background-position:
      -93.7% 0,
      0 0;
    animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1);
  }

  78%,
  100% {
    background-position:
      195.9% 0,
      0 0;
  }
}

.untyped {
  visibility: hidden;
}

.caret {
  display: none;
  width: 2px;
  height: 20px;
  margin: 0 -1px;
  vertical-align: -4px;
  border-radius: 1px;
  background: var(--accent);
}

.field.writing .caret {
  display: inline-block;
}

/* What the AI made of the sentence. The labels wait there, and each answer arrives as it is found. */
.part {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 30px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  line-height: 18px;
}

.part:first-child {
  border-top: 0;
}

.part dt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/*
  The rule and the chart under it. They are two things in the screen's column,
  and this wrapper is not there at all, except on a panel too short to hold
  both, where it is the one place they take in turn (see "A story on a phone").
*/
.under {
  display: contents;
}

.chart {
  position: relative;
  flex: 1;
  min-height: 120px;
}

.grid line {
  stroke: var(--hairline);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart .price,
.chart .rule {
  stroke-width: 2;
}

.chart .head {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  box-shadow: 0 0 0 2px var(--surface, var(--page));
}

/*
  What the rule did in the year before: how many times it was met. It stands in
  the room over the chart's lines, which the script keeps clear for it however
  short the chart is. The figure is the app's own: its amber, in its mono, the
  largest thing on the chart. Each of those times has a dot on the price, the
  same dot the wall has where a rule said buy.
*/
.tested {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
  white-space: nowrap;
}

.tested b {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 400;
  line-height: 32px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* The alert as a phone shows it: a banner that comes down from the top of the screen, over the top of the app. */
.note {
  position: absolute;
  z-index: 5;
  top: 8px;
  left: 8px;
  right: 8px;
  padding: 10px 14px 10px 10px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  background: var(--raised);
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--hairline);
  font-size: 13px;
  line-height: 18px;
}

@media (min-width: 720px) and (min-height: 600px) {
  .note {
    top: 48px;
  }
}

.note-mark {
  grid-row: 1 / 4;
  width: 32px;
  height: 32px;
  align-self: center;
}

.note-top {
  display: flex;
  justify-content: space-between;
  color: var(--secondary);
  font-size: 12px;
  line-height: 16px;
}

.note-top b {
  font-weight: 400;
}

.note-title {
  font-weight: 500;
}

.note-text {
  color: var(--secondary);
}

.legend {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}

.key {
  width: 12px;
  height: 2px;
  margin-right: 8px;
  border-radius: 1px;
  background: var(--text);
}

.key.rule {
  margin-left: 16px;
  background: var(--accent);
}

/* ---- The second story's panel: a picture of a chart, and what was read from it. ---- */

/*
  The room the picture takes on the screen. Before a picture is handed over,
  the app's button that asks for one is there.
*/
.shot-room {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
}

.ask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.ask span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: 14px;
  line-height: 20px;
}

/* A small sign for a picture, drawn in the styles. */
.ask i {
  width: 14px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

/*
  The picture is someone else's chart, so it looks like it: light, in the
  system's own font, nothing of ours. That is what sets it apart as a picture.
*/
.shot {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 20px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f1f1ee;
  border-radius: 10px;
  color: #1c1c1e;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  line-height: 16px;
}

.shot-top {
  display: flex;
  gap: 12px;
}

.shot-top b {
  font-weight: 600;
}

.shot-top span,
.shot-axis {
  color: #6a6a70;
}

/* The candles fill the room the screen leaves the picture. */
.shot svg {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.shot .up {
  fill: #1f9d63;
  stroke: #1f9d63;
}

.shot .down {
  fill: #d9423f;
  stroke: #d9423f;
}

.shot line {
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.shot-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

/* Something the AI found on the picture: an amber box round it, and what it is. `--in` is how far it is marked. */
.find {
  position: relative;
  border-radius: 2px;
  outline: 2px solid color-mix(in srgb, var(--accent) calc(var(--in, 1) * 100%), transparent);
  outline-offset: 4px;
}

.find::after {
  content: attr(data-tag);
  position: absolute;
  left: -6px;
  bottom: calc(100% + 6px);
  padding: 0 4px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--page);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: var(--in, 1);
}

/* The signals lie over the lower part of the picture, on the screen's own ground. `--lift` is how far up they have come. */
.readout {
  position: absolute;
  z-index: 3;
  inset: auto 0 0;
  padding: 12px 8px 16px;
  background: var(--page);
  box-shadow: 0 -1px 0 var(--hairline);
}

.readout .list-head,
.readout .reading {
  gap: 8px;
  padding: 0 8px;
}

/*
  The phone's own photos, when a picture is to be chosen: a sheet that comes
  up from the bottom of the screen, with the chart among other pictures. It
  stops a little under the line that says what the screen is doing, so that
  line is still read above it. Only the moving page has it. On the finished
  page the picture is already handed over.
*/
.photos {
  display: none;
  position: absolute;
  z-index: 4;
  inset: 76px 0 0;
  padding: 14px 12px;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -1px 0 var(--hairline);
}

@media (min-width: 720px) and (min-height: 600px) {
  .photos {
    top: 120px;
  }
}

.photos-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 15px;
  line-height: 20px;
}

.photos-top b {
  font-weight: 500;
}

.photos-top span {
  font-size: 12px;
  color: var(--muted);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  overflow: hidden;
  border-radius: 10px;
}

/* One picture among the photos: the chart again, turned round, cut closer or on a dark ground, so they are nine different charts. */
.thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  display: block;
  background: #f1f1ee;
}

.thumb svg {
  position: absolute;
  inset: 14% 8%;
  width: 84%;
  height: 72%;
}

.thumb.dark {
  background: #101114;
}

.thumb.turned svg {
  transform: scaleX(-1);
}

.thumb.close svg {
  inset: -10% -40% 10% 8%;
  width: 132%;
  height: 100%;
}

.thumb .up {
  fill: #1f9d63;
  stroke: #1f9d63;
}

.thumb .down {
  fill: #d9423f;
  stroke: #d9423f;
}

.thumb line {
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* As the finger comes down on the one that is chosen, the others fall back and it is pressed in a little. */
.thumb {
  opacity: calc(1 - 0.6 * var(--tapped, 0));
}

.thumb.chosen {
  opacity: 1;
  transform: scale(calc(1 - 0.05 * var(--tapped, 0)));
}

/*
  The signals are a framed list like the alerts on the board, and keep its room
  at the sides. The columns are sized to their widest words, so none is cut short.
*/
.readout .list-head,
.reading {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.3fr) minmax(0, 1fr);
}

.reading {
  height: var(--row);
}

.reading .now {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.reading .reads {
  color: var(--secondary);
}

.reading .reads.up {
  color: var(--positive);
}

.reading .reads.down {
  color: var(--negative);
}

/* ---- What it will not do: three plain rows. ---- */

/*
  The board as a section: what it is, said on the left as every section's
  heading is, and the board under it at the page's width. It opened the page
  once, where it took what was left of the first screen. Here it has a height
  of its own.
*/
.watch {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 96px var(--gutter) 24px;
}

.watch-say p {
  margin-top: 16px;
  max-width: 30em;
  font-size: 17px;
  line-height: 28px;
  color: var(--secondary);
  text-wrap: pretty;
}

.watch .board {
  flex: none;
  margin-top: 56px;
}

.board-demo {
  margin-top: 28px;
  padding: 0;
}

/*
  Where it tells you: the phone app, the web app and an email, side by side,
  each as it really looks. They stand on one floor, and what each is stands
  on one line under them, however tall the thing above it is.
*/
.where {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 96px var(--gutter) 24px;
  display: grid;
  gap: 56px;
}

.where-say p {
  margin-top: 16px;
  max-width: 30em;
  font-size: 17px;
  line-height: 28px;
  color: var(--secondary);
  text-wrap: pretty;
}

.places {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 3fr) minmax(0, 1.5fr);
  grid-template-rows: auto auto;
  gap: 20px 48px;
}

.place {
  grid-row: span 2;
  display: grid;
  grid-template-rows: subgrid;
}

/* On the plain page a frame is the page's own: a step darker, with the page's hairline. */
.where .frame {
  align-self: end;
  background: #0d0d0e;
  box-shadow: 0 0 0 1px rgba(237, 237, 237, 0.12);
}

.place figcaption {
  display: grid;
  gap: 4px;
  align-content: start;
  font-size: 14px;
  line-height: 20px;
  color: var(--secondary);
  text-wrap: pretty;
}

.place figcaption b {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--text);
}

/* The email, in the words the server writes. */
.mail {
  padding: 20px;
  border-radius: 16px;
  display: grid;
  gap: 6px;
  font-size: 14px;
  line-height: 22px;
  color: var(--secondary);
}

.mail-from {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

.mail-from b {
  font-weight: 400;
  color: var(--secondary);
}

.mail-subject {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.wont {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 96px var(--gutter) 120px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px 64px;
  align-items: start;
}

.wont-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 4px 32px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
}

.wont-rows > div:first-child {
  padding-top: 8px;
  border-top: 0;
}

.wont-rows dt {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}

.wont-rows dd {
  font-size: 16px;
  line-height: 28px;
  color: var(--secondary);
}

/* ---- The foot of the page, on the same two columns as everything above it. ---- */

.foot {
  max-width: var(--wide);
  margin: 0 auto;
  /* More room under the small print than over it: that is where the field is at its strongest. */
  padding: 32px var(--gutter) 136px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px 64px;
  box-shadow: 0 -1px 0 var(--hairline);
}

.foot-name {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 4px;
}

.foot-name .soon {
  justify-self: start;
}

.foot-small {
  display: grid;
  gap: 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

.foot-small p {
  max-width: 44em;
}

.foot-links,
.foot-company {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.foot-links {
  color: var(--secondary);
}

/* ---- A page of words: privacy, terms. Its title stays beside the text as it is read. ---- */

.paper {
  max-width: var(--wide);
  min-height: var(--screen);
  margin: 0 auto;
  padding: calc(var(--top) + 64px) var(--gutter) 96px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px 64px;
  align-items: start;
  /* A page shorter than the screen keeps its parts together at the top, with the room left under them. */
  align-content: start;
}

.paper-head {
  position: sticky;
  top: calc(var(--top) + 64px);
}

.paper h1 {
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.paper-head p {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

.paper-body {
  display: grid;
  gap: 40px;
  max-width: 40em;
}

.paper-body h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}

.paper-body p {
  margin-top: 8px;
  font-size: 16px;
  line-height: 28px;
  color: var(--secondary);
  text-wrap: pretty;
}

.paper-body a {
  color: var(--text);
}

/*
  ---- A shelf: the page that lists the guides, or the comparisons. It is a
  page of words with a list where the words would be: one row to a post, and
  the whole row is the link. ----
*/

.paper-head .shelf-lede {
  max-width: 22em;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 28px;
  color: var(--secondary);
  text-wrap: pretty;
}

.shelf-body {
  display: grid;
  gap: 48px;
  min-width: 0;
  max-width: 44em;
}

.shelf {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.shelf-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: start;
  padding: 16px;
  text-decoration: none;
  transition: background-color var(--press) var(--ease);
}

.shelf-row + .shelf-row {
  border-top: 1px solid var(--hairline);
}

.shelf-row:hover {
  background: var(--card);
}

/* Inside its frame, where the frame does not cut it. */
.shelf-row:focus-visible {
  outline-offset: -2px;
  border-radius: 12px;
}

/* When it was written and how long it is are figures, set as the app sets figures, on the line of the title. */
.shelf-when,
.shelf-long {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 24px;
  color: var(--muted);
  white-space: nowrap;
}

.shelf-what {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.shelf-what b {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.shelf-what span {
  font-size: 14px;
  line-height: 20px;
  color: var(--secondary);
  text-wrap: pretty;
}

.shelf-other h2,
.post-more h2 {
  margin-bottom: 16px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}

.shelf-empty {
  color: var(--secondary);
}

/*
  ---- A post: a guide or a comparison. It stands on the same two columns as
  every other page. Beside it, staying put as it is read, the way back and
  what is on the page. Its title and its words share one left edge. ----
*/

.post {
  max-width: var(--wide);
  min-height: var(--screen);
  margin: 0 auto;
  padding: calc(var(--top) + 64px) var(--gutter) 96px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px 64px;
  align-items: start;
  /* A short post on a tall screen keeps its parts together at the top, with the room left under them. */
  align-content: start;
}

.post-side {
  position: sticky;
  top: calc(var(--top) + 64px);
  max-width: 20em;
  display: grid;
  justify-items: start;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
}

.post-side a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--press) var(--ease);
}

.post-side a:hover {
  color: var(--text);
}

.post-side p {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

.post-side ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.post-main {
  min-width: 0;
  max-width: 44em;
}

.post h1 {
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.post-lede {
  margin-top: 16px;
  font-size: 18px;
  line-height: 28px;
  color: var(--secondary);
  text-wrap: pretty;
}

.post-meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

/* The words. Every size and gap is set here, since a post brings nothing but its text. */
.post-body {
  margin-top: 48px;
}

.post-body h2,
.post-body h3 {
  margin: 0;
  font-weight: 500;
  text-wrap: balance;
  /* A link to a heading stops with the heading clear of the top bar. */
  scroll-margin-top: calc(var(--top) + 24px);
}

.post-body h2 {
  margin-top: 48px;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.015em;
}

.post-body h3 {
  margin-top: 32px;
  font-size: 18px;
  line-height: 28px;
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body p,
.post-body li {
  font-size: 16px;
  line-height: 28px;
  color: var(--secondary);
  text-wrap: pretty;
}

.post-body p {
  margin-top: 16px;
}

.post-body h2 + p,
.post-body h3 + p {
  margin-top: 8px;
}

.post-body strong {
  font-weight: 500;
  color: var(--text);
}

.post-body a {
  color: var(--text);
}

.post-body ul,
.post-body ol {
  margin: 16px 0 0;
  padding: 0 0 0 20px;
  display: grid;
  gap: 8px;
}

.post-body li::marker {
  color: var(--muted);
}

.post-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--raised);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
}

/*
  A sentence as it is typed to Whistle AI: in the box the app has for it, with
  the mark that shows where the typing has got to. It does not blink. Nobody
  is typing here.
*/
.post-body blockquote {
  margin: 24px 0 0;
  padding: 12px 16px;
  background: var(--raised);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.post-body blockquote + blockquote {
  margin-top: 8px;
}

.post-body blockquote p {
  margin: 0;
  line-height: 24px;
  color: var(--text);
}

.post-body blockquote p::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 20px;
  margin-left: 2px;
  vertical-align: -4px;
  border-radius: 1px;
  background: var(--accent);
}

.post-body blockquote + p {
  margin-top: 24px;
}

/* A table, in a frame as every list on the site is. On a screen too narrow for it, it is moved sideways inside its frame. */
.post-body .table {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
}

.post-body .table + p {
  margin-top: 24px;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

.post-body th,
.post-body td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

.post-body thead th {
  padding-top: 8px;
  padding-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.post-body tbody th,
.post-body tbody td {
  border-top: 1px solid var(--hairline);
}

.post-body tbody th {
  width: 26%;
  font-weight: 500;
  color: var(--text);
}

.post-body tbody td {
  color: var(--secondary);
}

/* Under a comparison: the pages its facts were read on. Smaller than the words above it, and set apart from them by room alone. */
.post-sources {
  margin-top: 64px;
}

.post-body .post-sources h2 {
  margin-top: 0;
  font-size: 20px;
  line-height: 28px;
}

.post-body .post-sources p,
.post-body .post-sources li {
  font-size: 14px;
  line-height: 24px;
}

.post-body .post-sources ul {
  padding: 0;
  list-style: none;
  gap: 4px;
}

.post-body .post-sources a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--secondary);
  overflow-wrap: anywhere;
  transition: color var(--press) var(--ease);
}

.post-body .post-sources a:hover {
  color: var(--text);
}

/* After the last words: the whistle, what it does, and the way to the first page. */
.post-end {
  margin-top: 64px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.post-end-mark {
  width: 40px;
  height: 40px;
}

.post-end-mark svg {
  display: block;
  overflow: visible;
}

.post-end p {
  text-wrap: balance;
}

.post-end a {
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.post-more {
  margin-top: 64px;
}

/* ---- The moving page. From here on, only once the script is running. ---- */

/*
  A story is as tall as the screen plus the scroll it takes to tell it. Its
  scene stays under the top bar for that whole stretch, then leaves with the
  page. `--length` is how much scroll each story is given. Two screens tell
  the second and two and a half the first, which has five things to tell: a
  stretch of it is as long as it was when it had four in two screens. That is
  enough that nothing is rushed past, and less than they had when they felt
  slow. How it is shared out among what a story does is in `story.ts`.
*/
.live .story {
  height: calc(var(--screen) - var(--top) + var(--length));
}

.live #story {
  --length: calc(2.5 * var(--screen));
}

.live #scan {
  --length: calc(1.8 * var(--screen));
}

.live .scene {
  position: sticky;
  top: var(--top);
  height: calc(var(--screen) - var(--top));
  padding-block: 24px 32px;
  align-items: center;
}

.live .ticks {
  display: flex;
  gap: 8px;
}

/* The texts take one place, and the script says which one belongs to this stretch. */
.live .says {
  gap: 0;
}

.live .say {
  grid-area: 1 / 1;
  align-self: center;
}

.live .say:not(.on) {
  pointer-events: none;
  user-select: none;
}

/*
  A text that is not up is not seen. One still to come waits a little below,
  and one already passed has gone a little above, so a text arrives from the
  way the visitor is scrolling and leaves the other way. It leaves quickly, and
  the next arrives once it has gone: its heading first, then the words under
  it. Two are never there to be read at once, and since this runs on its own
  time and not with the scroll, a text is never left half there.
*/
.live .say h2,
.live .say p {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--press) var(--ease),
    transform var(--shift) var(--ease);
}

.live .say.passed h2,
.live .say.passed p {
  transform: translateY(-24px);
}

.live .say.on h2,
.live .say.on p {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--shift) var(--ease) 80ms,
    transform 460ms var(--ease) 80ms;
}

.live .say.on p {
  transition-delay: 140ms;
}

.live .stage {
  height: 100%;
}

/*
  What comes in as the visitor scrolls. The script says how far in each thing
  is (`--in` and the like, from 0 to 1) and these draw it that far in. None of
  it is timed: it moves when the scroll does and rests when the scroll rests.
  Without the script the same things are simply there.
*/
.live .part dd,
.live .reading > span,
.live .tested {
  opacity: var(--in, 1);
  transform: translateY(calc((1 - var(--in, 1)) * 6px));
}

/* A time the rule was met lands on the price: it grows to its size as it comes in. */
.live .dot.past {
  opacity: var(--in, 1);
  transform: scale(calc(0.3 + 0.7 * var(--in, 1)));
}

/* The alert comes down from above the screen. */
.live .note {
  opacity: var(--in, 1);
  transform: translateY(calc((var(--in, 1) - 1) * (100% + 48px)));
}

/* The phone's photos come up, and go down again when one is chosen. */
.live .photos {
  display: flex;
  transform: translateY(calc((1 - var(--photos, 0)) * 102%));
}

/* The picture arrives in the app as the photos go, and the button that asked for it gives way. */
.live .shot {
  opacity: var(--shot, 1);
  transform: translateY(calc((1 - var(--shot, 1)) * 24px)) scale(calc(0.94 + 0.06 * var(--shot, 1)));
}

.live .ask {
  opacity: calc(1 - var(--shot, 1));
}

.live .readout {
  transform: translateY(calc((1 - var(--lift, 1)) * 100%));
}

/* ---- A narrower screen: less room between things, and no room for a stock's name beside its letters. ---- */

@media (max-width: 1199px) {
  .tile-name {
    visibility: hidden;
  }
}

@media (max-width: 1099px) {
  .board {
    grid-template-columns: minmax(0, 3fr) 184px minmax(0, 2fr);
  }

  .scene,
  .wont,
  .paper,
  .post,
  .foot {
    gap: 32px 40px;
  }
}

/*
  ---- Too narrow for the board to lie on its side. It is stacked: the charts
  in two columns, the whistle under them, the alerts under that. The spine runs
  down between the two columns, so they stand apart by its room. ----
*/

@media (max-width: 959px) {
  /* Four links and the frame beside them, with a little less room between, so the bar holds them all. */
  .top-in {
    gap: 20px;
  }

  .links {
    gap: 16px;
  }

  /* A post is one column: its words need the width. The way back stays above the title, and the list of what is on the page goes. */
  .post {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .post-side {
    position: static;
  }

  .post-side p,
  .post-side ol {
    display: none;
  }

  /* Three across no longer fits: the places stand one under another, each with what it is under it. */
  .places {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 44px;
  }

  .place {
    grid-row: auto;
    grid-template-rows: none;
    gap: 16px;
  }

  .place .handset {
    width: min(62%, 264px);
  }

  .place .mail {
    max-width: 420px;
  }

  .board {
    flex: none;
    min-height: 0;
    margin-top: 32px;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }

  .wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 32px;
  }

  .tile {
    height: clamp(60px, calc(var(--screen) * 0.095), 104px);
  }

  .hub {
    width: 88px;
    height: 88px;
  }

  .hub .mark {
    width: 64px;
    height: 64px;
  }
}

/* ---- A phone: one column, the panel above its text, as a graph sits above its list in the app. ---- */

@media (max-width: 719px) {
  :root {
    --gutter: 20px;
  }

  /* The bar keeps the name and when it comes. The page is short enough to scroll. */
  .links {
    display: none;
  }

  .hero {
    --above: calc(var(--top) + 20px);
  }

  .pitch h1 {
    font-size: clamp(36px, 10.6vw, 52px);
  }

  /*
    On a phone the phone app comes first and the web app stands behind it,
    running off the right edge: a browser's whole window is too small to read
    here, and its left side is the part that says what it is.
  */
  .showcase {
    width: calc(100% + 2 * var(--gutter));
    margin-inline: calc(-1 * var(--gutter));
    margin-top: 40px;
    padding-left: 0;
    overflow-x: clip;
  }

  .showcase .handset {
    position: relative;
    top: auto;
    left: auto;
    z-index: 1;
    width: 56%;
    margin-left: 7%;
  }

  .showcase .window {
    position: absolute;
    top: 7%;
    left: 36%;
    width: 168%;
    padding: 4px;
    border-radius: 12px;
  }

  .showcase .window img {
    border-radius: 8px;
  }

  /* The web app's left side, large enough to read, in a frame as wide as the page. */
  .where .window {
    overflow: hidden;
  }

  .where .window img {
    width: 178%;
    max-width: none;
  }

  /* The foot is tall here, and the field under it has a picture of its own for that. */
  .foot::before {
    background-image: url('/field-foot-narrow.svg');
  }

  h1 {
    font-size: 40px;
    line-height: 40px;
  }

  .pitch h1 {
    font-size: clamp(34px, 10.4vw, 44px);
    line-height: 1.06;
  }

  .lede,
  .pitch .lede {
    margin-top: 12px;
    font-size: 16px;
    line-height: 24px;
  }

  .board {
    margin-top: 24px;
    row-gap: 16px;
  }

  .tile-head {
    padding: 8px 8px 0;
  }

  .hub {
    width: 72px;
    height: 72px;
  }

  .hub .mark {
    width: 52px;
    height: 52px;
  }

  .rows {
    height: calc(2 * var(--row));
  }

  .list-head,
  .row {
    padding: 0 12px;
  }

  /* No room for the alert's name beside the stock's: when, which stock, and what it said. */
  .feed .list-head,
  .row {
    grid-template-columns: 64px minmax(0, 1fr) 44px;
  }

  .feed .list-head > :nth-child(3),
  .what {
    display: none;
  }

  .demo {
    margin-top: 56px;
  }

  .scene {
    padding: 40px var(--gutter);
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .say h2,
  .wont h2 {
    font-size: 28px;
    line-height: 32px;
  }

  .say p {
    margin-top: 8px;
    font-size: 16px;
    line-height: 24px;
  }

  /*
    The panel stays on top and the text changes under it. The text has the
    room its longest one needs and the panel has all the rest, so on a phone
    whose browser leaves little of the screen it is the panel that is short,
    and what is in it is laid out for that (see "A story on a phone").
  */
  .live .scene {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
  }

  .live .phone {
    grid-area: 1 / 1;
  }

  .live .tell {
    grid-area: 2 / 1;
    align-content: start;
    gap: 16px;
  }

  .live .say {
    align-self: start;
  }

  .wont {
    padding: 64px var(--gutter) 80px;
    grid-template-columns: minmax(0, 1fr);
  }

  .paper {
    padding: calc(var(--top) + 32px) var(--gutter) 64px;
    grid-template-columns: minmax(0, 1fr);
  }

  .paper-head {
    position: static;
  }

  .post {
    padding: calc(var(--top) + 32px) var(--gutter) 64px;
  }

  .post-lede {
    font-size: 17px;
  }

  .post-body {
    margin-top: 40px;
  }

  /* A row of a shelf: when and how long on one line, and what it is under them, as wide as the row. */
  .shelf-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .shelf-what {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .shelf-when,
  .shelf-long {
    grid-row: 1;
    line-height: 16px;
  }

  .shelf-long {
    grid-column: 2;
  }

  /*
    A table has no room to be one here. Each row is laid out as a short list:
    what the row is about, then each of its cells with the name of its column
    beside it. So nothing is cut by the frame, and nothing has to be moved
    sideways to be read.
  */
  .post-body .table {
    overflow-x: visible;
  }

  .post-body table,
  .post-body tbody,
  .post-body tbody tr,
  .post-body tbody th,
  .post-body tbody td {
    display: block;
  }

  .post-body thead {
    display: none;
  }

  .post-body tbody tr {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--hairline);
  }

  .post-body tbody tr:first-child {
    border-top: 0;
  }

  .post-body tbody th,
  .post-body tbody td {
    width: auto;
    padding: 0;
    border-top: 0;
  }

  .post-body tbody td {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
  }

  .post-body tbody td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 20px;
    color: var(--muted);
  }

  /* The whistle and what it does, and the link under them. */
  .post-end {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 16px;
  }

  .post-end a {
    grid-column: 2;
  }

  .wont-rows > div {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 0;
  }

  .wont-rows dt {
    font-size: 18px;
  }

  .wont-rows dd {
    line-height: 24px;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
  }
}

/*
  ---- A story on a phone: the panel is the screen, and it is as tall as the
  phone leaves it. ----

  A phone's browser keeps a good part of the screen for itself, so the panel
  can be short: on a small phone not much taller than the box an alert is
  written in and its chart together. Nothing in it is ever cut by its edge.
  The owner's words for when it was: "this is not mobile optimized, in the
  first view the graph goes below the thing that pops up that explains it".

  So the panel asks how tall it is (it is a container, and the questions
  below are put to it) and lays itself out for that:

  - The chart takes whatever is left under the rule, with no least height of
    its own, since a least height is what pushed it out under the panel's edge.
  - Where that would leave the chart too short to read, the rule and the chart
    take one place between them. The rule's parts are there while they are
    found, and then the chart comes in over them as the scroll goes on
    (`--swap`, from the script), since from there the story is about the price.
  - The phone's photos fill the sheet they come up in, so all nine are in
    sight and the chosen one is in the middle of them.
  - The list of signals has shorter rows, so the top of the picture they were
    read from is still seen above them.
  - On the very smallest, the small whistle at the top of the screen gives up
    its room too.

  The same holds for a screen that is wide and very short, such as a phone
  held on its side: the panel has no outline there and stands beside its text.
*/

@media (max-width: 719px), (max-height: 599px) {
  .stage {
    container: stage / size;
  }

  .chart {
    min-height: 0;
  }

  /* The alert keeps the same small room on every side: from the panel's edge above and beside it, and from the box under it. */
  .note {
    top: 4px;
    left: 4px;
    right: 4px;
  }

  /* The chart is too short here to keep a key clear of its lines, and the rule is named just above it. */
  .legend {
    display: none;
  }

  /* Three rows that share the sheet's height, and are never taller than they are wide. */
  .photos-grid {
    flex: 1 1 0;
    min-height: 0;
    max-height: calc(100cqw + 8px);
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .thumb {
    aspect-ratio: auto;
  }

  .live .scene {
    padding-block: 12px 16px;
  }

  /* The panel is as tall as the scene, whatever is beside or under it. */
  .live .phone {
    align-self: stretch;
    min-height: 0;
  }

  /*
    Short, and wide enough for two columns, as a phone on its side is: the
    text and the panel stand side by side, since one under the other would
    leave the panel no height at all. The panel keeps to a phone's width.
  */
  @media (min-width: 560px) and (max-height: 599px) {
    .live .scene {
      grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
      grid-template-rows: minmax(0, 1fr);
      gap: 32px;
    }

    .live .tell {
      grid-area: 1 / 1;
      align-content: center;
    }

    .live .phone {
      grid-area: 1 / 2;
      justify-self: center;
      width: 100%;
      max-width: 440px;
    }
  }

  /* Too short for the rule and a chart worth reading under it: they take one place. The measure is the room inside the panel. */
  @container stage (max-height: 357px) {
    .live .under {
      flex: 1 1 0;
      min-height: 0;
      display: grid;
    }

    .live .parts,
    .live .chart {
      grid-area: 1 / 1;
      min-height: 0;
    }

    /* The rule's three rows share the place evenly, up to a comfortable height each. */
    .live .parts {
      align-self: start;
      height: 100%;
      max-height: 132px;
      display: grid;
      grid-auto-rows: minmax(0, 1fr);
      opacity: calc(1 - var(--swap, 0));
      transform: translateY(calc(var(--swap, 0) * -12px));
    }

    .live .chart {
      opacity: var(--swap, 1);
      transform: translateY(calc((1 - var(--swap, 1)) * 12px));
    }

    /* The count is smaller where the chart is this short, so the lines under it keep most of the chart's height. */
    .tested {
      gap: 6px;
      font-size: 12px;
      line-height: 16px;
    }

    .tested b {
      font-size: 20px;
      line-height: 22px;
    }
  }

  /* Shorter rows for the signals on a short panel, so the picture's own top stays in sight above them. */
  @container stage (max-height: 330px) {
    .readout {
      --row: 26px;
      padding-block: 8px 12px;
    }
  }

  /* Shorter still, as on the smallest phones: the small whistle at the top of the screen gives its room to what is under it. */
  @container stage (max-height: 229px) {
    .app-top {
      display: none;
    }

    .stage-head {
      margin-top: 14px;
    }

    .photos {
      top: 38px;
    }
  }
}

/* ---- Less motion, for a visitor who has asked for it: nothing eases, nothing slides. ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation-duration: 0s !important;
  }
}
