/* "From public record to paid claim" and "Your data": how we work, and what
   happens to what we know about you on the way. */

.process-section {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.process {
  margin-top: var(--s-7);
}

/* The steps: a list to choose from on the left, the chosen one on the right. */

.process-tabs {
  display: grid;
  border-top: 1px solid var(--line);
}

.process-tab {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 4rem;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-md);
  text-align: left;
  cursor: pointer;
  transition: color var(--dur-fast) ease;
}

.step-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.process-tab.is-active {
  color: var(--ink);
  font-weight: 650;
}

.process-tab.is-active .step-number {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

/* Named here because while the tab list is hidden (until tabs.js runs, or for
   good if it never does) the panels would otherwise fall into the narrow column. */
.process-panels {
  grid-column: 2;
}

/* All three steps show until tabs.js has run. Then they need air between
   them; once they are tabs only one shows, and this matches nothing. */
.process-detail:not([hidden]) ~ .process-detail {
  margin-top: var(--s-8);
}

.process-detail.is-entering {
  animation: panel-in var(--dur-normal) var(--ease-out);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes panel-fade {
  from {
    opacity: 0;
  }
}

.process-detail h3 {
  margin-top: var(--s-6);
}

.process-detail > p {
  max-width: 36rem;
  margin-top: var(--s-4);
  color: var(--muted);
  font-size: var(--text-md);
}

.process-detail > .data-note {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--text-sm);
}

.data-note .icon {
  margin-top: 0.22em;
  color: var(--forest);
}

/* The drawing at the head of each step. Its shapes carry classes, not
   colours, so the palette stays in one place. */

.step-art {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  background: var(--mint);
}

.art-soft {
  fill: var(--moss);
}

.art-mid {
  fill: #a9bbae;
}

.art-ink {
  fill: var(--forest);
}

.art-paper {
  fill: #fff;
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.art-line {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-node {
  fill: #fff;
  stroke: var(--forest);
  stroke-width: 2;
}

.art-found {
  fill: #fff;
  stroke: var(--gold);
  stroke-width: 2;
}

.art-gold {
  fill: var(--gold);
}

.art-gold-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-sign {
  fill: none;
  stroke: var(--forest);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.art-coin-sign {
  fill: var(--pine);
  font-family: var(--body);
  font-size: 19px;
  font-weight: 700;
}

/* When a step is chosen, its drawing plays once, in the order the step
   happens: the row is found and then traced to a person; the letter comes out
   and then its code; the claim goes to the state and then the money comes
   back. The step the page opens on is already drawn. Each piece ends where it
   rests, so a browser that plays none of this shows the finished drawing. */

/* The gap is longer than the line, so that a line not yet drawn leaves no
   dot behind where its rounded end would be. */
.art-draw {
  stroke-dasharray: 1 2;
}

.art-pop {
  transform-box: fill-box;
  transform-origin: center;
}

.is-entering .art-draw {
  animation: art-draw calc(var(--dur-draw) * 0.6) var(--ease-in-out) backwards;
}

.is-entering .art-pop {
  animation: art-pop var(--dur-move) var(--ease-out) backwards;
}

.is-entering .art-rise {
  animation: art-rise calc(var(--dur-draw) * 0.6) var(--ease-out) backwards;
}

.is-entering .art-fade {
  animation: panel-fade var(--dur-normal) ease backwards;
}

.is-entering .art-late {
  animation-delay: calc(var(--stagger) * 8);
}

.is-entering .art-second {
  animation-delay: calc(var(--stagger) * 12);
}

.is-entering .art-last {
  animation-delay: calc(var(--stagger) * 24);
}

@keyframes art-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes art-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes art-rise {
  from {
    transform: translateY(24px);
  }
}

/* Your data */

.data-section {
  padding: var(--section) 0;
  background: var(--mint);
}

.redaction {
  container-type: inline-size;
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* Two radio buttons dressed as one switch. The browser already knows how a
   radio group takes the arrow keys, so there is no script behind this. */
.switch {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--mint);
}

.switch label {
  position: relative;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch span {
  display: block;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.switch input:checked + span {
  background: var(--forest);
  color: #fff;
}

.switch input:focus-visible + span {
  outline: 3px solid var(--forest);
  outline-offset: 2px;
}

.record-light {
  border-top-color: var(--line);
}

.record-light > div {
  border-bottom-color: var(--line);
}

.record-light dt {
  color: var(--muted);
}

.redacted {
  display: none;
  padding: 0 var(--s-3);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
}

/* The switch works by the page noticing which radio is on. A browser that
   cannot notice keeps the first view, and (at the foot of this file) is not
   shown a switch that would do nothing. */
@supports selector(:has(a)) {
  .redaction:has(input[value="model"]:checked) .plain {
    display: none;
  }

  .redaction:has(input[value="model"]:checked) .redacted {
    display: inline-block;
    animation: panel-fade var(--dur-normal) ease;
  }
}

.data-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6) var(--s-7);
  margin-top: var(--s-7);
}

.data-list dt {
  font-weight: 650;
}

.data-list dd {
  margin-top: var(--s-1);
  color: var(--muted);
  font-size: var(--text-sm);
}

@media (hover: hover) and (pointer: fine) {
  .process-tab:hover {
    color: var(--ink);
  }
}

/* Less motion: the panel fades instead of rising, and its drawing is simply there. */
@media (prefers-reduced-motion: reduce) {
  .process-detail.is-entering {
    animation-name: panel-fade;
  }

  .is-entering :is(.art-draw, .art-pop, .art-rise, .art-fade) {
    animation: none;
  }
}

@media (pointer: coarse) {
  .switch span {
    display: grid;
    place-items: center;
    min-height: 2.75rem;
  }
}

@media (max-width: 56rem) {
  .process {
    margin-top: var(--s-6);
  }

  .process-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }

  .process-tab {
    justify-content: center;
    gap: var(--s-2);
    min-height: 3.5rem;
    border-bottom: 2px solid transparent;
    font-size: var(--text-base);
  }

  .process-tab.is-active {
    border-bottom-color: var(--forest);
  }

  .process-panels {
    grid-column: auto;
  }
}

@media (max-width: 34rem) {
  .step-number {
    width: 1.5rem;
    height: 1.5rem;
    font-size: var(--text-xs);
  }

  .redaction {
    padding: var(--s-4);
  }

  .switch {
    display: flex;
  }

  .switch label {
    flex: 1;
    text-align: center;
  }

  .data-list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
  }
}

/* Last, so that nothing above can bring it back. */
@supports not selector(:has(a)) {
  .switch {
    display: none;
  }
}
