/* Desire DB. The front page. */

/* ---------- The front: claim and live column ---------- */
.front {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-bottom: 1px solid var(--ink);
}
.claim {
  padding: 1.6rem var(--gutter) 2rem 0;
  border-right: 1px solid var(--ink);
}
.claim h1 {
  font-size: clamp(3.4rem, 7.4vw, 8rem);
  line-height: 0.86;
  margin-bottom: 1.5rem;
  margin-left: -0.03em;
}
.standfirst {
  font-size: clamp(1.12rem, 1.35vw, 1.3rem);
  line-height: 1.42;
  font-weight: 500;
  max-width: 34rem;
}
.standfirst-2 {
  margin-top: 0.8rem;
  max-width: 34rem;
  color: var(--ink-soft);
}
.first-command {
  margin-top: 1.5rem;
  max-width: 36rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.1rem;
}
.proof {
  margin-top: 2rem;
  max-width: 36rem;
  border-top: 1px solid var(--ink);
  font-size: 0.95rem;
}
.proof li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.leader {
  margin-top: 2.4rem;
  max-width: 36rem;
}
.leader h2 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
}
.leader-text {
  columns: 2;
  column-gap: 1.6rem;
  column-rule: 1px solid var(--rule);
  margin-top: 0.7rem;
  font-size: 0.9rem;
  line-height: 1.45;
  hyphens: auto;
}
.leader-text p + p {
  text-indent: 1.2em;
}

.live {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.live-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0 0.55rem var(--gutter);
}
.live-head h2 {
  font-size: 1.9rem;
}
.live-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.live .ads {
  --ad-columns: 3;
  border-top: 1px solid var(--ink);
  flex: 1;
  /* Room for the column before it arrives, so the page below does not jump. */
  min-height: 60rem;
}
.live .ads .ad-group:last-child .ad:last-child {
  border-bottom-color: transparent;
}
.placeholder {
  padding: 1rem var(--gutter);
  color: var(--ink-soft);
  font-size: 0.9rem;
  column-span: all;
}
.live-foot {
  padding: 0.6rem 0 0.7rem var(--gutter);
  border-top: 1px solid var(--ink);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- Bands: every section below the front ---------- */
.band {
  padding-block: 3.2rem 3.4rem;
  border-bottom: 1px solid var(--ink);
}
.band:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.band-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: end;
  margin-bottom: 2rem;
}
.band-head h2 {
  font-size: clamp(2.5rem, 4.6vw, 4.6rem);
  padding-right: var(--gutter);
  max-width: 11em;
}
.band-intro {
  padding-left: var(--gutter);
  border-left: 1px solid var(--ink);
}
.band-intro p {
  max-width: 40rem;
  font-size: 1.08rem;
}
.band h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}
.aside {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 38rem;
}

/* ---------- Search ---------- */
.search-form {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--ink);
  background: #fbf9f3;
}
.field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.45rem 0.9rem 0.5rem;
  border-right: 1px solid var(--ink);
  min-width: 11rem;
}
.field.grow {
  flex: 1;
}
.field span {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input,
.field select {
  width: 100%;
  padding: 0.1rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.12rem;
  font-weight: 500;
  outline: none;
}
.field select {
  appearance: none;
  padding-right: 1.2rem;
  background: linear-gradient(45deg, transparent 50%, var(--ink) 50%) right 0.35rem center / 0.4rem 0.4rem no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) right 0 center / 0.4rem 0.4rem no-repeat;
  cursor: pointer;
}
.field:focus-within {
  box-shadow: inset 0 -4px 0 var(--marker), inset 0 0 0 2px var(--ink);
}
.field input::placeholder {
  color: #6b675e;
}
.search-form .button {
  border: 0;
  min-width: 8rem;
  font-size: 1.05rem;
}
.tries {
  margin-top: 0.8rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  align-items: baseline;
}
.tries button {
  padding: 0.15rem 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.tries button:hover {
  text-decoration-thickness: 2px;
}
.request-line {
  margin-top: 1.4rem;
}
.search-status {
  min-height: 1.6rem;
  margin-top: 0.8rem;
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.7rem;
}
.search-status .error {
  font-weight: 600;
}
.search-status button {
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  cursor: pointer;
}
/* The results sit in rows, not in flowing columns: the first is the best, and the eye reads across. */
.search-results {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(var(--ad-columns), minmax(0, 1fr));
  --ad-columns: 4;
  margin-top: 0.8rem;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}
.search-results:empty {
  border: 0;
}
.search-results .ad {
  font-size: 0.92rem;
  padding: 0.7rem 0.8rem 0.75rem;
  border-right: 1px solid var(--rule);
}

/* ---------- The record ---------- */
.record-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.record-form {
  padding-right: var(--gutter);
}
.record-form > label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.record-form textarea {
  display: block;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fbf9f3;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.35;
  resize: vertical;
}
.record-form textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  box-shadow: inset 0 -4px 0 var(--marker);
}
.record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 0.8rem;
}
.hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex: 1 1 14rem;
}
.record-status {
  min-height: 1.5rem;
  margin-top: 0.7rem;
  font-size: 0.92rem;
}
.record-status .error {
  font-weight: 600;
}
.after-post {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
}
.after-post p {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

.slip {
  padding-left: var(--gutter);
  border-left: 1px solid var(--ink);
  min-width: 0;
}
.slip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--ink);
}
.slip-view {
  display: flex;
}
.slip-view button {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.slip-view button + button {
  border-left: 0;
}
.slip-view button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.slip-sentence {
  padding: 1rem 0;
  font-size: clamp(1.25rem, 1.9vw, 1.7rem);
  font-weight: 600;
  line-height: 1.32;
  border-bottom: 1px solid var(--ink);
  text-wrap: pretty;
}
.slip-sentence mark {
  color: inherit;
  background: linear-gradient(rgb(255 74 28 / 0.42), rgb(255 74 28 / 0.42)) no-repeat left 72% / 0% 58%;
  transition: background-size 0.5s var(--ease-out);
  padding-inline: 0.06em;
  margin-inline: -0.06em;
}
.slip-sentence mark.is-lit {
  background-size: 100% 58%;
}
.slip-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.4rem;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.slip-key span::before {
  content: "";
  display: inline-block;
  width: 1.6rem;
  margin-right: 0.5rem;
  vertical-align: 0.25em;
  border-top: 3px solid var(--marker);
}
.slip-key .key-yours::before {
  border-top: 1px solid var(--ink-soft);
}
#slip-json pre {
  max-height: 32rem;
}

/* ---------- The handshake ---------- */
.handshake {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto 1fr;
}
.stage {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.steps-col {
  padding-right: var(--gutter);
}
.steps {
  counter-reset: step;
  border-top: 1px solid var(--ink);
}
.steps li {
  counter-increment: step;
  border-bottom: 1px solid var(--rule);
}
.steps button {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0 0.4rem;
  width: 100%;
  padding: 0.75rem 0.6rem 0.8rem 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--ink-soft);
}
.steps button::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.3rem;
  line-height: 0.9;
  color: var(--ink);
  opacity: 0.28;
}
.steps button b {
  font-size: 1.02rem;
  color: var(--ink);
}
.steps button span {
  font-size: 0.93rem;
  line-height: 1.45;
}
.steps button:hover b {
  text-decoration: underline;
}
.steps li.is-now button {
  color: var(--ink);
  box-shadow: inset -4px 0 0 var(--marker);
}
.steps li.is-now button::before,
.steps li.is-done button::before {
  opacity: 1;
}
.steps-actions {
  grid-column: 1;
  grid-row: 2;
  margin-top: 1.1rem;
}

.stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-left: 1px solid var(--ink);
  border-top: 1px solid var(--ink);
  min-height: 25rem;
}
.lane {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem 1rem;
  border-right: 1px solid var(--rule);
  font-size: 0.88rem;
  line-height: 1.4;
  min-width: 0;
}
.lane:last-child {
  border-right: 0;
}
.lane h3 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 0.5rem;
}
.lane h3 code {
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: none;
  color: var(--ink-soft);
}
.lane-server {
  background: var(--paper-deep);
}
.lane-item {
  padding: 0.55rem 0.65rem 0.6rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  transition: opacity 0.4s, transform 0.4s var(--ease-out), visibility 0s 0.4s, border-color 0.3s;
}
.lane-item.is-on {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}
.lane-item.is-gone {
  display: none;
}
.lane-item.is-now {
  border-color: var(--ink);
  box-shadow: inset 4px 0 0 var(--marker);
}
.lane-item p + p {
  margin-top: 0.3rem;
}
.lane-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.lane-contact {
  font-size: 0.84rem;
}
.lane-contact .redact {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.15rem;
  font-size: 0.8rem;
}
.quiet {
  color: var(--ink-soft);
}
.wire,
.cipher {
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.wire {
  color: var(--ink-soft);
}
.cipher {
  padding: 0.25rem 0.4rem;
  background: var(--sealed);
  color: #e6f0ee;
}
.lane-foot {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--ink);
  font-weight: 700;
  color: var(--sealed);
}
.sealed-foot {
  margin-top: 1.6rem;
  max-width: 52rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- Quickstart ---------- */
.switch {
  display: inline-flex;
  border: 2px solid var(--ink);
}
.switch button {
  padding: 0.6rem 1.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 650;
  font-size: 1.02rem;
  cursor: pointer;
}
.switch button + button {
  border-left: 2px solid var(--ink);
}
.switch button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}
/* Each step is a row on the page grid: what it is on the left, what to run on the right. */
.start-panel {
  border-top: 1px solid var(--ink);
}
.start-step {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-bottom: 1px solid var(--rule);
}
.start-step:last-child {
  border-bottom: 0;
}
.start-say {
  padding: 1.3rem var(--gutter) 1.5rem 0;
}
.start-do {
  min-width: 0;
  padding: 1.4rem 0 1.5rem var(--gutter);
  border-left: 1px solid var(--ink);
}
.start-step h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}
/* The steps of a person are a sequence, so they carry numbers. The three ways of an agent are not. */
#panel-person {
  counter-reset: start;
}
#panel-person .start-step h3::before {
  counter-increment: start;
  content: counter(start);
  display: inline-block;
  min-width: 1.4em;
  opacity: 0.35;
}
.start-say p {
  font-size: 0.98rem;
  max-width: 30rem;
}
.start-do > p {
  max-width: 40rem;
}
.start-do > p + p,
.start-do .code + .code {
  margin-top: 0.8rem;
}

/* ---------- Open data ---------- */
.open-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.open-grid > div:first-child {
  padding-right: var(--gutter);
}
.open-grid > div:last-child {
  padding-left: var(--gutter);
  border-left: 1px solid var(--ink);
}
.machine-list {
  margin-top: 0.6rem;
  border-top: 1px solid var(--ink);
}
.machine-list li {
  display: grid;
  grid-template-columns: minmax(11rem, 2fr) 3fr;
  gap: 0 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.machine-list code {
  background: none;
  padding: 0;
}
.machine-list span {
  color: var(--ink-soft);
}

/* ---------- Wide and narrow screens ---------- */
@media (min-width: 1640px) {
  .live .ads {
    --ad-columns: 4;
  }
}
@media (max-width: 1180px) {
  .live .ads {
    --ad-columns: 2;
  }
  .search-results {
    --ad-columns: 3;
  }
}
@media (max-width: 900px) {
  .front,
  .band-head,
  .record-grid,
  .handshake,
  .start-step,
  .open-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .start-say {
    padding: 1.2rem 0 0;
  }
  .start-do {
    padding: 0.8rem 0 1.5rem;
    border-left: 0;
  }
  .claim {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }
  .live-head,
  .live-foot {
    padding-left: 0;
  }
  .band {
    padding-block: 2.4rem 2.6rem;
  }
  .band-head {
    margin-bottom: 1.4rem;
  }
  .band-head h2 {
    padding-right: 0;
    margin-bottom: 0.9rem;
  }
  .band-intro {
    padding-left: 0;
    border-left: 0;
  }
  .record-form,
  .steps-col,
  .open-grid > div:first-child {
    padding-right: 0;
  }
  .slip,
  .open-grid > div:last-child {
    padding-left: 0;
    border-left: 0;
    margin-top: 2rem;
  }
  .handshake {
    grid-template-rows: none;
  }
  .stage {
    grid-column: 1;
    grid-row: auto;
    margin-top: 1.6rem;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
  }
  /* The button follows the reader down the stage, so each step shows where it happens. */
  .steps-actions {
    grid-row: auto;
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 0;
    padding-block: 0.7rem;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
  }
  .steps li:not(.is-now) button span {
    display: none;
  }
  .search-form {
    flex-wrap: wrap;
  }
  .field {
    flex: 1 1 40%;
    border-bottom: 1px solid var(--ink);
  }
  .field.grow {
    flex-basis: 100%;
    border-right: 0;
  }
  .search-form .button {
    flex: 1 1 100%;
  }
  .search-results {
    --ad-columns: 2;
  }
}
@media (max-width: 640px) {
  .leader-text {
    columns: 1;
  }
  .claim h1 {
    font-size: 16.4vw;
    margin-bottom: 1.2rem;
  }
  .live .ads,
  .search-results {
    --ad-columns: 1;
  }
  .live .ads {
    min-height: 40rem;
  }
  .search-results .ad {
    border-right: 0;
  }
  .search-results {
    border-left: 0;
  }
  /* A phone shows the first ads of the column. The search below holds the rest. */
  .live .ads .ad-group:nth-child(n + 5) {
    display: none;
  }
  .field {
    flex-basis: 100%;
    border-right: 0;
  }
  .stage {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .lane {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }
  .lane:last-child {
    border-bottom: 0;
  }
  .lane-item:not(.is-on) {
    display: none;
  }
  .machine-list li {
    grid-template-columns: minmax(0, 1fr);
  }
  .switch {
    display: flex;
  }
  .switch button {
    flex: 1;
    padding-inline: 0.5rem;
  }
}
