/* Road-sign clarity, in purple and pink.
   A white page, black type and one purple sign. Pink marks whatever is
   moving. Barlow is drawn from highway signage, so the type and the sign
   speak the same language. */

:root {
  --sign: #6b21a8;
  --sign-deep: #4c1679;
  --paint: #ffffff;
  --ink: #000000;
  --lane: #ff5fae;
  --concrete: #f5eefb;
  --edge: #d8c9e6;
  --muted: #5d4b6b;
  --stop: #b3261e;
  --stop-deep: #8f1d17;
  --stop-wash: #fbeceb;
  --blush: #fff0f7;

  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Semi Condensed", "Barlow", "Arial Narrow", Arial, sans-serif;

  --t-small: 0.9375rem;
  --t-body: 1.0625rem;
  --t-lead: 1.3125rem;
  --t-h3: 1.5rem;
  --t-h2: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
  --t-h1: clamp(2.6rem, 1.4rem + 4.6vw, 4.5rem);

  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --rail: 2.5rem;

  color-scheme: light;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: rgba(107, 33, 168, 0.18);
}

a,
button,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paint);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.5;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
}

h2 {
  font-size: var(--t-h2);
}

h3 {
  font-size: var(--t-h3);
  line-height: 1.15;
}

a {
  color: var(--sign);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--sign-deep);
}

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

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: -5rem;
  left: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  background: var(--ink);
  color: #fff;
}

.skip:focus {
  top: 0;
  color: #fff;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 72rem);
  margin-inline: auto;
}

.narrow {
  max-width: 30rem;
}

/* ---------- Buttons and links that act ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.15rem;
  border: 2px solid var(--sign);
  border-radius: 8px;
  background: var(--sign);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--sign-deep);
  background: var(--sign-deep);
  color: #fff;
}

.btn--big {
  min-height: 3.25rem;
  padding-inline: 1.5rem;
  font-size: 1.125rem;
}

.btn--small {
  min-height: 2.25rem;
  padding: 0.3rem 0.8rem;
  font-size: var(--t-small);
}

.btn--quiet {
  background: transparent;
  color: var(--sign);
}

.btn--quiet:hover {
  background: var(--concrete);
  color: var(--sign-deep);
}

.btn--danger {
  border-color: var(--stop);
  background: var(--stop);
}

.btn--danger:hover {
  border-color: var(--stop-deep);
  background: var(--stop-deep);
}

.btn--light {
  border-color: #fff;
  background: #fff;
  color: var(--sign);
}

.btn--light:hover {
  border-color: var(--lane);
  background: var(--lane);
  color: var(--ink);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--sign);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.danger-link {
  color: var(--stop);
}

.danger-link:hover {
  color: var(--stop-deep);
}

/* ---------- Top bar and footer ---------- */

.top {
  border-bottom: 1px solid var(--edge);
}

.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  min-height: 4rem;
  padding-block: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  flex: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 3vw, 1.6rem);
  font-weight: 500;
}

.top-nav form {
  display: flex;
  margin: 0;
}

.top-nav a:not(.btn),
.top-nav .linkish {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.top-nav a:not(.btn):hover,
.top-nav .linkish:hover {
  text-decoration: underline;
}

/* The current page is marked like a lane: a yellow bar under its name. */
.top-nav a[aria-current="page"] {
  box-shadow: inset 0 -4px 0 var(--lane);
  text-decoration: none;
}

.top-nav a[aria-current="page"]:hover {
  text-decoration: none;
}

/* Phones: keep the name and both links on one line. */
@media (max-width: 30rem) {
  .brand {
    gap: 0.4rem;
    font-size: 1.3rem;
  }

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

  .top-nav {
    gap: 0.7rem;
    font-size: var(--t-small);
  }

  .top-nav .btn--small {
    padding-inline: 0.6rem;
  }
}

.foot {
  padding-block: 1.5rem;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: var(--t-small);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.foot-about {
  max-width: 52ch;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.foot-nav a {
  color: var(--muted);
  font-weight: 500;
}

.foot-nav a:hover {
  color: var(--ink);
}

/* ---------- Notices ---------- */

.notices {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.notice {
  padding: 0.7rem 1rem;
  border-left: 6px solid var(--sign);
  border-radius: 8px;
  background: var(--concrete);
  font-weight: 500;
}

.notice--error {
  border-left-color: var(--stop);
  background: var(--stop-wash);
}

/* ---------- Tags ---------- */

.tag {
  display: inline-block;
  flex: none;
  padding: 0.05rem 0.45rem;
  border-radius: 4px;
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--late {
  background: var(--stop);
  color: #fff;
}

.tag--moved {
  background: var(--lane);
  color: var(--ink);
}

.tag--new {
  background: var(--concrete);
  box-shadow: inset 0 0 0 1.5px var(--sign);
  color: var(--sign-deep);
}

.tag--done {
  background: var(--sign);
  color: #fff;
}

.tag--key {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Homepage: hero ---------- */

.hero {
  padding-block: clamp(1.5rem, 3vw, 2.25rem) clamp(2.5rem, 6vw, 4.5rem);
}

.hero-copy {
  display: grid;
  gap: 1.25rem;
}

.lede {
  max-width: 34ch;
  font-size: var(--t-lead);
  line-height: 1.4;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  margin-top: 1.4rem;
  font-weight: 500;
}

@media (min-width: 56rem) {
  .hero-copy {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: end;
    column-gap: 3rem;
  }
}

/* ---------- Homepage: the sign ---------- */

.sign {
  margin-top: clamp(1.5rem, 2.6vw, 1.9rem);
  padding: clamp(1.4rem, 2.6vw, 2.1rem);
  border-radius: 22px;
  background: var(--sign);
  /* A white stripe set in from the edge, as on a road sign. */
  box-shadow: inset 0 0 0 5px var(--sign), inset 0 0 0 9px #fff;
  color: #fff;

  /* Every example sits in the same grid cell, so the sign is always as tall
     as the tallest one and the page below never jumps. */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.sign :focus-visible {
  outline-color: var(--lane);
}

/* Rows: the request, the stops, the reply. The stops row takes any spare
   height, which simply makes the last stretch of rail longer. */
.trip {
  display: grid;
  grid-area: 1 / 1;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
}

.trip.is-away {
  visibility: hidden;
}

@media (min-width: 40rem) {
  .trip {
    grid-template-rows: auto 1fr auto auto;
  }
}

@media (min-width: 56rem) {
  .trip {
    grid-template-columns: minmax(0, 10fr) minmax(0, 11fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "ask ask"
      "stops window"
      "answer answer";
    column-gap: clamp(1.5rem, 4vw, 3rem);
  }

  .leg--ask {
    grid-area: ask;
  }

  .stops {
    grid-area: stops;
  }

  .window {
    grid-area: window;
  }

  .leg--answer {
    grid-area: answer;
  }
}

/* A leg is one row of the route: a piece of rail on the left, words on the
   right. Legs sit flush against each other so the rail reads as one line. */

.leg {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: 0.9rem;
}

.stops {
  display: flex;
  flex-direction: column;
}

.stops > .leg:last-child {
  flex: 1 0 auto;
}

.rail {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.rail::before,
.rail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 3px);
  width: 6px;
}

.rail::before {
  background: rgba(255, 255, 255, 0.4);
}

.rail::after {
  background: var(--lane);
  transform-origin: top center;
}

.leg--ask .rail::before,
.leg--ask .rail::after {
  top: calc(var(--rail) / 2);
}

.leg--answer .rail::before,
.leg--answer .rail::after {
  content: none;
}

.node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: var(--sign);
}

.node--end {
  width: var(--rail);
  height: var(--rail);
  border: 0;
}

.tick {
  display: block;
}

.leg-body {
  padding-bottom: 1.1rem;
}

.leg--ask .leg-body {
  padding-top: 0.45rem;
  padding-bottom: 1.4rem;
}

.leg--answer .leg-body {
  padding-top: 0.45rem;
  padding-bottom: 0;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #ecdcf8;
  font-size: var(--t-small);
  font-weight: 600;
}

.said {
  max-width: 40ch;
  margin-top: 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1rem + 1.9vw, 2.125rem);
  font-weight: 600;
  line-height: 1.1;
}

.untyped {
  color: transparent;
}

.heard {
  max-width: 90ch;
  margin-top: 0.3rem;
  font-size: var(--t-lead);
  font-weight: 500;
  line-height: 1.35;
}

.stop-name {
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.75rem;
}

.stop-result {
  margin-top: 0.1rem;
  line-height: 1.35;
}

.wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 1rem;
}

.wave i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--lane);
  transform: scaleY(0.3);
}

/* The window shows what happened at the current stop. Its panes are stacked
   in one grid cell, so it is always as tall as its tallest pane. */

.window {
  display: none;
}

@media (min-width: 40rem) {
  .window {
    display: grid;
    margin-top: 1.5rem;
  }
}

@media (min-width: 56rem) {
  .window {
    margin-top: 0;
    margin-bottom: 1.1rem;
  }
}

.pane {
  grid-area: 1 / 1;
  padding: 1rem 1.15rem 1.1rem;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
}

/* Scoped to the example on stage: a visible child would otherwise show
   through its hidden parent. */
.trip:not(.is-away) .pane.is-shown {
  opacity: 1;
  visibility: visible;
}

.pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--ink);
}

.pane-title {
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.pane-note {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 500;
}

.rows li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--edge);
  font-size: 1rem;
  line-height: 1.4;
}

.rows li:last-child {
  border-bottom: 0;
}

.row-lead {
  flex: none;
  color: var(--sign);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.row-main {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 500;
}

.row-who {
  flex: none;
  min-width: 2.6rem;
  color: var(--muted);
}

.row-when {
  flex: none;
  min-width: 3.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* A posted message is the whole point of its pane, so it is set large. */
.msg {
  margin-top: 0.8rem;
  font-size: var(--t-lead);
  line-height: 1.4;
}

.msg-from {
  display: block;
  margin-bottom: 0.2rem;
  font-size: var(--t-body);
  font-weight: 700;
}

/* Live: the script adds .is-live to the sign, then walks each leg through
   is-active, is-done and is-passed. Without the script (or with reduced
   motion) none of this applies and the route shows finished. */

.sign.is-live .rail::after {
  transform: scaleY(0);
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.sign.is-live .leg.is-passed .rail::after {
  transform: scaleY(1);
}

.sign.is-live .leg--stop .node {
  background: var(--sign);
  transition: background-color 0.2s ease;
}

.sign.is-live .leg--stop .tick {
  opacity: 0;
}

.sign.is-live .leg--stop.is-active .node {
  background: var(--lane);
}

.sign.is-live .leg--stop.is-active .node::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 3px solid var(--lane);
  border-radius: 50%;
  animation: ping 1.1s ease-out infinite;
}

.sign.is-live .leg--stop.is-done .node {
  background: #fff;
}

.sign.is-live .leg--stop.is-done .tick {
  opacity: 1;
}

.sign.is-live .leg--stop .stop-name {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sign.is-live .leg--stop.is-active .stop-name,
.sign.is-live .leg--stop.is-done .stop-name {
  opacity: 1;
}

.sign.is-live .leg--stop .stop-result {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sign.is-live .leg--stop.is-done .stop-result {
  opacity: 1;
  transform: none;
}

.sign.is-live .leg--answer .node--end {
  opacity: 0.45;
  transition: opacity 0.25s ease;
}

.sign.is-live .leg--answer .leg-body {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.sign.is-live .leg--answer.is-done .node--end {
  opacity: 1;
}

.sign.is-live .leg--answer.is-done .leg-body {
  opacity: 1;
  transform: none;
}

.sign.is-live .leg.is-speaking .wave i {
  animation: wave 0.9s ease-in-out infinite;
}

.sign.is-live .leg.is-speaking .wave i:nth-child(2) {
  animation-delay: -0.55s;
}

.sign.is-live .leg.is-speaking .wave i:nth-child(3) {
  animation-delay: -0.2s;
}

.sign.is-live .leg.is-speaking .wave i:nth-child(4) {
  animation-delay: -0.7s;
}

.sign.is-live .leg.is-speaking .wave i:nth-child(5) {
  animation-delay: -0.35s;
}

/* An empty frame holds the window's place until the first stop reports. */
.sign.is-live .window::before {
  content: "";
  grid-area: 1 / 1;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: 12px;
}

.sign.is-live .pane {
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0.28s;
}

.sign.is-live .pane.is-shown {
  transform: none;
  transition-delay: 0s;
}

.sign.is-live .pane.is-shown .rows li,
.sign.is-live .pane.is-shown .msg {
  animation: row-in 0.34s ease both;
  animation-delay: 0.12s;
}

.sign.is-live .pane.is-shown .rows li:nth-child(2) {
  animation-delay: 0.19s;
}

.sign.is-live .pane.is-shown .rows li:nth-child(3) {
  animation-delay: 0.26s;
}

.sign.is-live .pane.is-shown .rows li:nth-child(4) {
  animation-delay: 0.33s;
}

.sign.is-live .pane.is-shown .rows li:nth-child(5) {
  animation-delay: 0.4s;
}

.sign.is-live .pane.is-shown .rows li:nth-child(6) {
  animation-delay: 0.47s;
}

.sign.is-paused *,
.sign.is-paused *::before,
.sign.is-paused *::after {
  animation-play-state: paused !important;
}

/* Set by the script while it rewinds an example, so nothing plays backwards. */
.sign.is-resetting *,
.sign.is-resetting *::before,
.sign.is-resetting *::after {
  animation: none !important;
  transition: none !important;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes ping {
  from {
    opacity: 0.9;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  min-height: 2.5rem;
  padding: 0.3rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover {
  background: var(--concrete);
}

.chip.is-on {
  background: var(--ink);
  color: #fff;
}

.chip--plain {
  border-color: transparent;
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
}

/* ---------- Homepage: the rest ---------- */

.band {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  scroll-margin-top: 1rem;
}

.band--tint {
  background: var(--concrete);
}

.band-lede {
  max-width: 44ch;
  margin-top: 0.6rem;
  font-size: var(--t-lead);
  line-height: 1.4;
}

.band--cta {
  background: var(--blush);
}

.band--cta .btn {
  margin-top: 1.5rem;
}

.phrases {
  margin-top: 2rem;
  border-top: 2px solid var(--ink);
}

.phrase {
  display: grid;
  gap: 0.3rem 2.5rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--edge);
}

.phrase dt {
  font-family: var(--display);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
}

.phrase dd {
  max-width: 52ch;
}

.steps {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.steps h3 {
  margin-top: 0.8rem;
}

.steps p {
  max-width: 36ch;
  margin-top: 0.4rem;
}

/* Styled after the small exit-number plate on top of a highway sign. */
.exit {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  background: var(--sign);
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px #fff;
  color: #fff;
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (min-width: 48rem) {
  .phrase {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: baseline;
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

/* ---------- App: pages and forms ---------- */

.page {
  padding-block: clamp(1.75rem, 4vw, 3rem) clamp(3rem, 7vw, 5rem);
}

.page h1 {
  overflow-wrap: anywhere;
  font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3rem);
}

.page-lede {
  max-width: 56ch;
  margin-top: 0.6rem;
  font-size: var(--t-lead);
  line-height: 1.4;
}

.crumb {
  margin-bottom: 0.5rem;
  font-size: var(--t-small);
  font-weight: 500;
}

.empty {
  max-width: 44rem;
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 2px dashed var(--edge);
  border-radius: 10px;
  color: var(--muted);
}

.form {
  display: grid;
  justify-items: start;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.form--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  width: 100%;
}

.field label {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 2px solid #7d6b8c;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--stop);
}

.hint {
  max-width: 60ch;
  color: var(--muted);
  font-size: var(--t-small);
}

.error {
  color: var(--stop);
  font-size: var(--t-small);
  font-weight: 600;
}

.after-form {
  margin-top: 1.5rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.4rem;
  font-weight: 500;
}

/* Show / hide beside a password, added by forms.js. */
.secret {
  display: flex;
  gap: 0.5rem;
}

.secret input {
  flex: 1 1 auto;
  min-width: 0;
}

.secret .btn {
  flex: none;
  min-width: 4.5rem;
}

/* A second step before anything is deleted. */
.confirm summary {
  width: fit-content;
  color: var(--stop);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.confirm summary:hover {
  color: var(--stop-deep);
}

.confirm form {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

/* ---------- App: project list ---------- */

.project-list {
  display: grid;
  gap: 0.6rem;
  max-width: 44rem;
  margin-top: 1.5rem;
}

.project-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.project-list a:hover {
  background: var(--concrete);
}

.project-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}

.project-stats {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 500;
}

.projects-layout {
  display: grid;
  align-items: start;
  gap: 2.5rem;
}

.new-project .form {
  margin-top: 1rem;
}

@media (min-width: 56rem) {
  .projects-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
    gap: 3rem;
  }

  .projects-layout .project-list,
  .projects-layout .empty {
    margin-top: 0;
  }

  .projects-layout {
    margin-top: 1.5rem;
  }
}

/* ---------- App: one project ---------- */

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-head > div {
  flex: 1 1 16rem;
  min-width: 0;
}

.goal {
  max-width: 60ch;
  overflow-wrap: anywhere;
  margin-top: 0.5rem;
  font-size: var(--t-lead);
  line-height: 1.4;
}

/* The ask box is a small version of the homepage sign. */
.askbox {
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem 1.1rem;
  border-radius: 16px;
  background: var(--sign);
  box-shadow: inset 0 0 0 4px var(--sign), inset 0 0 0 7px #fff;
  color: #fff;
}

.askbox :focus-visible {
  outline-color: var(--lane);
}

.askbox label {
  display: block;
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.askbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.askbox-row input[type="text"] {
  flex: 1 1 14rem;
  width: auto;
  min-width: 0;
  border-color: #fff;
}

.mic {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.mic:hover {
  background: var(--sign-deep);
}

.mic.is-listening {
  border-color: var(--lane);
  background: var(--lane);
  color: var(--ink);
}

.mic.is-listening::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 3px solid var(--lane);
  border-radius: 50%;
  animation: ping 1.1s ease-out infinite;
}

.askbox-status {
  min-height: 1.6rem;
  margin-top: 0.55rem;
  font-weight: 500;
}

.askbox.is-working .askbox-status::before {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.6rem;
  border-radius: 50%;
  background: var(--lane);
  animation: pulse 1.1s ease-in-out infinite;
}

.feed {
  margin-top: 1.25rem;
}

/* Two columns: who is speaking, then what was said. The first column is as
   wide as the longest name, so both lines of text start at the same place. */
.exchange {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 0.8rem;
  overflow-wrap: anywhere;
  max-width: 60rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  background: var(--concrete);
}

.exchange--failed {
  background: var(--stop-wash);
}

.exchange > p {
  display: contents;
}

.exchange-who {
  font-weight: 700;
}

.exchange > .did {
  grid-column: 1 / -1;
}

.did {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.3rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--edge);
}

.did li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.did li::before {
  content: "\2713";
  flex: none;
  color: var(--sign);
  font-weight: 700;
}

.did li.did-failed {
  color: var(--stop);
}

.did li.did-failed::before {
  content: "\00d7";
  color: var(--stop);
}

.did-where {
  flex: none;
  min-width: 3.4rem;
  font-weight: 700;
}

.earlier {
  margin-top: 0.75rem;
}

.earlier summary {
  width: fit-content;
  color: var(--sign);
  font-weight: 600;
  cursor: pointer;
}

.exchange--small {
  margin-top: 0.6rem;
  padding: 0.6rem 0 0;
  border-top: 1px solid var(--edge);
  border-radius: 0;
  background: none;
  font-size: var(--t-small);
}

/* ---------- App: the board ---------- */

.board {
  display: grid;
  align-items: start;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 50rem) {
  .board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.column {
  padding: 0.9rem;
  border-radius: 12px;
  background: var(--concrete);
}

.column h2 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1.5rem;
}

.count {
  color: var(--muted);
  font-family: var(--body);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0;
}

.add {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.add input[type="text"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 2.25rem;
  padding-block: 0.3rem;
}

.cards {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 0.45rem;
  overflow-wrap: anywhere;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #fff;
}

.card-title {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.card-title:hover {
  color: var(--sign);
  text-decoration: underline;
}

.column--done .card-title {
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.7rem;
  color: var(--muted);
  font-size: var(--t-small);
}

/* ---------- App: connections ---------- */

/* ---------- Connections: a directory of logo tiles ----------
   Tiles stay white and quiet so each brand's own colour carries them.
   A connected tile gets the pink lane down its left edge: pink means live.
   Opening "Connect" widens a tile across its row, how-to beside the form. */

.connections-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}

.connected-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--concrete);
  font-size: var(--t-small);
}

.connected-strip strong {
  font-size: 1.05rem;
}

.connected-strip ul {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.connected-strip a {
  display: block;
  border-radius: 8px;
}

.connection-group {
  margin-top: 2.75rem;
}

.connection-group > h2 {
  font-size: 1.9rem;
}

.connection-group > .hint {
  margin-top: 0.3rem;
}

.connections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  align-items: start;
  gap: 1rem;
  margin-top: 1.25rem;
}

.connection {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  grid-template-areas:
    "logo head"
    "logo blurb"
    "body body";
  gap: 0.35rem 1rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--paint);
  scroll-margin-top: 1.5rem;
  transition: border-color 0.15s ease;
}

.connection:hover {
  border-color: #bda6d3;
}

.connection.is-connected {
  box-shadow: inset 4px 0 0 var(--lane);
}

.connection:has(> .connection-body > .connect[open]) {
  grid-column: 1 / -1;
  border-color: var(--sign);
}

.connection > .logo {
  grid-area: logo;
}

.connection-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  grid-area: head;
  min-height: 1.6rem;
}

.connection h3 {
  font-family: var(--body);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0;
}

.connection-blurb {
  grid-area: blurb;
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.45;
}

.connection-body {
  grid-area: body;
  margin-top: 0.65rem;
}

.connection-summary {
  overflow-wrap: anywhere;
  font-size: var(--t-small);
  font-weight: 500;
}

.connection-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 0.6rem;
}

.connection-actions .confirm form {
  margin-top: 0.5rem;
}

.connection-actions .btn {
  border-width: 1px;
  border-radius: 999px;
}

.connection-actions .confirm summary {
  list-style: none;
  font-size: var(--t-small);
}

.connection-actions .confirm summary::-webkit-details-marker {
  display: none;
}

.connection-actions .confirm[open] {
  flex-basis: 100%;
}

.logo--light svg {
  width: 1.65rem;
  height: 1.65rem;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--blush);
  color: var(--sign-deep);
  font-size: 0.8125rem;
  font-weight: 600;
}

.state::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--lane);
}

/* Logo tiles */

.logo {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  color: #fff;
}

.logo svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.logo--light {
  border: 1px solid var(--edge);
  background: #fff;
}

.logo--letters {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}

.logo--sm {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
}

.logo--sm svg {
  width: 1rem;
  height: 1rem;
}

.logo--sm.logo--letters {
  font-size: 0.95rem;
}

/* "Connect X": the form stays folded until someone opens it. */

.connect > summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.35rem 1rem;
  border: 1px solid var(--sign);
  border-radius: 999px;
  color: var(--sign);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.connect > summary::-webkit-details-marker {
  display: none;
}

.connect > summary:hover {
  background: var(--concrete);
  color: var(--sign-deep);
}

.connect .when-open,
.connect[open] .when-closed {
  display: none;
}

.connect[open] .when-open {
  display: inline;
}

.connect-panel {
  display: grid;
  gap: 1.25rem 2.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--edge);
}

@media (min-width: 48rem) {
  .connect-panel {
    grid-template-columns: minmax(0, 18rem) minmax(0, 30rem);
  }
}

.connect-how {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  color: var(--muted);
  font-size: var(--t-small);
}

.connections-note {
  margin-top: 2rem;
}

a.tag--key {
  text-decoration: none;
}

a.tag--key:hover {
  text-decoration: underline;
}

.connection .form {
  margin-top: 0.4rem;
}

.connections-note {
  margin-top: 1.5rem;
}

/* ---------- Plates: one boxed job each (account, new project) ---------- */

.plates {
  display: grid;
  align-items: start;
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (min-width: 56rem) {
  .plates {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  .plate--main {
    grid-row: span 2;
  }
}

.plate {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.25rem 1.4rem 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.plate h2 {
  font-size: 1.75rem;
}

.plate p {
  max-width: 52ch;
}

.plate--danger {
  border-color: var(--stop);
}

.plate .form {
  margin-top: 0.4rem;
}

/* ---------- Sign-up and password reset ---------- */

.auth {
  display: grid;
  align-items: start;
  gap: 2.5rem;
}

.auth-main {
  max-width: 30rem;
}

@media (min-width: 56rem) {
  .auth {
    grid-template-columns: minmax(0, 30rem) minmax(0, 26rem);
    justify-content: space-between;
    column-gap: 4rem;
  }

  .route {
    margin-top: 0.5rem;
  }
}

/* The steps of a flow, drawn as the homepage route: a rail, a node per stop,
   yellow for the stretch already travelled and the stop you are at. */
.route {
  padding: clamp(1.4rem, 2.6vw, 2rem);
  border-radius: 22px;
  background: var(--sign);
  box-shadow: inset 0 0 0 5px var(--sign), inset 0 0 0 9px #fff;
  color: #fff;
}

.route-title {
  font-size: 1.625rem;
}

.route-stops {
  display: grid;
  margin-top: 1.4rem;
}

.route-stop {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  column-gap: 0.9rem;
  padding-bottom: 1.4rem;
}

.route-stop:last-child {
  padding-bottom: 0;
}

.route-stop::before {
  content: "";
  position: absolute;
  top: 1.75rem;
  bottom: 0;
  left: calc(0.875rem - 3px);
  width: 6px;
  background: rgba(255, 255, 255, 0.4);
}

.route-stop.is-past::before {
  background: var(--lane);
}

.route-stop:last-child::before {
  content: none;
}

.route-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 5px solid #fff;
  border-radius: 50%;
  background: var(--sign);
  color: var(--sign);
}

.route-node svg {
  display: block;
}

.route-stop.is-past .route-node {
  background: #fff;
}

.route-stop.is-here .route-node {
  background: var(--lane);
}

.route-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.75rem;
}

.route-note {
  margin-top: 0.1rem;
  color: #ecdcf8;
  line-height: 1.4;
}

.route-stop.is-here .route-note {
  color: #fff;
}

/* ---------- Homepage: questions ---------- */

.faq {
  margin-top: 2rem;
  border-top: 2px solid var(--ink);
}

.faq-item {
  display: grid;
  gap: 0.4rem 2.5rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--edge);
}

.faq-item dt {
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.faq-item dd {
  max-width: 60ch;
}

@media (min-width: 48rem) {
  .faq-item {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: baseline;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}


/* ---------- Safeguards: autonomy level, pause, approvals ---------- */

.project-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.level {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--concrete);
  color: var(--sign-deep);
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
}

.level:hover {
  border-color: var(--sign);
}

.level--l1 {
  background: #fff;
}

.level--l3 {
  background: var(--blush);
  border-color: var(--lane);
}

.btn--stop {
  border-color: var(--stop);
  background: var(--stop);
}

.btn--stop:hover {
  border-color: var(--stop-deep);
  background: var(--stop-deep);
}

.paused-banner {
  margin-top: 1.25rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--stop);
  border-left-width: 6px;
  border-radius: 12px;
  background: var(--stop-wash);
}

.approvals {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--sign);
  border-radius: 16px;
  background: var(--concrete);
}

.approvals h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
}

.approval-list {
  display: grid;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.approval {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.4rem 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--paint);
}

.approval-summary {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.approval-actions,
.approval-state {
  grid-column: 2;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.approval-state {
  color: var(--muted);
  font-size: var(--t-small);
}

.approval-state--failed {
  color: var(--stop);
}

.decided {
  margin-top: 1.5rem;
}

.levels {
  margin: 0;
  padding: 0;
  border: 0;
}

.levels legend {
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.level-choice {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.3rem 0;
  font-weight: 400;
}

.level-choice input {
  flex: none;
  accent-color: var(--sign);
}

/* ---------- Organisation ---------- */

.org-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.org-new .form {
  max-width: 22rem;
  margin-top: 0.8rem;
}

.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  align-items: start;
  gap: 1rem;
  margin-top: 2rem;
}

.org-section {
  margin-top: 2.75rem;
}

.org-section > h2 {
  margin-bottom: 1rem;
  font-size: 1.9rem;
}

.org-section > .connect,
.org-section > .hint {
  margin-top: 1rem;
}

.org-form {
  max-width: 32rem;
  margin-top: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--edge);
  border-radius: 16px;
}

.people {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}

.people th,
.people td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--edge);
  text-align: left;
  vertical-align: middle;
}

.people tbody tr:last-child td {
  border-bottom: 0;
}

.people th {
  background: var(--concrete);
  font-weight: 600;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.inline-form select {
  min-height: 2.25rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.departments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  align-items: start;
  gap: 1rem;
}

.department {
  display: grid;
  gap: 0.6rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--paint);
  scroll-margin-top: 1.5rem;
}

.department h3 {
  font-size: 1.35rem;
}

.department h4 {
  margin-top: 0.4rem;
  font-size: 1rem;
}

.budget {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: var(--concrete);
}

.budget--warning {
  background: var(--blush);
}

.budget--stopped {
  background: var(--stop-wash);
}

.budget-note {
  font-size: var(--t-small);
  font-weight: 600;
}

.meter {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sign);
}

.budget--warning .meter span {
  background: var(--lane);
}

.budget--stopped .meter span {
  background: var(--stop);
}

.programmes {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.programmes li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-place {
  color: var(--muted);
  font-size: var(--t-small);
}


/* ---------- Health: earned value, critical path, escalations ---------- */

.health {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.gauge {
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--paint);
}

.gauge dt {
  color: var(--muted);
  font-size: var(--t-small);
}

.gauge dd {
  margin: 0.1rem 0 0;
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.gauge--low {
  border-color: var(--lane);
  background: var(--blush);
}

.escalations {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.escalation,
.scope-change {
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--stop);
  border-left-width: 5px;
  border-radius: 12px;
  background: var(--stop-wash);
}

.scope-change {
  display: grid;
  gap: 0.6rem;
  border-color: var(--sign);
  background: var(--concrete);
}

.scope-change .approval-actions {
  grid-column: auto;
}

.tag--kind {
  background: var(--concrete);
  color: var(--sign-deep);
}

.tag--critical {
  background: var(--lane);
  color: #fff;
}

.tag--waits {
  background: var(--stop-wash);
  color: var(--stop-deep);
}

.task-more .form {
  margin-top: 0.9rem;
}


/* ---------- Compliance ---------- */

.compliance {
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
}

.compliance-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.compliance h3 {
  font-size: 1.25rem;
}

.controls {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-small);
}

.control-state {
  display: inline-block;
  min-width: 6.5rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}

.control-state--pass {
  background: var(--concrete);
  color: var(--sign-deep);
}

.control-state--fail {
  background: var(--stop);
  color: #fff;
}

.control-state--warning {
  background: var(--blush);
  color: var(--sign-deep);
}

.control-state--not_evaluated {
  border: 1px dashed var(--edge);
  color: var(--muted);
}


/* ---------- Public pages: Features, Trust, Pricing, Contact ---------- */

.site-page .actions {
  margin-top: 1.5rem;
}

.layers h3 {
  margin-top: 0.3rem;
}

.level-cards,
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.level-card,
.trust-item {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--paint);
}

.level-card h3,
.trust-item h3 {
  font-family: var(--body);
  font-size: 1.15rem;
  font-weight: 600;
}

.level-card:nth-child(3) {
  box-shadow: inset 4px 0 0 var(--lane);
}

.level-cards + .hint {
  margin-top: 1rem;
}

.logo-wall-title {
  margin-top: 1.75rem;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
}

.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.6rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.logo-wall li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--paint);
  font-weight: 600;
}

.logo-wall + .hint {
  margin-top: 1.25rem;
}

.planned {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0.5rem 1.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.planned li {
  padding: 0.55rem 0 0.55rem 1.6rem;
  border-bottom: 1px dashed var(--edge);
  background: no-repeat left 0.95rem / 0.75rem 0.75rem
    radial-gradient(circle, transparent 45%, var(--muted) 46%, var(--muted) 60%, transparent 61%);
}

.trust-subtitle {
  margin-top: 2.25rem;
  font-size: 1.4rem;
}

.trust-text {
  max-width: 62ch;
  margin-top: 0.5rem;
}

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: stretch;
  gap: 1rem;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.tier {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 0.6rem;
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: var(--paint);
}

.tier--main {
  border: 2px solid var(--sign);
  box-shadow: inset 0 5px 0 var(--lane);
}

.tier h2 {
  font-size: 1.6rem;
}

.tier-for {
  color: var(--muted);
}

.tier-price {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
}

.tier-price span {
  font-family: var(--body);
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--muted);
}

.tier .btn {
  justify-self: start;
}

.checklist {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 0.45em;
  left: 0.15rem;
  width: 0.7rem;
  height: 0.38rem;
  border-bottom: 2.5px solid var(--sign);
  border-left: 2.5px solid var(--sign);
  transform: rotate(-45deg);
}

.checklist-planned {
  color: var(--muted);
}

.checklist-planned::before {
  border-color: var(--edge) !important;
}

.contact-layout {
  display: grid;
  align-items: start;
  gap: 2rem 3rem;
}

@media (min-width: 60rem) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  }
}

.contact-points {
  margin-top: 1.5rem;
}

.contact-form {
  border: 1px solid var(--edge);
  border-radius: 18px;
}

.contact-form select {
  min-height: 2.75rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--sign);
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* ---------- What the agent knows: documents and memory ---------- */

.knowledge {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
  gap: 1rem;
  margin-top: 2rem;
}

.know {
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1.15rem 1.15rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  scroll-margin-top: 1.5rem;
}

.know h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
}

.know-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-small);
}

.know-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--edge);
}

.know-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.know .form {
  margin-top: 0.8rem;
}


/* ---------- Executive briefings ---------- */

.adviser-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.adviser {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--paint);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.adviser:hover {
  border-color: var(--sign);
  background: var(--concrete);
}

.adviser span {
  color: var(--sign);
  font-size: var(--t-small);
  font-weight: 600;
}

.adviser-pick + .hint {
  margin-top: 0.75rem;
}

.briefing {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  box-shadow: inset 4px 0 0 var(--sign);
  scroll-margin-top: 1.5rem;
}

.briefing h2 {
  font-size: 1.4rem;
}

.briefing-body {
  display: grid;
  gap: 0.7rem;
  max-width: 68ch;
}

.figures td,
.figures th {
  white-space: nowrap;
}

.figures td:first-child {
  white-space: normal;
}

/* Four layers sit two by two, so none is left alone on a row. */
@media (min-width: 48rem) {
  .steps.layers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps.layers p {
    max-width: 46ch;
  }
}

/* Organisation page: same soft tiles as Connections, and tidy rows. */
.org-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem;
}

.btn--round {
  min-height: 2.5rem;
  padding: 0.35rem 1rem;
  border-width: 1px;
  border-radius: 999px;
}

.org-grid .plate {
  border: 1px solid var(--edge);
  border-radius: 16px;
}

.org-grid .plate h2 {
  font-size: 1.35rem;
}

.org-grid .plate form {
  margin-top: 0.3rem;
}

.inline-form select {
  flex: 0 1 12rem;
  width: auto;
  min-width: 8rem;
}

.trust-grid + .hint {
  margin-top: 1.25rem;
}

/* ---------- Support: tickets ----------
   The same soft tiles as Connections. Pink still means "moving": a ticket the
   team has answered carries the pink lane, because it is now the person's turn.
   The team's own words sit on the lilac of the purple sign. */

.nav-count {
  display: inline-block;
  min-width: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--lane);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3rem;
  text-align: center;
}

/* The Support page is one column: words, then the button, then the list. */
.support-top {
  display: grid;
  justify-items: start;
  gap: 1.1rem;
  max-width: 52rem;
}

.team-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1rem;
  width: fit-content;
  margin-top: 1.25rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--edge);
  border-radius: 1.4rem;
  background: var(--concrete);
  font-size: var(--t-small);
}

.team-strip a {
  font-weight: 600;
}

.tile {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--paint);
}

.tile h2 {
  font-size: 1.35rem;
}

.tile .form,
.tile.form {
  margin-top: 0.3rem;
}

.tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.tile-head a {
  font-size: var(--t-small);
  font-weight: 500;
}

.new-ticket {
  max-width: 52rem;
  margin-top: 1.75rem;
  scroll-margin-top: 1.5rem;
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  align-items: start;
  gap: 1.1rem;
  width: 100%;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

.attach input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px dashed var(--edge);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
}

.attach input[type="file"]:hover {
  border-color: var(--sign);
}

.attach input[type="file"]::file-selector-button {
  min-height: 2.25rem;
  margin-right: 0.8rem;
  padding: 0.3rem 0.8rem;
  border: 2px solid var(--sign);
  border-radius: 8px;
  background: transparent;
  color: var(--sign);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.attach-list {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-small);
}

.attach-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: var(--concrete);
  overflow-wrap: anywhere;
}

.attach-list li.is-bad {
  background: var(--stop-wash);
  color: var(--stop-deep);
}

.ticket-section {
  max-width: 52rem;
  margin-top: 2.5rem;
}

.ticket-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.ticket-section-head h2 {
  font-size: 1.9rem;
}

/* A choice between two or more lists, set as one pill. */
.switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 1.4rem;
  background: var(--concrete);
  font-size: var(--t-small);
}

.switch a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.switch a:hover {
  color: var(--sign-deep);
}

.switch a[aria-current="true"] {
  background: var(--paint);
  box-shadow: 0 0 0 1px var(--edge);
  color: var(--sign-deep);
}

.switch-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.ticket-list {
  display: grid;
  gap: 0.6rem;
  max-width: 56rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.8rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.ticket-row:hover {
  border-color: #bda6d3;
  color: var(--ink);
}

.ticket-row.is-answered {
  box-shadow: inset 4px 0 0 var(--lane);
}

.ticket-row.is-urgent {
  box-shadow: inset 4px 0 0 var(--stop);
}

.ticket-main {
  display: grid;
  flex: 1;
  gap: 0.15rem;
  min-width: 0;
}

.ticket-subject {
  overflow-wrap: anywhere;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.ticket-no {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.ticket-meta {
  color: var(--muted);
  font-size: var(--t-small);
  overflow-wrap: anywhere;
}

.tag--closed {
  background: #ece6f1;
  color: var(--muted);
}

/* One ticket: a column narrow enough to read like a letter. */
.support--ticket > * {
  max-width: 48rem;
}

.ticket-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ticket-head .ticket-no {
  font-size: var(--t-small);
  font-weight: 600;
}

.ticket-head h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
  line-height: 1.15;
}

.ticket-tags {
  display: inline-flex;
  gap: 0.4rem;
}

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.ticket-actions form {
  margin: 0;
}

/* A form that stays folded until it is asked for. */
.reveal > summary {
  width: fit-content;
  list-style: none;
  cursor: pointer;
}

.reveal > summary::-webkit-details-marker {
  display: none;
}

.reveal[open] {
  flex-basis: 100%;
}

.reveal[open] > summary.btn {
  background: var(--concrete);
}

.reveal > .form {
  margin-top: 0.9rem;
}

.reveal--plain > summary {
  color: var(--sign);
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
}

.thread {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.message {
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  scroll-margin-top: 1.5rem;
}

.message--staff {
  border-color: transparent;
  background: var(--concrete);
  box-shadow: inset 4px 0 0 var(--sign);
}

.message--internal {
  border: 1.5px dashed var(--muted);
}

.message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  font-size: var(--t-small);
}

.message-who {
  font-weight: 700;
}

.message--staff .message-who {
  color: var(--sign-deep);
}

.message-when {
  color: var(--muted);
}

.message-body {
  max-width: 68ch;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.attachment {
  display: grid;
  gap: 0.15rem;
  width: 10.5rem;
  padding: 0.4rem 0.4rem 0.5rem;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.8125rem;
  text-decoration: none;
}

.attachment:hover {
  border-color: var(--sign);
  color: var(--ink);
}

.attachment img,
.attachment-kind {
  width: 100%;
  height: 7rem;
  border-radius: 6px;
  background: var(--concrete);
}

.attachment img {
  object-fit: cover;
}

.attachment-kind {
  display: grid;
  place-items: center;
  color: var(--sign-deep);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
}

.attachment-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-size {
  color: var(--muted);
}

.tile.reply,
.tile.closed-note {
  margin-top: 1.25rem;
}

/* The team console */
.team-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem 1rem;
  max-width: 56rem;
  margin-top: 1.5rem;
}

.team-filter .field {
  flex: 0 1 12rem;
  width: auto;
}

.team-filter .field:first-of-type {
  flex: 1 1 18rem;
}

.switch--wide {
  margin-top: 1.25rem;
}

.team-layout {
  display: grid;
  align-items: start;
  gap: 1.5rem;
}

@media (min-width: 60rem) {
  .team-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
    gap: 2rem;
  }
}

.team-side {
  display: grid;
  gap: 1rem;
}

.team-side .tile.form {
  margin-top: 0;
}

.team-filter input,
.team-filter select,
.team-filter .btn {
  height: 2.9rem;
}

.facts {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  font-size: var(--t-small);
}

.facts dt {
  margin-top: 0.5rem;
  font-weight: 700;
}

.facts dt:first-child {
  margin-top: 0;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Phones: the top bar's links wrap instead of running off the screen. */
@media (max-width: 40rem) {
  .top-nav {
    flex-wrap: wrap;
    row-gap: 0.3rem;
  }

  .ticket-row {
    flex-wrap: wrap;
  }

  .ticket-main {
    flex-basis: 100%;
  }
}

/* ---------- Homepage: the orbit ----------
   Viklone sits in the middle; the tools it connects circle it. The inner ring is
   what is connected today, the outer ring what it runs on and what is planned.
   A change in one tool travels in on a pink line and out on a purple one.
   The scene is drawn at 640 x 640 and scaled to its box (--k, set by orbit.js;
   container units do it without the script). */

.band--orbit {
  overflow: hidden;
  background: var(--concrete);
}

.orbit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 2rem 3rem;
}

@media (min-width: 60rem) {
  .orbit-layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

.orbit-key {
  display: grid;
  gap: 1rem;
  max-width: 34rem;
  margin: 2rem 0 0;
}

.orbit-key dt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
}

.orbit-key dd {
  margin: 0.15rem 0 0 1.45rem;
  color: var(--muted);
}

.key-dot {
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
}

.key-dot--connected {
  background: var(--sign);
}

.key-dot--runs {
  border: 2px solid var(--sign);
  background: #fff;
}

.key-dot--planned {
  border: 2px dashed #9c88ad;
  background: transparent;
}

.orbit {
  position: relative;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  aspect-ratio: 1;
  container-type: inline-size;
}

.orbit-scene {
  --k: tan(atan2(100cqw, 640px));
  position: absolute;
  top: 0;
  left: 0;
  width: 640px;
  height: 640px;
  transform: scale(var(--k));
  transform-origin: 0 0;
}

.orbit-paths,
.orbit-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.orbit-path {
  fill: none;
  stroke: #b9a3cf;
  stroke-width: 1.5;
  stroke-dasharray: 3 9;
  animation: orbit-drift 50s linear infinite;
}

.orbit-path--outer {
  stroke: #cfc0dd;
  stroke-dasharray: 2 10;
  animation-direction: reverse;
  animation-duration: 70s;
}

@keyframes orbit-drift {
  to {
    stroke-dashoffset: -300;
  }
}

.trace {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 0.6 1;
  stroke-dashoffset: 0.6;
}

.trace line {
  stroke-width: 3;
}

.trace line:first-child {
  stroke-width: 11;
  opacity: 0.3;
}

.trace--in line {
  stroke: var(--lane);
}

.trace--out line {
  stroke: var(--sign);
}

/* The rings turn; each face turns back the same amount, so logos stay upright. */
.orbit-ring {
  position: absolute;
  inset: 0;
  animation: orbit-turn 140s linear infinite;
}

.orbit-ring--outer {
  animation-duration: 220s;
  animation-direction: reverse;
}

.orbit-ring--outer .orbit-face {
  animation-direction: normal;
  animation-duration: 220s;
}

@keyframes orbit-turn {
  to {
    transform: rotate(360deg);
  }
}

.orbit-app {
  --r: 168px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
}

.orbit-ring--outer .orbit-app {
  --r: 278px;
}

.orbit-face {
  position: absolute;
  top: 0;
  left: 0;
  translate: -50% -50%;
  animation: orbit-turn 140s linear infinite reverse;
}

.orbit-face .logo {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  box-shadow: 0 8px 18px -10px rgba(76, 22, 121, 0.55), 0 0 0 3px #fff;
  transition: box-shadow 0.3s ease, scale 0.3s ease;
}

.orbit-face .logo svg {
  width: 1.75rem;
  height: 1.75rem;
}

.orbit-face .logo--letters {
  font-size: 1.35rem;
}

.orbit-ring--outer .orbit-face .logo {
  width: 2.75rem;
  height: 2.75rem;
}

.orbit-ring--outer .orbit-face .logo svg {
  width: 1.4rem;
  height: 1.4rem;
}

.orbit-ring--outer .orbit-face .logo--letters {
  font-size: 0.95rem;
}

.orbit-app--runs .logo {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sign);
}

.orbit-app--planned .orbit-face {
  opacity: 0.5;
}

.orbit-app--planned .logo {
  box-shadow: 0 0 0 3px var(--concrete), 0 0 0 4.5px #9c88ad;
}

.orbit-app.is-on .logo {
  scale: 1.15;
  box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--lane), 0 14px 26px -10px rgba(76, 22, 121, 0.6);
}

/* What happened, above the logo: white when it starts here, pink when it lands. */
.orbit-chip {
  --chip: calc(12px * max(1, 0.78 / var(--k)));
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 0.25em 0.7em;
  border: 1.5px solid var(--sign);
  border-radius: 999px;
  background: #fff;
  color: var(--sign-deep);
  font-size: var(--chip);
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  translate: -50% 4px;
  pointer-events: none;
}

.orbit-chip:empty {
  display: none;
}

.orbit-chip.is-result {
  border-color: var(--lane);
  background: var(--lane);
  color: var(--ink);
}

.orbit-chip.is-shown {
  animation: orbit-chip 1.7s ease-out forwards;
}

@keyframes orbit-chip {
  0% {
    opacity: 0;
    translate: -50% 4px;
    scale: 0.85;
  }

  12%,
  80% {
    opacity: 1;
    translate: -50% 0;
    scale: 1;
  }

  100% {
    opacity: 0;
    translate: -50% -4px;
  }
}

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  translate: -50% -50%;
}

.orbit-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 8rem;
  height: 8rem;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 18px 40px -16px rgba(76, 22, 121, 0.55);
  transition: box-shadow 0.4s ease;
}

/* The halo breathes, so the middle reads as alive even between flows. */
.orbit-disc::before,
.orbit-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 95, 174, 0.55);
  border-radius: 50%;
  animation: orbit-breathe 3.6s ease-out infinite;
}

.orbit-disc::after {
  animation-delay: 1.8s;
}

@keyframes orbit-breathe {
  from {
    opacity: 0.7;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

.orbit-core.is-hit .orbit-disc {
  box-shadow: 0 18px 40px -16px rgba(76, 22, 121, 0.55), 0 0 0 12px rgba(255, 95, 174, 0.28);
  transition-duration: 0.1s;
}

.orbit-name {
  position: absolute;
  top: calc(100% + 0.4rem);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.orbit-badge {
  position: absolute;
  top: calc(50% + 6.4rem);
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
}

.orbit-badge span {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--sign);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.35s ease, scale 0.35s ease;
}

.orbit-badge.is-on span {
  opacity: 1;
  scale: 1;
  transition-timing-function: cubic-bezier(0.3, 1.6, 0.5, 1);
}

/* Off screen: the turning stops. Without motion: a still picture. */
.orbit.is-idle .orbit-ring,
.orbit.is-idle .orbit-face,
.orbit.is-idle .orbit-path,
.orbit.is-idle .orbit-disc::before,
.orbit.is-idle .orbit-disc::after {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .orbit-scene *,
  .orbit-scene *::before,
  .orbit-scene *::after {
    animation: none !important;
    transition: none !important;
  }
}
