@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --bg: #15133c;
  --raise: #211e58;
  --line: #3f3b8f;
  --text: #f4f1ff;
  --muted: #b9b6e2;
  --signal: #ffd23f;
  --on-signal: #15133c;
  --taken: #ff9b91;
  --free: #6fe7bd;
  --hint: #ffd23f;
  --eye: #fff9dc;
  --tint: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1.5'%3E%3Cpath d='M0 11q11-11 22 0t22 0M0 33q11-11 22 0t22 0'/%3E%3Cpath d='M11 0q-11 11 0 22t0 22M33 0q-11 11 0 22t0 22'/%3E%3C/g%3E%3C/svg%3E");
  --display: "Bricolage Grotesque", system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ff;
    --raise: #ffffff;
    --line: #cfcbf0;
    --text: #1c1950;
    --muted: #514e82;
    --signal: #4a32d6;
    --on-signal: #ffffff;
    --taken: #b3261e;
    --free: #0b6b4f;
    --hint: #7a5600;
    --eye: #ffffff;
    --tint: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%234a32d6' stroke-opacity='.1' stroke-width='1.5'%3E%3Cpath d='M0 11q11-11 22 0t22 0M0 33q11-11 22 0t22 0'/%3E%3Cpath d='M11 0q-11 11 0 22t0 22M33 0q-11 11 0 22t0 22'/%3E%3C/g%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* The tint printed inside security envelopes, which hides what is in them. */
.masthead {
  padding: 3.5rem max(1.25rem, calc((100% - 41.5rem) / 2)) 3rem;
  background: linear-gradient(transparent 55%, var(--bg)), var(--tint);
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.brand { display: flex; flex-direction: column; gap: 1rem; }

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 12vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.tagline {
  margin: 1rem 0 2rem;
  font-size: clamp(1.1875rem, 3vw, 1.375rem);
  color: var(--muted);
}

/* Eyes open when idle, dart while a search runs, and close when it ends. */
.eyes { width: 5.5rem; height: auto; }
.eye { transform-box: fill-box; transform-origin: center; transition: transform 0.25s ease; }
.white { fill: var(--eye); stroke: var(--text); stroke-width: 2.5; }
.pupil { fill: #15133c; transition: opacity 0.1s; }

@media (prefers-reduced-motion: no-preference) {
  body:not([data-eyes]) .pupil, body[data-eyes="open"] .pupil { animation: glance 7s ease-in-out infinite; }
  body[data-eyes="watching"] .pupil { animation: dart 0.9s steps(1) infinite; }
}

body[data-eyes="closed"] .eye { transform: scaleY(0.2); }
body[data-eyes="closed"] .pupil { opacity: 0; }

@keyframes glance {
  0%, 70%, 100% { transform: translateX(0); }
  76%, 82% { transform: translateX(-9px); }
  88%, 94% { transform: translateX(9px); }
}

@keyframes dart {
  0% { transform: translate(-9px, 2px); }
  25% { transform: translate(9px, -3px); }
  50% { transform: translate(-4px, 6px); }
  75% { transform: translate(6px, 4px); }
}

.finder label { display: block; margin-bottom: 0.25rem; font-weight: 600; color: var(--muted); }

textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--raise);
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.25rem, 4.5vw, 1.625rem);
  font-weight: 600;
  line-height: 1.35;
  resize: none;
}

textarea::placeholder { color: var(--muted); opacity: 0.75; font-weight: 400; }
textarea:focus { border-color: var(--signal); outline: none; }

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

.actions p { margin: 0; color: var(--taken); }

button {
  min-height: 3rem;
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--signal);
  border-radius: 12px;
  background: var(--signal);
  color: var(--on-signal);
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.6; cursor: progress; }

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

#summary { scroll-margin-top: 1rem; }
#summary h2 { margin: 0; font-family: var(--display); font-size: 1.75rem; }
#summary p { margin: 0 0 1rem; color: var(--muted); }

#results { list-style: none; margin: 0 0 1rem; padding: 0; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raise);
}

.name { font-family: var(--display); font-size: 1.375rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.state { font-weight: 700; line-height: 1.8; text-align: right; color: var(--muted); }

.detail, .seen, .path, .offer, .trail { grid-column: 1 / -1; }
.detail, .seen { margin: 0; font-size: 1rem; }
.detail:empty, .seen:empty { display: none; }
.seen { color: var(--muted); }

.row[data-state="registered"] .state { color: var(--taken); }
.row[data-state="no-record"] .state { color: var(--free); }
.row[data-state="no-delegation"] .state,
.row[data-state="unknown"] .state,
.row[data-state="invalid"] .state { color: var(--hint); }

/* Who saw the name: a line of dots from you to each party. */
.path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0;
  list-style: none;
  margin: 0.5rem 0 0.25rem;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.path[hidden] { display: none; }
.path.maybe { opacity: 0.65; }
.path li { display: flex; align-items: center; gap: 0.375rem; }

.path li::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--signal);
  border-radius: 50%;
  background: var(--signal);
}

.path li.name-only::before { background: transparent; }

.path li:not(:last-child)::after {
  content: "";
  width: 1.5rem;
  margin-right: 0.375rem;
  border-top: 2px dotted var(--muted);
}

.offer { margin-top: 0.5rem; }
.offer button { min-height: 2.75rem; padding: 0.375rem 1rem; background: transparent; color: var(--text); font-size: 1rem; }
.offer p { margin: 0.375rem 0 0; font-size: 0.9375rem; color: var(--muted); }

.trail { margin-top: 0.25rem; font-size: 0.9375rem; color: var(--muted); }
.trail summary { width: fit-content; padding: 0.375rem 0; cursor: pointer; }
.trail ol { margin: 0.25rem 0 0; padding-left: 1.5rem; }
.trail li { overflow-wrap: anywhere; }

.ledger { margin-top: 2.5rem; }
.ledger-title { margin: 0 0 0.75rem; font-family: var(--display); font-size: 1.75rem; }

.fold { border-top: 1px solid var(--line); }
.fold:last-child { border-bottom: 1px solid var(--line); }

.fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.5rem 0;
  cursor: pointer;
  list-style: none;
}

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

.fold > summary::after {
  content: "+";
  flex: none;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--signal);
}

.fold[open] > summary::after { content: "\2212"; }

h3 { margin: 0; font-family: var(--display); font-size: 1.1875rem; font-weight: 700; line-height: 1.25; }

.fold ol, .fold dl { margin: 0 0 1rem; }
.fold ol { padding-left: 1.5rem; }
.fold p { margin: 0 0 0.75rem; color: var(--muted); }
.fold a { color: var(--text); }

dt { margin-top: 0.75rem; font-weight: 700; }
dt:first-child { margin-top: 0; }
dd { margin: 0; color: var(--muted); }

@media (max-width: 30rem) {
  .masthead { padding-top: 1.75rem; padding-bottom: 2rem; }
  .eyes { width: 4.25rem; }
  .tagline { margin-bottom: 1.25rem; }
  .actions button { width: 100%; }
  .row { padding: 0.875rem 1rem; }
  .name, .state { grid-column: 1 / -1; text-align: left; }
}
