/* The first screen: what we do in one sentence, and beside it the one loud
   thing on the page, a record being matched. Behind the panel is the rosette,
   pale enough to be paper and fine enough to say "money" before a word is read. */

.hero {
  /* The rosette is wider than its column and must not widen the page. The
     first line is for browsers that do not know the second. */
  overflow-x: hidden;
  overflow-x: clip;
  padding: clamp(3rem, 1.5rem + 5vw, 5.5rem) 0 var(--section);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gutter);
  align-items: center;
}

.lede {
  max-width: 34rem;
  margin-top: var(--s-5);
  color: var(--muted);
  font-size: var(--text-md);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-6);
  margin-top: var(--s-6);
}

/* Three things a stranger wants to know before reading on, said once, quietly. */
.assurances {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
}

.assurances li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.assurances .icon {
  color: var(--forest);
}

.hero-visual {
  position: relative;
  isolation: isolate;
}

/* Sized from the panel it sits behind, so the two keep their proportion at
   every width. */
.hero-visual::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(46rem, 165%);
  aspect-ratio: 1;
  background: #b4c2b3;
  transform: translate(-50%, -50%);
  -webkit-mask: url(/guilloche.svg) center / contain no-repeat;
  mask: url(/guilloche.svg) center / contain no-repeat;
  pointer-events: none;
}

/* Beside the headline, the rosette's left edge would run under the last words
   of a line. There it fades out before it reaches them. */
@media (min-width: 56.01rem) {
  .hero-visual::before {
    -webkit-mask-image: url(/guilloche.svg), linear-gradient(to right, transparent 6%, #000 34%);
    -webkit-mask-size: contain, 100% 100%;
    -webkit-mask-composite: source-in;
    mask-image: url(/guilloche.svg), linear-gradient(to right, transparent 6%, #000 34%);
    mask-size: contain, 100% 100%;
    mask-composite: intersect;
  }
}

/* The record panel */

/* The panel is asked how wide it is, not the window: beside the headline on
   a laptop it can be narrower than it is on a phone held upright. */
.resolver {
  container-type: inline-size;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: var(--forest-deep);
  color: var(--on-dark);
  box-shadow: 0 2rem 3.5rem -2rem rgba(10, 38, 31, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.resolver :focus-visible {
  outline-color: var(--gold);
}

.resolver-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}

.resolver-title {
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

.resolver-flag {
  color: var(--on-dark-muted);
  font-size: var(--text-xs);
}

/* Four samples, four equal buttons in one row: a chip left to wrap on to a
   line of its own looks like a leftover. */
.chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.chip {
  min-height: 2.5rem;
  padding: var(--s-1) var(--s-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--r-pill);
  background: transparent;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    transform var(--dur-press) var(--ease-out);
}

.chip:active {
  transform: scale(0.97);
}

.chip.is-active {
  border-color: var(--on-dark);
  background: var(--on-dark);
  color: var(--forest-deep);
  font-weight: 650;
}

/* One tick is one row of the state's file. The sweep passes over them and one
   of them is the match. */
.scan {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 2rem;
  margin-top: var(--s-5);
}

.scan span {
  flex: 1;
  height: 55%;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.14);
  transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.scan .is-seen {
  background: rgba(143, 208, 174, 0.5);
}

.scan .is-head {
  background: #fff;
  transform: scaleY(1.5);
}

.scan .is-hit {
  background: var(--gold);
  transform: scaleY(1.8);
}

.record {
  margin-top: var(--s-4);
  border-top: 1px solid var(--on-dark-rule);
}

.record > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--on-dark-rule);
}

.record dt {
  color: var(--on-dark-muted);
  font-size: var(--text-sm);
}

/* Fixed to one line so a value changing length never moves the rows below. */
.record dd {
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.signals {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.signals li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--on-dark-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
  transition: color var(--dur-normal) ease;
}

.signals li::before {
  content: "";
  position: absolute;
  top: 0.2em;
  left: 0;
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0.6;
  transition: background var(--dur-normal) ease, border-color var(--dur-normal) ease, opacity var(--dur-normal) ease,
    transform var(--dur-move) var(--ease-out);
}

.signals .is-done {
  color: var(--on-dark);
}

.signals .is-done::before {
  border-color: var(--sprout);
  background: var(--sprout);
  opacity: 1;
}

.signals .is-match {
  font-weight: 650;
}

.signals .is-match::before {
  border-color: var(--gold);
  background: var(--gold);
  transform: scale(1.2);
}

/* Narrower than this, four chips in a row would cut their own words short,
   and a long value would not fit beside its label. */
@container (max-width: 23rem) {
  .chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 21rem) {
  .record > div {
    grid-template-columns: 7rem minmax(0, 1fr);
  }

  .record dd {
    font-size: var(--text-xs);
  }
}

@container (max-width: 17rem) {
  .record > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .record dd {
    font-size: var(--text-sm);
  }
}

@media (hover: hover) and (pointer: fine) {
  .chip:not(.is-active):hover {
    border-color: rgba(255, 255, 255, 0.6);
  }
}

@media (max-width: 56rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-7);
  }

  .hero-visual::before {
    width: 38rem;
  }
}

@media (max-width: 34rem) {
  .actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .assurances {
    flex-direction: column;
  }

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

@media (pointer: coarse) {
  .chip {
    min-height: 2.75rem;
  }
}
