/* Welcome (pages/welcome.js): the first run of a person Fluid Compute is there for, as the whole screen, in two
   sides. The shell is in the sign-in page's form (styles.css [data-signed-out]: no nav, the mark and the theme alone
   in the bar), and the screen is the sign-in card grown to its edges: the card's colour on the left, under the
   step, and the page's ground on the right, under the stage, with one hairline between them from the top of the
   window to its foot. The two sides share the bar's 1120px column, three parts to two, so the step is the wider
   and the mark stands over its title. Both hang from one line, placed with 44% of the window's free height above
   it: a step that is taller moves only its foot.

   The left side is the step in the sign-in card's language (pages/signin.css): its title in Funnel Display, a line
   or two, and the one thing to do: three rows to choose from, a line to copy in the dark bar the landing draws
   (styles.css .home-setup-line), or a pill of 48px. What keeps that line from starting a job (no payment method, a
   balance of nothing) stands under it with the ring a waiting thing wears, over the presses. Under it all, on the
   window's foot, who is signed in and the two ways out.

   The right side is the stage, in the console's own language (styles.css, the Flow language): a head over an ink
   rule, then a stretch between hairlines for each thing the gateway will say. What has not happened is a preview:
   quiet ink under "Next" or "Then" (the line to paste is in it until its step opens and the bar on the left holds it). What has happened is one line in full ink with a tick in Clusy's green, the one
   colour, and a job's line is its path as Runs draws it. A stretch that comes true folds its preview away; nothing
   else moves but the ring that turns while the page waits, and the path, which draws once. For a viewer who asked
   for less motion nothing moves and nothing is lost.

   Under 860px the two sides are one column: the step, then the stage as a band of the ground under it, short (the
   stretches still to come keep only their last line), with the foot at its end. Tokens from styles.css only; every
   rule is under .welcome, but the few that paint the two sides behind the page. */

:root:has(#content .welcome) {
  --w-step: var(--paper); --w-stage: var(--paper-2);
  --w-pad: max(24px, calc((100vw - 1120px) / 2));
  --w-edge: calc(var(--w-pad) + (100% - 2 * var(--w-pad)) * .6);
  --w-sides: linear-gradient(to right, var(--w-step) var(--w-edge), var(--rule) var(--w-edge) calc(var(--w-edge) + 1px), var(--w-stage) calc(var(--w-edge) + 1px));
}
/* Fluid's site: the step's side is the card's colour, the stage's the page's ground (styles.css, "a site with a look
   of its own") */
:root[data-site="fluid"]:has(#content .welcome) { --w-step: var(--raised); --w-stage: var(--ground); }
/* (where a scrollbar keeps its own strip at the window's right edge, the strip is the ground of the side it is on) */
:root:has(#content .welcome), :root:has(#content .welcome) body, :root:has(#content .welcome) .shell .topbar { background: var(--w-step); }
@media (min-width: 860px) {
  :root:has(#content .welcome) body, :root:has(#content .welcome) .shell .topbar { background: var(--w-sides); }
  :root:has(#content .welcome) { background: var(--w-stage); }
}
#content:has(.welcome) { padding: 0; }

.welcome {
  --go: #00ceae; --on-go: #06221d;
  --ring: 0 0 0 2px var(--w-step), 0 0 0 4px var(--ink);
  --top: max(28px, calc((100vh - var(--topbar-h) - 520px) * .44));
  --title: clamp(34px, 3.2vw, 46px);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto;
  min-height: calc(100vh - var(--topbar-h));
  padding-left: max(var(--w-pad), env(safe-area-inset-left)); padding-right: max(var(--w-pad), env(safe-area-inset-right));
}
@supports (height: 100svh) { .welcome { --top: max(28px, calc((100svh - var(--topbar-h) - 520px) * .44)); min-height: calc(100svh - var(--topbar-h)); } }
.welcome-card {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; min-width: 0;
  padding-top: var(--top);
  animation: welcome-in .3s cubic-bezier(.2, .8, .2, 1) backwards;
}
.welcome-card[hidden] { display: none; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(6px); } }

/* ---- the left side: the step */

.welcome-main { min-width: 0; padding-right: clamp(32px, 6vw, 96px); }
.welcome-body { max-width: 468px; }
.welcome-step { display: grid; grid-template-columns: minmax(0, 1fr); animation: welcome-step .32s cubic-bezier(.2, .8, .2, 1) backwards; }
.welcome-step[data-first] { animation: none; }
@keyframes welcome-step { from { opacity: 0; transform: translateY(8px); } }

.welcome-title {
  margin: 0; max-width: 11em; font-family: "Funnel Display", var(--font-sans); font-size: var(--title); line-height: 1.08;
  font-weight: 600; letter-spacing: -.028em; color: var(--ink); text-wrap: balance;
}
.welcome-title:focus { outline: none; }  /* given the keyboard when a step replaces what had it; never tabbed to */
.welcome-lead { margin: 18px 0 0; max-width: 42ch; font-size: 16px; line-height: 25px; letter-spacing: -.004em; color: var(--ink-2); text-wrap: pretty; }
.welcome-lead code { font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.welcome-lead a, .welcome-fact a { color: var(--ink); text-underline-offset: 3px; }

/* the ways: rows between hairlines, each pressed anywhere, its mark, its name over one line, an arrow that leans in.
   The row whose way the stage shows has its arrow in ink. */
.welcome-ways { display: grid; margin-top: 36px; border-top: 1px solid var(--rule-2); }
.welcome-way {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; column-gap: 16px;
  min-height: 84px; padding: 16px 8px 16px 4px; border: 0; border-bottom: 1px solid var(--rule-2); border-radius: 0;
  background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color .14s ease-out;
}
.welcome-way:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: var(--radius); }
.welcome-way:active { background: var(--select); transition-duration: 40ms; }
.welcome-way-mark { display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink); }
.welcome-way-mark .home-setup-agents { display: grid; grid-template-columns: repeat(2, 14px); gap: 6px; }
.welcome-way-mark .home-setup-agent { width: 14px; height: 14px; opacity: .86; }
.welcome-way-words { display: grid; gap: 3px; min-width: 0; }
.welcome-way-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -.012em; }
.welcome-way-sub { font-size: 14.5px; line-height: 21px; color: var(--ink-2); text-wrap: pretty; }
.welcome-way-go { display: grid; color: var(--ink-4); transition: transform .18s var(--ease-out), color .14s ease-out; }
.welcome-way[data-shown] .welcome-way-go { color: var(--ink); }
@media (hover: hover) {
  .welcome-way:hover { background: var(--wash); }
  .welcome-way:hover .welcome-way-go { color: var(--ink); transform: translateX(4px); }
}
.welcome-tag { padding: 1px 8px; border: 1px solid var(--rule-2); border-radius: var(--radius-cap); font-size: 11.5px; line-height: 16px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }

/* the line to copy: the dark bar, as wide as the step's column */
.welcome-bar { margin-top: 32px; container-type: inline-size; min-width: 0; }
/* under the first job's line, quietly: how a script of the person's own is run */
.welcome-mine { margin: 12px 0 0; font-size: 13.5px; line-height: 20px; color: var(--ink-3); text-wrap: pretty; }
.welcome-mine code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.welcome-mine q { color: var(--ink-2); quotes: "\201C" "\201D"; }
/* a console without the public install: the setup step every page gives */
.welcome-setup { display: grid; gap: 10px; margin-top: 18px; color: var(--ink-2); }

/* the presses: pills of 48px, the filled one the way on */
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.welcome .welcome-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box; height: 48px; padding: 0 22px;
  border: 1px solid var(--rule-2); border-radius: var(--radius-cap); background: var(--w-step); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 550; letter-spacing: -.003em; text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  transition: border-color .14s ease-out, background-color .14s ease-out, color .14s ease-out, box-shadow .14s ease-out;
}
.welcome .welcome-pill:focus-visible { outline: none; box-shadow: var(--ring); }
.welcome .welcome-pill:active { background: var(--paper-3); border-color: var(--ink-2); transition-duration: 40ms; }
.welcome .welcome-pill-primary { border-color: transparent; background: var(--ink); color: var(--paper); }
.welcome .welcome-pill-primary:active { background: color-mix(in srgb, var(--ink) 76%, var(--paper)); border-color: transparent; }
.welcome .welcome-pill[aria-disabled="true"] { cursor: progress; opacity: .7; }
@media (hover: hover) {
  .welcome .welcome-pill:not(.welcome-pill-primary):hover { background: var(--wash); border-color: var(--edge); }
  .welcome .welcome-pill-primary:hover { box-shadow: 0 0 0 4px var(--select); }
}
.welcome-problem { margin: 14px 0 0; max-width: 46ch; font-size: 14px; line-height: 21px; color: var(--bad); text-wrap: pretty; }
.welcome-problem[hidden] { display: none; }

/* the quiet lines: another way, and on the window's foot who is signed in, the way out and the way to put it off */
.welcome-link {
  padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; text-decoration: underline;
  text-decoration-color: var(--rule-2); text-underline-offset: 3px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.welcome-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--radius); }
@media (hover: hover) { .welcome-link:hover { color: var(--ink); text-decoration-color: currentColor; } }
.welcome-under { margin: 24px 0 0; font-size: 14px; line-height: 20px; }
.welcome-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; box-sizing: border-box; width: 60%; margin: 0;
  padding: 40px clamp(32px, 6vw, 96px) 36px 0; font-size: 13px; line-height: 20px; color: var(--ink-3);
}
.welcome-foot-who { overflow-wrap: anywhere; }
.welcome-foot-ways { display: inline-flex; gap: 22px; white-space: nowrap; }  /* the two ways out stay on one line */
.welcome-foot .welcome-link { color: var(--ink-3); }
.welcome-foot .welcome-link[hidden] { display: none; }

/* ---- the right side: the stage */

.welcome-stage { min-width: 0; padding-left: clamp(32px, 5vw, 72px); }
.welcome-stage-in { animation: welcome-stage .24s ease-out backwards; }
@keyframes welcome-stage { from { opacity: 0; } }
/* whose words these will be, over the ink rule a list of the console opens with. The rule lies on the baseline of
   the title's first line (Funnel Display's, .91 of its size under the line's top), so the two sides hang from one line. */
.welcome-stage-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; height: calc(var(--title) * .91); margin: 0; padding-bottom: 10px;
  border-bottom: 1px solid var(--ink); font-size: 13.5px; line-height: 20px; font-weight: 550; letter-spacing: -.004em; color: var(--ink);
}
.welcome-stage-marks { display: inline-flex; align-items: center; height: 20px; color: var(--ink-2); }
.welcome-stage-marks .home-setup-agents { gap: 9px; }
.welcome-stage-marks .home-setup-agent { width: 14px; height: 14px; }
.welcome-stage-marks svg { width: 16px; height: 16px; }

/* a stretch of the way, between hairlines */
.welcome-progress { display: grid; margin: 0; padding: 0; list-style: none; }
.welcome-act { display: grid; grid-template-columns: minmax(0, 1fr); padding: 14px 0 16px; border-bottom: 1px solid var(--rule-2); }
/* a line of it, in a row that folds open and away */
.welcome-row { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; transition: grid-template-rows .32s var(--ease-out), opacity .22s ease-out; }
.welcome-row > * { min-height: 0; overflow: hidden; }
.welcome-row[data-leaving] { grid-template-rows: 0fr; opacity: 0; }
.welcome-row[data-entering] { animation: welcome-row .34s var(--ease-out) backwards; }
@keyframes welcome-row { from { grid-template-rows: 0fr; opacity: 0; } }
.welcome-act-label { margin: 0; padding: 0 0 6px; font-size: 12.5px; line-height: 18px; font-weight: 500; font-stretch: var(--label-stretch); color: var(--ink-3); }
.welcome-line {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; margin: 0;
  font-size: 14.5px; line-height: 24px; letter-spacing: -.003em; color: var(--ink-3); text-wrap: balance;
}
.welcome-line-mark { display: grid; place-items: center; height: 24px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1; color: var(--ink-3); }
.welcome-line code { display: block; overflow: hidden; font-size: 12.5px; line-height: 24px; color: var(--ink-2); white-space: nowrap; text-overflow: ellipsis; }
/* the stretch whose step is open stands a tone nearer than the ones after it */
.welcome-act[data-now] .welcome-line:not(.welcome-end) { color: var(--ink-2); }
.welcome-act[data-now] .welcome-line code { color: var(--ink); }
/* what follows the line that is typed runs down to what it ends in on the track a path draws for what is left
   (styles.css .path-track): dots, 4px apart */
.welcome-row[data-kind="say"] .welcome-line-mark {
  align-self: stretch; height: auto;
  background: radial-gradient(circle, var(--ink-4) 0 .8px, transparent 1.1px) center top / 4px 4px repeat-y;
}

/* what a stretch ends in. Still to come: the ring a path waits in. Waited for: a ring that turns. There: a tick in
   the one colour, the line in full ink. */
.welcome-end { transition: color .2s ease-out; }
.welcome-end[data-state="waiting"], .welcome-end[data-state="open"] { color: var(--ink-2); }
.welcome-end[data-state="done"], .welcome-end[data-state="seen"] { font-size: 15.5px; font-weight: 600; letter-spacing: -.008em; color: var(--ink); }
.welcome-status-mark {
  box-sizing: border-box; justify-self: center; display: grid; place-items: center; width: 16px; height: 16px; margin-top: 4px; border-radius: 50%;
  border: 1.75px solid var(--rule-2); color: transparent;
}
.welcome-status-mark svg { stroke-width: 3; }
.welcome-end[data-state="soon"] .welcome-status-mark { width: 9px; height: 9px; margin-top: 8px; border-color: var(--ink-3); }
.welcome-end[data-state="open"] .welcome-status-mark, .welcome-end[data-state="seen"] .welcome-status-mark { width: 11px; height: 11px; margin-top: 7px; border-color: var(--ink-2); }
.welcome-end[data-state="seen"] .welcome-status-mark { border-color: var(--ink); }
.welcome-end[data-state="waiting"] .welcome-status-mark { border-top-color: var(--ink); animation: welcome-turn .9s linear infinite; }
.welcome-end[data-state="done"] .welcome-status-mark {
  width: 20px; height: 20px; margin-top: 2px; border-color: transparent; background: var(--go); color: var(--on-go);
  animation: welcome-there .36s cubic-bezier(.2, 1.4, .4, 1);
}
.welcome-row[data-settled] .welcome-status-mark { animation: none; }
@keyframes welcome-turn { to { transform: rotate(360deg); } }
@keyframes welcome-there { from { transform: scale(.4); opacity: 0; } }

/* the first job: its path as Runs draws it, drawn once from its start, over the machine it is on and what that
   pays an hour. The path's rings and its disc stand on the stage's ground. */
.welcome-job { padding-top: 8px; }
.welcome-job-body { display: grid; gap: 7px; min-width: 0; }
.welcome-job-path { display: block; height: 16px; }
.welcome-job-path[data-drawn] { animation: welcome-draw 1s cubic-bezier(.45, 0, .2, 1) backwards; }
@keyframes welcome-draw { from { clip-path: inset(-6px 100% -6px -6px); } to { clip-path: inset(-6px -6px -6px -6px); } }
.welcome-stage :is(.path-station, .path-ring) { fill: var(--w-stage); }
.welcome-stage .path-disc { stroke: var(--w-stage); }
.welcome-job-on { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 12.5px; line-height: 18px; font-weight: 550; font-stretch: var(--label-stretch); color: var(--ink-2); }
.welcome-job-rate { font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* the balance a job is paid from, a standing line at the stage's foot: the figure, then what it is for; and, under
   the line that would start a job, that jobs wait for a payment method */
.welcome-stage-foot:empty { display: none; }
.welcome-fact { margin: 16px 0 0; font-size: 14.5px; line-height: 24px; letter-spacing: -.003em; color: var(--ink); text-wrap: pretty; }
.welcome-fact b { font-weight: 600; font-variant-numeric: tabular-nums; }
.welcome-fact-more { display: block; font-size: 13.5px; line-height: 20px; color: var(--ink-3); }
/* (under the line that would start a job and over the presses, where the balance is what keeps a job from starting:
   the ring a waiting thing wears, then the balance and what it takes, as the line about a payment method stands there) */
.welcome-main .welcome-fact { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; font-size: 15px; line-height: 23px; }
.welcome-main .welcome-fact > .glyph { flex: none; margin: 0 4px; color: var(--ink-2); }
.welcome-main .welcome-fact-words { min-width: 0; }
.welcome-main .welcome-fact-more { font-size: 15px; line-height: 23px; color: var(--ink-2); }
.welcome-main .welcome-fact + .welcome-actions { margin-top: 24px; }
.welcome-fact.method-beside { display: flex; align-items: baseline; gap: 10px; font-size: 15px; line-height: 23px; color: var(--ink-2); }
.welcome-fact.method-beside > .glyph { flex: none; margin: 0 4px; color: var(--ink-2); }

/* ---- one column: the step, then the stage as a band of the ground under it, and the foot at its end */
@media (max-width: 859px) {
  :root:has(#content .welcome) { --w-pad: 24px; }
  .welcome { --top: 20px; --title: 30px; grid-template-rows: auto 1fr; padding-left: 0; padding-right: 0; }
  .welcome-card { grid-template-columns: minmax(0, 1fr); }
  .welcome-main, .welcome-stage, .welcome-foot { padding-left: max(var(--w-pad), env(safe-area-inset-left)); padding-right: max(var(--w-pad), env(safe-area-inset-right)); }
  .welcome-main { padding-bottom: 32px; }
  .welcome-body { max-width: 520px; }
  .welcome-title { line-height: 34px; letter-spacing: -.024em; }
  .welcome-lead { margin-top: 14px; font-size: 15.5px; line-height: 23px; }
  .welcome-ways { margin-top: 26px; }
  .welcome-way { grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 14px; min-height: 76px; padding: 14px 4px 14px 2px; }
  .welcome-way-mark { width: 30px; height: 30px; }
  .welcome-way-mark .home-setup-agents { grid-template-columns: repeat(2, 12px); gap: 5px; }
  .welcome-way-mark .home-setup-agent { width: 12px; height: 12px; }
  .welcome-bar, .welcome-actions { margin-top: 26px; }
  .welcome-actions > .welcome-pill { flex: 1 1 100%; }
  .welcome-stage { padding-top: 22px; border-top: 1px solid var(--rule); background: var(--w-stage); }
  .welcome-stage-head { height: auto; }
  .welcome-stage-in { max-width: 520px; }
  /* short: a stretch still to come keeps its name and its last line */
  .welcome-act:not([data-now]) .welcome-row:is([data-kind="typed"], [data-kind="say"]) { display: none; }
  .welcome-foot { width: auto; align-content: end; padding-top: 28px; padding-bottom: max(28px, env(safe-area-inset-bottom)); background: var(--w-stage); }
}

/* (the bar's own sides, under 700px: styles.css) */
@media (max-width: 700px) { :root:has(#content .welcome) { --w-pad: 20px; } }

:root[data-reduced-motion="true"] .welcome :is(.welcome-card, .welcome-step, .welcome-stage-in, .welcome-row, .welcome-status-mark, .welcome-job-path) { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .welcome :is(.welcome-card, .welcome-step, .welcome-stage-in, .welcome-row, .welcome-status-mark, .welcome-job-path) { animation: none; transition: none; }
}
