/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-width: 0;
  max-width: 100%;
  min-height: 4rem;
  padding: .75rem 1.875rem;
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--fw-ui);
  font-size: var(--fs-control);
  letter-spacing: normal;
  line-height: var(--lh-ui);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.button--accent {
  background: var(--accent-fill);
  color: var(--on-accent);
  box-shadow: var(--shadow-button);
}

.button--accent:not(:disabled):hover { background: var(--accent-hover); }
/* A black place sets --shadow-button and --shadow-button-pressed to graphite: there, a shadow in the ink does not show. */
.button--accent:not(:disabled):active { transform: translate(3px, 3px); box-shadow: var(--shadow-button-pressed, 3px 3px 0 var(--ink)); }

.button--outline { box-shadow: none; }
.button--outline:not(:disabled):hover { background: var(--surface-muted); }
.button--primary { background: var(--ink); color: var(--surface); box-shadow: none; }
.button--primary:not(:disabled):hover { background: var(--terminal-rule); }
.button--inverse { background: var(--surface); color: var(--ink); border-color: var(--surface); box-shadow: none; }
.button--inverse:not(:disabled):hover { background: var(--bg); border-color: var(--bg); }
/* The call of the course. The face goes from graphite to black, as the light of the black panels of the site. */
/* The spectrum of the course ruby marks its edge and its hard shadow, so the button names the course before a person reads it. */
/* The button has no background of its own: one layer is the face, and the layer below it is the shadow. Its text is white on each point of the face. */
.button--spectrum {
  --spectrum-face: linear-gradient(165deg, color-mix(in oklab, var(--terminal-rule) 78%, var(--surface)), var(--ink) 82%);
  --spectrum-edge: linear-gradient(110deg, var(--ai-spectrum-gold), var(--ai-spectrum-magenta), var(--ai-spectrum-violet), var(--ai-spectrum-cyan));
  position: relative;
  isolation: isolate;
  border-color: transparent;
  background: none;
  color: var(--terminal-text);
}
.button--spectrum::before, .button--spectrum::after { content: ""; position: absolute; inset: calc(var(--border-thin) * -1); border-radius: inherit; }
.button--spectrum::after { z-index: -1; border: var(--border-thin) solid transparent; background: var(--spectrum-face) padding-box, var(--spectrum-edge) border-box; }
.button--spectrum::before { z-index: -2; background: var(--spectrum-edge); translate: 6px 6px; }
.button--spectrum:not(:disabled):hover { --spectrum-face: linear-gradient(165deg, color-mix(in oklab, var(--terminal-rule) 72%, var(--surface)), var(--ink) 88%); }
.button--spectrum:not(:disabled):active { translate: 3px 3px; }
.button--spectrum:not(:disabled):active::before { translate: 3px 3px; }

.button--large { min-height: 4.375rem; font-size: var(--fs-control-large); }
.button--small { min-height: 3rem; padding: .5rem 1.25rem; font-size: var(--fs-control); }
.button--wide { width: 100%; justify-content: flex-start; }
.button--block { width: 100%; min-height: 4rem; font-size: var(--fs-control); }

.star-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .375rem;
  padding: .125rem .625rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-code-small);
  line-height: 1.4;
  white-space: nowrap;
}

.star-badge__star { color: var(--rails); }

.text-link {
  color: var(--accent-3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.text-link--strong { font-weight: var(--fw-ui); text-decoration-thickness: 2px; }

.branch-link {
  font-family: var(--font-mono);
  font-weight: 700;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Cards */
.card {
  position: relative;
  background: var(--surface);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-card);
  padding: 2.75rem 2.375rem;
}

.card--raised { box-shadow: var(--shadow-hard); }

.card.card--query { min-width: 0; padding: 0; border: 1px solid var(--rail-tie); background: var(--surface); box-shadow: none; overflow: clip; }
.card.card--task { min-width: 0; padding: 0; border: 1px solid var(--panel-bg); background: var(--panel-bg); color: var(--panel-text); box-shadow: none; --focus: var(--surface); }
.card--task .prompt { --focus: var(--accent-3); }
.card--query > .card__header, .card--task > .card__header { padding: var(--space-l); border-bottom: 1px solid var(--rail-tie); }
.card--task > .card__header { border-bottom-color: var(--terminal-rule); }
.card--query > .card__body, .card--task > .card__body { min-width: 0; padding: var(--space-l); }
.card--query > summary.card__header:focus-visible { outline-offset: -5px; }
@media (max-width: 600px) {
  .card--query > .card__header, .card--query > .card__body,
  .card--task > .card__header, .card--task > .card__body { padding: var(--space-m); }
}

.card--dashed {
  background: var(--surface-muted);
  border: 2.5px dashed var(--ink);
}

.card__title {
  font-size: var(--fs-card-title);
  line-height: var(--lh-ui-title);
}

.card__text {
  margin-top: 1.125rem;
  color: var(--ink-muted);
  font-size: var(--fs-reading);
  line-height: var(--lh-body);
}

/* Stage: the black opening of a page. The header of the page stands on it (layout.css). */
/* Each role of color has a name, so a piece on the stage reads the role and not the token. Out of a stage, the piece keeps the color of its page. */
/* On black, the focus ring is white and the hard shadow of a button is graphite: the colors of a light page do not show. */
.stage {
  --stage-bg: var(--panel-bg);
  --stage-text: var(--panel-text);
  --stage-strong: var(--terminal-text);
  --stage-muted: var(--terminal-comment);
  --stage-rule: var(--terminal-rule);
  --stage-count: var(--panel-title);
  --stage-signal: var(--highlight);
  /* The light of the black panels of the site: graphite, with no color. */
  --stage-light: radial-gradient(circle at 0 0, var(--terminal-rule), transparent 42rem);
  --focus: var(--surface);
  --shadow-button: 6px 6px 0 var(--terminal-rule);
  --shadow-button-pressed: 3px 3px 0 var(--terminal-rule);
  position: relative;
  isolation: isolate;
  background: var(--stage-bg) var(--stage-light);
  color: var(--stage-text);
}
/* A stage inside the page container. The element keeps the width of the container, and its black goes from one edge of the screen to the other. */
/* The black is a layer below the content, as wide as the screen. main clips the part that goes past the page. */
.stage--contained { background: none; }
.stage--contained::before { content: ""; position: absolute; z-index: -1; inset-block: 0; left: 50%; width: 100vw; translate: -50% 0; background: var(--stage-bg) var(--stage-light); }

/* The title of a stage: the weight and the spacing of the share cards. A page gives its size, its line height and its spacing in the three variables. */
/* Out of a stage, the title keeps the ink of its page. */
.stage__title { color: var(--stage-strong, inherit); font-size: var(--stage-title-size, var(--fs-impact)); font-weight: 800; line-height: var(--stage-title-leading, 1.04); letter-spacing: var(--stage-title-tracking, -.03em); }
/* The marker of a stage title has two forms. The block hugs one word that stands alone on its line. */
.stage__mark { display: inline-block; padding: .07em .1em .12em; border-radius: .07em; background: var(--highlight); color: var(--ink); line-height: .78; }
/* The line marker follows a phrase that wraps: one block of the accent behind each line, as on the share cards. On a stage, each highlight takes this form and the ink. */
.stage__mark--line, .stage .highlight { display: inline; padding: 0 .08em; border-radius: .08em; background: var(--highlight); color: var(--ink); line-height: inherit; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* The support of a stage, in two voices: the context in the text color of the stage, and the strong part in white. */
.stage__lead { max-width: 35em; font-size: var(--fs-reading-lead); line-height: 1.55; text-wrap: pretty; }
.stage__lead strong { color: var(--stage-strong, inherit); font-weight: var(--fw-title); }
/* On a stage, a text link is white and keeps its underline, and an outline button takes the light line of the stage. */
.stage .text-link { color: var(--stage-strong); }
.stage .button--outline { border-color: var(--stage-text); background: transparent; color: var(--stage-strong); }
.stage .button--outline:not(:disabled):hover { background: var(--stage-rule); }

/* A figure moves only while the element with its controller says that it runs. The autonomous-cycle controller sets this state. */
[data-cycle-running] { --cycle-play-state: paused; }
[data-cycle-running="true"] { --cycle-play-state: running; }

/* The control that stops the motion of a figure. */
.figure-pause { display: grid; place-items: center; flex: none; width: var(--target-size); height: var(--target-size); padding: 0; border: 1px solid var(--stage-rule, var(--pending)); border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.figure-pause:hover { background: var(--stage-rule, var(--surface-muted)); }
.figure-pause[hidden], .figure-pause__play { display: none; }
[data-cycle-paused="true"] .figure-pause__pause { display: none; }
[data-cycle-paused="true"] .figure-pause__play { display: block; }

/* The phase of a launch beside a call: the label, and then the count. The numbers take the color of the panel title. */
/* The label is a line of its own above the count. A place with less room puts the two on one line. The text flows as words, so the width of the block is the width of its longest line. */
.launch-line { color: var(--stage-text, inherit); font-size: var(--fs-control); line-height: var(--lh-ui); }
.launch-line [hidden] { display: none; }
.launch-line__label { display: block; font-size: var(--fs-caption); }
.launch-line__unit { display: inline-block; white-space: nowrap; }
.launch-line__unit + .launch-line__unit { margin-left: .25em; }
.launch-line__unit strong { color: var(--stage-count, inherit); font-family: var(--font-mono); font-size: var(--fs-code-large); font-variant-numeric: tabular-nums; font-weight: var(--fw-title); }
.launch-line__now { color: var(--stage-count, inherit); font-weight: var(--fw-ui); }

/* Hand-written label: Caveat, one per section at most. */
.sticker {
  display: inline-block;
  padding: .625rem 1.75rem .75rem;
  background: var(--sticker);
  border: var(--border-thin) solid var(--ink);
  border-radius: 4px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: var(--fs-hand);
  line-height: 1.1;
  white-space: nowrap;
  transform: rotate(-4deg);
  pointer-events: none;
}

/* Highlighter behind a phrase. It wraps line by line. */
.highlight {
  background: var(--highlight);
  padding: 0 .12em;
  border-radius: .12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Agent score meter: 25 cells. */
.score-meter {
  display: flex;
  gap: clamp(2px, .8vw, 4px);
  flex-wrap: nowrap;
}

.score-meter__cell {
  flex: 0 1 14px;
  min-width: 0;
  height: 28px;
  border: var(--border-thin) solid var(--ink);
  border-radius: 3px;
  background: var(--surface);
}

.score-meter__cell--on { background: var(--accent); }

.fraction__max { color: var(--ink-muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-pill);
  font-weight: var(--fw-ui);
  font-size: var(--fs-control);
  line-height: var(--lh-ui);
}

.pill__number {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  font-size: var(--fs-caption);
}

/* Shared numbered journey cards */
.step { padding: 1.75rem 1.75rem 2rem; }

.step__number {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: var(--border-thin) solid var(--ink);
  border-radius: 50%;
  background: var(--highlight);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-code-large);
}

.step__title {
  margin-top: 1.125rem;
  font-size: var(--fs-card-title);
  line-height: var(--lh-ui-title);
}

.step__text {
  margin-top: .875rem;
  color: var(--ink-muted);
  font-size: var(--fs-ui-body);
  line-height: var(--lh-ui);
}

/* Member invitation: immediate account access and useful next steps. */
.member-invite-section { margin-block: 2.5rem var(--section-pad-y); }
.member-invite { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.75rem; padding: 4.375rem 4.25rem 2.75rem; background: var(--panel-bg); border: var(--border) solid var(--ink); border-radius: var(--radius-panel); box-shadow: var(--shadow-panel); }
/* The light behind the ruby is graphite, with no colour. Only the ruby and the action bring colour. */
.member-invite { background-image: radial-gradient(circle at 0 0, var(--terminal-rule), transparent 42rem); }
/* The panel is black, so the focus ring is white and the hard shadow of the button is graphite. */
.member-invite { --focus: var(--surface); --shadow-button: 6px 6px 0 var(--terminal-rule); --shadow-button-pressed: 3px 3px 0 var(--terminal-rule); }
/* The ruby opens the first line of the title, at the height of its letters. */
.member-invite__ruby { display: inline-block; width: .95em; margin-inline-end: .22em; vertical-align: -.12em; }
.member-invite__ruby :is(picture, img) { display: block; width: 100%; height: auto; }
.member-invite__title { color: var(--panel-title); font-size: var(--fs-section); line-height: var(--lh-title); letter-spacing: var(--tracking-display); }
.member-invite__text { margin-top: 1.75rem; color: var(--panel-text); font-size: var(--fs-reading); line-height: var(--lh-body); }
.sticker--member-invite { position: absolute; top: -2.25rem; right: -1rem; transform: rotate(5deg); }
/* The return of a member stays beside the call. The column gap leaves room for the hard shadow of the button. */
.member-invite__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; margin-top: 2rem; }
.member-invite__actions .text-link { color: var(--panel-text); }
/* Keep this panel padding stronger than the ordered-list reset. */
.member-invite > .member-invite__steps { align-self: center; display: grid; gap: 1.5rem; padding: 2rem; background: var(--surface); border: var(--border-thin) solid var(--ink); border-radius: var(--radius-card); }
.member-invite__steps > li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: start; gap: 1rem; }
.member-invite__steps > li > div { min-width: 0; }
.member-invite__number { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: var(--border-thin) solid var(--ink); border-radius: 50%; background: var(--highlight); font-family: var(--font-mono); font-weight: var(--fw-title); font-size: var(--fs-code); }
.member-invite__steps h3 { font-size: var(--fs-control-large); line-height: var(--lh-ui-title); }
.member-invite__steps p { margin-top: .5rem; font-size: var(--fs-control); line-height: var(--lh-ui); color: var(--ink-muted); }

.field__label {
  display: block;
  margin-bottom: .75rem;
  font-weight: var(--fw-ui);
  font-size: var(--fs-control);
  line-height: var(--lh-ui);
}

.field__input {
  min-width: 0;
  width: 100%;
  height: 3.875rem;
  padding: 0 1.25rem;
  background: var(--bg);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-btn);
  font-size: var(--fs-control);
  font-weight: var(--fw-body);
  line-height: var(--lh-ui);
}

.field__input::placeholder { color: var(--ink-muted); opacity: 1; }

.choices {
  margin-top: 1.75rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choices__options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.125rem 1rem;
  background: var(--bg);
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-btn);
  font-weight: var(--fw-ui);
  font-size: var(--fs-control);
  line-height: var(--lh-ui);
  cursor: pointer;
}

.choice:has(input:checked) { background: var(--highlight); }

.choice input, .consent input {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--accent-fill);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  margin-block: 1.75rem;
  font-size: var(--fs-control);
  line-height: var(--lh-ui);
}

.consent input { width: 1.375rem; height: 1.375rem; margin-top: .125rem; }

@media (max-width: 1000px) {
  .member-invite { grid-template-columns: 1fr; padding: 3.5rem 2rem 2rem; }
}

@media (max-width: 560px) {
  .member-invite { padding: 3rem 1.25rem 1.25rem; box-shadow: 8px 8px 0 var(--ink); }
  .member-invite > .member-invite__steps { padding: 1.5rem 1.25rem; }
  .choices__options { grid-template-columns: 1fr; }
  .sticker--member-invite { right: .5rem; }
  .card { padding: 2rem 1.5rem; }
}


/* Layout helpers: the space scale as margins */
.space-top-xs { margin-top: var(--space-xs); }
.space-top-s { margin-top: var(--space-s); }
.space-top-m { margin-top: var(--space-m); }
.space-top-l { margin-top: var(--space-l); }
.space-top-xl { margin-top: var(--space-xl); }
.flush { margin: 0; }
.measure-narrow { max-width: 40rem; }
.measure-medium { max-width: 44rem; }
.measure-wide { max-width: 52rem; }
.stack { display: grid; gap: var(--space-m); }
.stack--loose { gap: var(--space-l); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-m); align-items: center; }
.text-small { font-size: var(--fs-ui-body); line-height: var(--lh-ui); }
.link-inherit { color: inherit; }
.button_to { display: contents; }


/* Reading navigation: labels identify sections; underlined links navigate. */
.page-index { padding: var(--space-l); background: var(--surface); border: var(--border-thin) solid var(--ink); border-radius: var(--radius-card); }
.page-index__title { font-size: var(--fs-control); line-height: var(--lh-ui); margin-bottom: var(--space-s); }
.page-index ul { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-l); }
.page-index a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--accent-3); font-size: var(--fs-control); text-underline-offset: .25em; }
/* The head is the opening of the page, on the stage. Its top padding takes the place of the top padding of the page, and the edge of the stage divides it from the text. */
.page.privacy-page { padding-top: 0; }
.privacy-page__head { --stage-pad-top: var(--space-xl); padding-bottom: var(--space-xl); }
.privacy-page__lead { max-width: var(--reading-measure); margin-block: var(--space-m); }
.privacy-page__list { max-width: var(--reading-measure); padding-left: var(--space-l); list-style: disc; line-height: var(--lh-body); }
.privacy-page__list li + li { margin-top: var(--space-s); }
.privacy-index > summary { min-height: 2.75rem; cursor: pointer; font-weight: var(--fw-ui); }
.privacy-index:not([open]) > summary { margin-bottom: 0; }
.privacy-page__layout { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(0, 2.4fr); gap: var(--space-xl); align-items: start; margin-top: var(--space-xl); }
.privacy-page .page-index ul { display: grid; gap: var(--space-xs); }
.privacy-page .prose--page { margin-block: 0; }
.privacy-page .prose--page section { scroll-margin-top: var(--space-l); }
.privacy-page .prose--page section + section { margin-top: var(--space-xl); padding-top: var(--space-l); border-top: 1px solid var(--rail-tie); }
.privacy-page .prose--page h2 { margin-top: 0; color: var(--accent-3); }
@media (max-width: 800px) {
  .privacy-page__layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-l); }
}
