/* kya.id: the KYA-OS system (kya-os.org, builders.kya-os.org) applied to one
   credential's life. Dark canvas, dot grid, hairlines, sharp corners. Signal
   colours carry meaning and nothing else: green verified, amber waiting on a
   human, blue the agent, red refused or revoked. */

:root {
  color-scheme: dark;
  --canvas: #0a0a0a;
  --canvas-deep: #060606;
  --panel: rgb(255 255 255 / 0.02);
  --panel-2: rgb(255 255 255 / 0.035);
  --panel-3: rgb(255 255 255 / 0.055);
  --ink-bright: #ffffff;
  --ink: #e0e0e0;
  --ink-2: #b4b4b4;
  --ink-dim: #999999;
  --ink-muted: #808080;
  --line-hair: #141414;
  --line: #1a1a1a;
  --line-quiet: #232323;
  --line-mid: #333333;
  --line-strong: #555555;
  --dot: #1c1c1c;
  --signal: #00ff88;
  --signal-dim: rgb(0 255 136 / 0.14);
  --amber: #ffb340;
  --amber-dim: rgb(255 179 64 / 0.14);
  --info: #66aaff;
  --info-dim: rgb(102 170 255 / 0.14);
  --alert: #ff0040;
  --alert-dim: rgb(255 0 64 / 0.14);
  --lens-a: #3b6cff;
  --lens-b: #ff2d8a;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --page: 1280px;
  --side: clamp(16px, 4vw, 48px);
  --mast-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
}

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

html {
  scroll-padding-top: calc(var(--mast-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

html.motion {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* The KYA-OS dot grid. In chapter 06 it turns out to be a status list. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px);
  background-size: 40px 40px;
  background-position: -20px -20px;
  pointer-events: none;
  z-index: -1;
}

/* Film grain, barely there. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 100;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

code,
pre,
kbd {
  font-family: var(--mono);
}

code {
  font-size: 0.86em;
  color: var(--ink);
}

p code,
li code,
dd code,
span code {
  padding: 0.08em 0.36em;
  background: var(--panel-3);
  border: 1px solid var(--line-quiet);
  white-space: nowrap;
}

::selection {
  background: var(--signal);
  color: #000;
}

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

/* the hidden attribute always wins over a component's display */
[hidden] {
  display: none !important;
}

.dim {
  color: var(--ink-muted);
}

.label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink-bright);
  color: #000;
  font-family: var(--mono);
  font-size: 13px;
}

.skip:focus {
  top: 12px;
}

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

/* ------------------------------------------------------------ buttons */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-line: var(--line-mid);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    background-color 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out),
    transform 0.15s var(--ease-out);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* Waiting on something that will be ready in a moment (the wallet loading). */
.btn[aria-disabled="true"] {
  cursor: progress;
}

.btn--primary {
  --btn-bg: var(--ink);
  --btn-fg: #050505;
  --btn-line: var(--ink);
}

.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.75) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}

.btn--primary:hover:not(:disabled) {
  --btn-bg: var(--ink-bright);
  --btn-line: var(--ink-bright);
}

.btn--primary:hover:not(:disabled)::after {
  transform: translateX(120%);
}

.btn--ghost:hover:not(:disabled) {
  --btn-line: var(--line-strong);
  --btn-bg: var(--panel-2);
}

.btn--danger {
  --btn-fg: var(--alert);
  --btn-line: rgb(255 0 64 / 0.45);
}

.btn--danger:hover:not(:disabled) {
  --btn-bg: var(--alert-dim);
  --btn-line: var(--alert);
}

.btn--small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.btn__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn[aria-busy="true"] {
  pointer-events: none;
}

.btn[aria-busy="true"]::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.linkish {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  cursor: pointer;
}

.linkish:hover:not(:disabled) {
  color: var(--ink);
}

.linkish:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ------------------------------------------------------------ masthead */

.mast {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--mast-h);
  background: rgb(10 10 10 / 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.mast__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--side);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-bright);
}

.brand__mark {
  width: 20px;
  height: 23px;
}

.brand__word {
  display: inline-flex;
  align-items: baseline;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand__bit {
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateY(-1px);
  transition:
    background-color 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
}

[data-cred="live"] .brand__bit {
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}

[data-cred="revoked"] .brand__bit,
[data-cred="expired"] .brand__bit {
  background: var(--alert);
  box-shadow: 0 0 10px var(--alert);
}

.mast__nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.mast__nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.mast__nav a b {
  font-weight: 500;
  color: var(--line-strong);
  transition: color 0.2s;
}

.mast__nav a:hover,
.mast__nav a[aria-current="true"] {
  color: var(--ink-bright);
}

.mast__nav a[aria-current="true"] b {
  color: var(--signal);
}

.mast__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--lens-a), var(--lens-b));
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  max-width: 260px;
  padding: 0 12px;
  border: 1px solid var(--line-mid);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.2s;
}

.chip:hover {
  border-color: var(--line-strong);
}

.chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

[data-cred="none"] .chip__dot {
  background: var(--info);
}

[data-identity="none"] .chip__dot {
  background: var(--line-strong);
}

[data-cred="live"] .chip__dot {
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal);
}

[data-cred="revoked"] .chip__dot,
[data-cred="expired"] .chip__dot {
  background: var(--alert);
}

/* ------------------------------------------------------------ wallet drawer */

.drawer {
  position: fixed;
  top: calc(var(--mast-h) + 10px);
  right: max(var(--side), calc((100vw - var(--page)) / 2 + var(--side)));
  z-index: 60;
  width: min(440px, calc(100vw - 32px));
  padding: 20px;
  background: rgb(12 12 12 / 0.96);
  border: 1px solid var(--line-mid);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
  backdrop-filter: blur(10px);
}

.drawer[hidden] {
  display: none;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.drawer__head .label {
  margin: 0;
}

.drawer__close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-mid);
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.drawer__rows {
  margin: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.drawer__rows div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: var(--canvas);
  font-size: 13px;
}

.drawer__rows dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 2px;
}

.drawer__rows dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.drawer__rows code {
  font-size: 11.5px;
  padding: 0;
  border: 0;
  background: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.drawer__note {
  margin: 14px 0;
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.55;
}

.drawer__note code {
  white-space: normal;
}

.drawer__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ layout */

.chapter {
  position: relative;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(110px, 16vh, 190px) var(--side) 0;
}

.chapter__head {
  max-width: 940px;
  margin-bottom: clamp(40px, 6vh, 72px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.eyebrow b {
  font-weight: 500;
  color: var(--ink-bright);
}

.eyebrow i {
  flex: 1;
  height: 1px;
  max-width: 280px;
  background: var(--line-mid);
}

.eyebrow__meta {
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
}

.title {
  margin: 0;
  font-size: clamp(40px, 6.2vw, 94px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.045em;
  color: var(--ink-bright);
  text-wrap: balance;
}

.lead {
  max-width: 64ch;
  margin: 26px 0 0;
  font-size: clamp(17px, 1.35vw, 19.5px);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.h3 {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink-bright);
}

.footnote {
  max-width: 90ch;
  margin: 22px 0 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* Keeps a hyphenated term on one line, e.g. "one-bit". */
.nobr {
  white-space: nowrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

/* decrypt letters (fx.js): the real glyph keeps its box; a glitch glyph paints over it */
.dw {
  display: inline-block;
  white-space: nowrap;
}

.dc {
  position: relative;
}

.dc.is-pending {
  opacity: 0;
}

.dc[data-g] {
  color: transparent;
}

.dc[data-g]::after {
  content: attr(data-g);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink-muted);
}

.motion [data-decrypt]:not([data-decrypted]) {
  visibility: hidden;
}

/* reveal on scroll */
.motion [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.motion [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------ cover */

.cover {
  position: relative;
  min-height: 100svh;
  max-width: var(--page);
  margin: 0 auto;
  padding: calc(var(--mast-h) + clamp(28px, 6vh, 72px)) var(--side) 32px;
  display: flex;
  flex-direction: column;
}

.cover__grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.cover__eyebrow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 28px;
  color: var(--ink-dim);
}

.cover__title {
  margin: 0;
  font-size: clamp(54px, 8.6vw, 138px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.055em;
  color: var(--ink-bright);
}

.cover__line {
  display: block;
  white-space: nowrap;
}

.cover__lead {
  max-width: 34em;
  margin: 32px 0 0;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.cover__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.cover__fine {
  max-width: 46em;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.cover__fine b {
  font-weight: 500;
  color: var(--ink-2);
}

.cover__art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.cover__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0.03em;
  font-size: 12px;
}

.cover__foot > span:last-child {
  min-width: 0;
}

.cover__foot b {
  font-weight: 500;
  color: var(--ink);
}

.cover__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgb(0 255 136 / 0.5);
}

.motion .cover__pulse {
  animation: pulse 2.4s var(--ease-out) infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(0 255 136 / 0.5);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgb(0 255 136 / 0);
  }
}

/* load choreography */
.motion .cover__eyebrow,
.motion .cover__lead,
.motion .cover__cta,
.motion .cover__fine,
.motion .cover__art,
.motion .cover__foot {
  opacity: 0;
  transform: translateY(14px);
}

.motion .is-live .cover__eyebrow,
.motion .is-live .cover__lead,
.motion .is-live .cover__cta,
.motion .is-live .cover__fine,
.motion .is-live .cover__art,
.motion .is-live .cover__foot {
  opacity: 1;
  transform: none;
  transition:
    opacity 1.1s var(--ease-out),
    transform 1.1s var(--ease-out);
}

.motion .is-live .cover__lead {
  transition-delay: 0.55s;
}
.motion .is-live .cover__cta {
  transition-delay: 0.7s;
}
.motion .is-live .cover__fine {
  transition-delay: 0.8s;
}
.motion .is-live .cover__art {
  transition-delay: 0.2s;
  transition-duration: 1.6s;
}
.motion .is-live .cover__foot {
  transition-delay: 1s;
}

/* the keyring orb */
.orb {
  --orb-size: min(500px, 40vw);
  position: relative;
  width: var(--orb-size);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.orb__canvas {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  max-width: none;
}

.orb__fallback {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 9px, rgb(255 255 255 / 0.07) 9px 10px),
    radial-gradient(circle at 50% 50%, rgb(59 108 255 / 0.55), rgb(255 45 138 / 0.18) 45%, transparent 70%);
  mask: radial-gradient(circle, #000 55%, transparent 71%);
}

.orb.has-gl .orb__fallback {
  display: none;
}

.orb__hint {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.75);
  pointer-events: none;
  transition: opacity 0.4s;
}

.orb:focus-visible {
  outline-offset: -8%;
}

.orb[data-state="done"] .orb__hint {
  opacity: 0;
}

.readout {
  width: min(500px, 100%);
  border-top: 1px solid var(--line-mid);
  padding-top: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.readout__row {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 10px;
  align-items: baseline;
}

.readout__row .label {
  white-space: nowrap;
}

.readout__row + .readout__row {
  margin-top: 8px;
}

.readout__row--meta {
  color: var(--ink-2);
}

.readout__did {
  color: var(--ink-bright);
  overflow-wrap: anywhere;
}

[data-identity="none"] .readout__did {
  color: var(--ink-muted);
}

/* ------------------------------------------------------------ 01 problem */

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
}

.slip {
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.slip--delegation {
  border-color: var(--line-mid);
  background: linear-gradient(180deg, rgb(0 255 136 / 0.035), transparent 40%), var(--panel-2);
}

.slip__kind {
  margin: 0 0 10px;
}

.slip--delegation .slip__kind {
  color: var(--signal);
}

.slip__raw {
  display: block;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--canvas-deep);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slip__rows {
  margin: 0;
}

.slip__rows div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}

.slip__rows dt {
  color: var(--ink-muted);
}

.slip__rows dd {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.slip__blank {
  font-family: var(--mono);
  color: var(--alert) !important;
  opacity: 0.85;
}

.versus__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  position: relative;
}

.versus__arrow::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--line-mid), var(--signal));
}

.versus__arrow span {
  position: relative;
  padding: 4px 8px;
  background: var(--canvas);
  border: 1px solid var(--line-mid);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ------------------------------------------------------------ 02 key */

.derive {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  background: var(--panel);
}

.derive::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 46px;
  height: 1px;
  background: var(--line-mid);
}

.derive::after {
  content: "";
  position: absolute;
  left: 0;
  top: 44px;
  width: 64px;
  height: 5px;
  background: radial-gradient(closest-side, var(--signal), transparent);
  opacity: 0;
}

.motion .derive.is-flowing::after {
  animation: flow 1.8s var(--ease-in-out) forwards;
}

@keyframes flow {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(calc(var(--derive-w, 1000px) - 64px));
  }
}

.derive__step {
  position: relative;
  padding: 24px 22px 26px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.derive__step:first-child {
  border-left: 0;
}

.derive__n {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 20px;
  background: var(--canvas);
  border: 1px solid var(--line-mid);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  transition:
    border-color 0.4s,
    color 0.4s,
    box-shadow 0.4s;
}

.derive__step.is-on .derive__n {
  border-color: var(--signal);
  color: var(--signal);
  box-shadow: 0 0 16px rgb(0 255 136 / 0.35);
}

.derive__name {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.derive__val {
  min-height: 3.2em;
  margin: 10px 0 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-bright);
  overflow-wrap: anywhere;
}

.derive__note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.derive__redacted {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
}

.derive__redacted span {
  height: 9px;
  background: var(--ink-bright);
  opacity: 0.9;
}

.derive__redacted span:nth-child(1) {
  width: 68%;
}
.derive__redacted span:nth-child(2) {
  width: 24%;
}
.derive__redacted span:nth-child(3) {
  width: 40%;
}
.derive__redacted span:nth-child(4) {
  width: 52%;
}

.motion .derive__step--secret.is-on .derive__redacted span {
  animation: evaporate 2.4s var(--ease-out) 0.6s forwards;
}

@keyframes evaporate {
  0% {
    opacity: 0.9;
    filter: blur(0);
    transform: none;
  }
  100% {
    opacity: 0.08;
    filter: blur(6px);
    transform: translateY(-6px) scaleX(1.08);
  }
}

.derive__step--secret.is-on .derive__redacted span {
  opacity: 0.08;
}

.motion .derive__step--secret.is-on .derive__redacted span {
  opacity: 0.9;
}

.derive__step--did.is-on {
  background: linear-gradient(180deg, rgb(0 255 136 / 0.05), transparent 70%);
}

.key__lab {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: clamp(40px, 6vh, 64px);
}

.key__copy p {
  margin: 0;
  color: var(--ink-2);
}

.key__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.console {
  min-height: 220px;
  max-height: 420px;
  margin: 0;
  padding: 20px 22px;
  overflow: auto;
  background: var(--canvas-deep);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* token colours, shared by every code surface */
.t-dim {
  color: #5f5f5f;
}
.t-kw {
  color: var(--info);
}
.t-key {
  color: #c9c9c9;
}
.t-str {
  color: #9fe0bf;
}
.t-num {
  color: var(--amber);
}
.t-ok {
  color: var(--signal);
}
.t-bad {
  color: var(--alert);
}
.t-warn {
  color: var(--amber);
}
.t-tok {
  color: var(--ink-muted);
}
.t-fn {
  color: #e7c3ff;
}
.t-com {
  color: #5f5f5f;
  font-style: italic;
}

/* ------------------------------------------------------------ 03 consent */

.consent__grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

.sheet {
  position: sticky;
  top: calc(var(--mast-h) + 24px);
  padding: 24px;
  background: linear-gradient(180deg, rgb(102 170 255 / 0.05), transparent 30%), var(--panel-2);
  border: 1px solid var(--line-mid);
}

.sheet__agent {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.sheet__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(102 170 255 / 0.5);
  background: var(--info-dim);
}

.sheet__avatar svg {
  width: 22px;
  fill: none;
  stroke: var(--info);
  stroke-width: 1.5;
}

.sheet__name {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--ink-2);
}

.sheet__name b {
  font-weight: 600;
  color: var(--ink-bright);
}

.sheet__did {
  margin: 6px 0 0;
}

.sheet__did code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 11.5px;
  color: var(--info);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* margin, not padding: a fieldset's legend sits in its border box, above any padding */
.sheet__field {
  display: block;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.sheet__field legend,
.sheet__field > .label {
  display: block;
  padding: 0;
  margin-bottom: 8px;
}

.sheet__field--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet__field--row .label {
  margin: 0;
}

.sheet__field--row code {
  font-size: 12.5px;
}

.sheet__hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.sheet__input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-mid);
  background: var(--canvas-deep);
  transition: border-color 0.2s;
}

.sheet__input:focus-within {
  border-color: var(--ink-dim);
}

.sheet__input input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--ink-bright);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}

.sheet__input input:invalid {
  color: var(--alert);
}

.sheet__matcher {
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.seg {
  display: flex;
  border: 1px solid var(--line-mid);
}

.seg label {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.seg label + label {
  border-left: 1px solid var(--line-mid);
}

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

.seg span {
  display: grid;
  place-items: center;
  height: 40px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-dim);
  transition:
    background-color 0.2s,
    color 0.2s;
}

.seg input:checked + span {
  background: var(--ink);
  color: #050505;
}

.seg input:focus-visible + span {
  outline: 1px solid var(--ink-bright);
  outline-offset: -4px;
}

.seg input[value="vault:write"]:checked + span {
  background: var(--amber);
}

.sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 22px;
}

.sheet__foot {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
}

.sheet__status {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  color: var(--ink-dim);
}

.sheet__status[data-tone="ok"] {
  color: var(--signal);
}
.sheet__status[data-tone="wait"] {
  color: var(--amber);
}
.sheet__status[data-tone="bad"] {
  color: var(--alert);
}

.anatomy {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--canvas-deep);
}

.anatomy__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px 0 0;
  border-bottom: 1px solid var(--line);
}

.anatomy__size {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0.04em;
}

.tabs {
  display: flex;
}

.tabs button {
  position: relative;
  flex: none;
  height: 46px;
  padding: 0 18px;
  white-space: nowrap;
  border: 0;
  border-right: 1px solid var(--line);
  background: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  color: var(--ink-bright);
  background: var(--panel-2);
}

.tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ink-bright);
}

.anatomy__code {
  min-height: 420px;
  max-height: 620px;
  margin: 0;
  padding: 22px 24px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.anatomy__code .part {
  transition:
    background-color 0.25s,
    box-shadow 0.25s,
    color 0.25s;
}

.anatomy__code .part.is-lit {
  background: rgb(0 255 136 / 0.12);
  box-shadow: 0 0 0 1px rgb(0 255 136 / 0.5);
  color: var(--ink-bright);
}

.jwt-h {
  color: #ff6fae;
}
.jwt-p {
  color: #8db8ff;
}
.jwt-s {
  color: var(--signal);
}

.legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.legend li {
  padding: 12px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
  cursor: default;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.legend li:nth-child(3n) {
  border-right: 0;
}

.legend li b {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.legend li:hover,
.legend li.is-lit {
  background: var(--panel-3);
  color: var(--ink-2);
}

.legend li:hover b,
.legend li.is-lit b {
  color: var(--signal);
}

/* ------------------------------------------------------------ 04 verify */

.verify__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.bench {
  border: 1px solid var(--line);
  background: var(--panel);
}

.bench__req {
  margin: 0;
  padding: 18px 20px;
  background: var(--canvas-deep);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}

.pipe {
  margin: 0;
  padding: 8px 0;
  list-style: none;
  position: relative;
}

.pipe li {
  position: relative;
  display: grid;
  grid-template-columns: 44px 104px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 20px 6px 0;
  font-size: 13.5px;
  transition: background-color 0.3s;
}

.pipe li::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-mid);
}

.pipe li:first-child::before {
  top: 50%;
}
.pipe li:last-child::before {
  bottom: 50%;
}

.pipe__n {
  position: relative;
  z-index: 1;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--canvas);
  border: 1px solid var(--line-mid);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-muted);
  transition: all 0.3s;
}

.pipe__name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}

.pipe__detail {
  min-width: 0;
  color: var(--ink-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipe__state {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-width: 70px;
  text-align: right;
}

.pipe li.is-run {
  background: var(--panel-2);
}

.pipe li.is-run .pipe__n {
  border-color: var(--amber);
  color: var(--amber);
}

.pipe li.is-ok .pipe__n {
  border-color: var(--signal);
  background: var(--signal);
  color: #000;
}

.pipe li.is-ok .pipe__state {
  color: var(--signal);
}

.pipe li.is-ok .pipe__detail {
  color: var(--ink-2);
}

.pipe li.is-fail {
  background: var(--alert-dim);
}

.pipe li.is-fail .pipe__n {
  border-color: var(--alert);
  background: var(--alert);
  color: #fff;
}

.pipe li.is-fail .pipe__state,
.pipe li.is-fail .pipe__detail {
  color: var(--alert);
}

.pipe li.is-skip {
  opacity: 0.35;
}

.bench__res {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  background: var(--canvas-deep);
}

.bench__http {
  margin: 0 0 8px;
}

.bench__http[data-tone="ok"] {
  color: var(--signal);
}
.bench__http[data-tone="bad"] {
  color: var(--alert);
}
.bench__http[data-tone="warn"] {
  color: var(--amber);
}

.bench__body {
  margin: 0;
  min-height: 3.4em;
  max-height: 260px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}

.bench__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.bench__ms {
  text-transform: none;
  letter-spacing: 0.04em;
}

.heist {
  position: sticky;
  top: calc(var(--mast-h) + 24px);
}

.heist__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.heist__head .h3 {
  margin: 0;
}

.heist__score {
  margin: 0;
  text-transform: none;
  letter-spacing: 0.04em;
}

.heist__score [data-got] {
  color: var(--signal);
}

.attacks {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
}

.attacks li + li {
  border-top: 1px solid var(--line);
}

.attack {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  grid-template-areas:
    "n t r"
    "n d d";
  column-gap: 10px;
  row-gap: 4px;
  width: 100%;
  padding: 16px 16px 16px 14px;
  border: 0;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.attack:hover:not(:disabled) {
  background: var(--panel-3);
}

.attack:disabled {
  cursor: progress;
}

.attack__n {
  grid-area: n;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding-top: 3px;
}

.attack__t {
  grid-area: t;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink-bright);
}

.attack__d {
  grid-area: d;
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.attack__d code {
  font-size: 11.5px;
}

.attack__r {
  grid-area: r;
  align-self: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.attack__r:empty::before {
  content: "try";
  color: var(--line-strong);
}

.attack.is-denied .attack__r {
  padding: 3px 7px;
  border: 1px solid var(--alert);
  color: var(--alert);
}

.attack.is-running .attack__r {
  color: var(--amber);
}

.attack.is-denied {
  background: linear-gradient(90deg, rgb(255 0 64 / 0.06), transparent 60%), var(--panel);
}

.heist__verdict {
  min-height: 1.6em;
  margin: 18px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

.heist__verdict b {
  color: var(--signal);
  font-weight: 600;
}

.stamp {
  position: absolute;
  z-index: 3;
  padding: 6px 12px;
  border: 2px solid currentColor;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
  transform: rotate(-7deg);
  mix-blend-mode: screen;
}

.stamp--bad {
  color: var(--alert);
}

.stamp--ok {
  color: var(--signal);
}

.motion .stamp {
  animation: stamp 1.6s var(--ease-pop) forwards;
}

@keyframes stamp {
  0% {
    opacity: 0;
    transform: rotate(-7deg) scale(1.8);
  }
  14% {
    opacity: 1;
    transform: rotate(-7deg) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ------------------------------------------------------------ 05 step-up */

.stepup__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.term {
  position: relative;
  border: 1px solid var(--line-mid);
  background: var(--canvas-deep);
  min-height: 520px;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.term__bar > span {
  width: 9px;
  height: 9px;
  background: var(--line-mid);
}

.term__bar .label {
  margin: 0 0 0 10px;
  text-transform: none;
  letter-spacing: 0.04em;
}

.term__log {
  margin: 0;
  padding: 18px 20px 54px;
  list-style: none;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}

.term__log li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}

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

.motion .term__log li {
  animation: line-in 0.5s var(--ease-out) both;
}

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

.term__who {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 2px;
}

.term__who--agent {
  color: var(--info);
}
.term__who--router {
  color: var(--ink-dim);
}
.term__who--you {
  color: var(--amber);
}
.term__who--ok {
  color: var(--signal);
}

.term__msg {
  min-width: 0;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term__again {
  position: absolute;
  right: 16px;
  bottom: 14px;
}

.phone {
  position: relative;
  width: 300px;
  height: 610px;
  padding: 12px;
  border-radius: 48px;
  background: linear-gradient(145deg, #2a2a2a, #121212);
  box-shadow:
    inset 0 0 0 1px #3a3a3a,
    0 40px 80px rgb(0 0 0 / 0.55);
}

.phone__screen {
  position: relative;
  height: 100%;
  border-radius: 37px;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 0%, rgb(59 108 255 / 0.28), transparent 60%),
    radial-gradient(120% 50% at 50% 100%, rgb(255 45 138 / 0.16), transparent 60%),
    #050505;
}

.phone__time {
  margin: 0;
  padding: 16px 28px 0;
  font-size: 14px;
  font-weight: 600;
}

.phone__sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 22px 20px 26px;
  border-radius: 28px;
  background: rgb(26 26 26 / 0.92);
  border: 1px solid #2c2c2c;
  text-align: center;
  transform: translateY(110%);
  transition: transform 0.7s var(--ease-out);
}

.phone:is(.is-asking, .is-scanning, .is-approved) .phone__sheet {
  transform: none;
}

.phone__clock {
  margin: 54px 0 0;
  text-align: center;
  font-size: 76px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgb(255 255 255 / 0.92);
}

.phone__day {
  margin: 8px 0 0;
  text-align: center;
  font-size: 15px;
  color: rgb(255 255 255 / 0.6);
}

.phone__app {
  margin: 0 0 12px;
}

.phone__ask {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink-bright);
}

.phone__ask code,
.phone__cap code {
  font-size: 13px;
}

.phone__cap {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
}

.phone__face {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin: 22px auto 12px;
}

.phone__face svg {
  width: 58px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

.phone.is-scanning .phone__face svg {
  stroke: var(--amber);
}

.motion .phone.is-scanning .phone__face svg {
  animation: scan 0.9s ease-in-out infinite alternate;
}

@keyframes scan {
  to {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

.phone.is-approved .phone__face svg {
  stroke: var(--signal);
}

.phone__state {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
}

.phone.is-approved .phone__state {
  color: var(--signal);
}

/* ------------------------------------------------------------ 06 revoke */

.revoke__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.field {
  position: relative;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--line);
  background: var(--canvas-deep);
  overflow: hidden;
}

.field__canvas {
  width: 100%;
  height: 100%;
}

.field__reticle {
  position: absolute;
  width: 16px;
  height: 16px;
  translate: -50% -50%;
  border: 1px solid var(--signal);
  pointer-events: none;
  transition:
    left 1.2s var(--ease-in-out),
    top 1.2s var(--ease-in-out),
    border-color 0.3s;
}

.field__reticle::before,
.field__reticle::after {
  content: "";
  position: absolute;
  background: rgb(0 255 136 / 0.35);
}

.field__reticle::before {
  left: 50%;
  top: -2000px;
  bottom: -2000px;
  width: 1px;
}

.field__reticle::after {
  top: 50%;
  left: -3000px;
  right: -3000px;
  height: 1px;
}

.field__loupe {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-mid);
  background: var(--canvas-deep);
  image-rendering: pixelated;
}

.field__reticle.is-revoked {
  border-color: var(--alert);
}

.field__reticle.is-revoked::before,
.field__reticle.is-revoked::after {
  background: rgb(255 0 64 / 0.4);
}

.field__tag {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  background: var(--canvas);
  border: 1px solid var(--line-mid);
  white-space: nowrap;
  color: var(--signal);
  text-transform: none;
  letter-spacing: 0.04em;
}

.field__reticle.is-top .field__tag {
  top: -6px;
  translate: none;
}

.field__reticle.is-bottom .field__tag {
  top: auto;
  bottom: -6px;
  translate: none;
}

.field__reticle.is-left .field__tag {
  left: auto;
  right: calc(100% + 8px);
}

.field__reticle.is-revoked .field__tag {
  color: var(--alert);
}

.revoke__facts {
  margin: 0;
  border: 1px solid var(--line);
}

.revoke__facts div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 11px 14px;
  font-size: 13.5px;
}

.revoke__facts div + div {
  border-top: 1px solid var(--line);
}

.revoke__facts dt {
  padding-top: 2px;
}

.revoke__facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}

.revoke__facts code {
  padding: 0;
  background: none;
  border: 0;
  font-size: 11.5px;
  white-space: normal;
}

.revoke__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.revoke__result {
  min-height: 3em;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.revoke__result code {
  white-space: normal;
}

/* ------------------------------------------------------------ 07 devices */

.devices__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.tree {
  position: relative;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.tree__wires {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 28px;
  width: calc(100% - 48px);
  height: 340px;
  overflow: visible;
}

.tree__wires path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
  opacity: 0.7;
  vector-effect: non-scaling-stroke;
  transition:
    stroke 0.4s,
    opacity 0.4s;
}

.motion .tree__wires path {
  animation: march 1.4s linear infinite;
}

@keyframes march {
  to {
    stroke-dashoffset: -18;
  }
}

.tree__wires path.is-cut {
  stroke: var(--alert);
  opacity: 0.4;
  animation: none;
}

.tree__root {
  position: relative;
  z-index: 1;
  width: min(330px, 100%);
  margin: 0 auto;
  padding: 14px 18px;
  background: var(--canvas);
  border: 1px solid var(--line-strong);
  text-align: center;
}

.tree__root b {
  display: block;
  margin: 6px 0 4px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-bright);
}

.tree__sub {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.tree__sub i {
  font-style: normal;
  color: var(--signal);
}

.tree__devices {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 150px;
}

.device {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--canvas);
  border: 1px solid var(--line-mid);
  text-align: center;
  transition:
    border-color 0.4s,
    opacity 0.4s;
}

.device__icon svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

.device.is-lost .device__icon svg {
  stroke: var(--alert);
}

.device.is-new .device__icon svg {
  stroke: var(--signal);
}

.device b {
  font-weight: 500;
  font-size: 14px;
}

.device__state {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
}

.device.is-lost {
  border-color: var(--alert);
  opacity: 0.7;
}

.device.is-lost .device__state {
  color: var(--alert);
}

.device.is-new {
  border-color: var(--signal);
}

.tree__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.tree__log {
  margin: 16px 0 0;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.04em;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.compare caption {
  text-align: left;
  padding-bottom: 12px;
}

.compare th,
.compare td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.compare tbody th {
  font-weight: 500;
  color: var(--ink);
}

.compare td {
  color: var(--ink-muted);
}

.compare td:last-child {
  color: var(--signal);
}

/* ------------------------------------------------------------ 08 build */

.breach {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.breach__db {
  padding: 22px 24px;
  background: var(--canvas);
}

.breach__db .label {
  margin: 0 0 14px;
}

.breach__db ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.breach__db li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 70px 10px 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
}

.breach__db li code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.breach__db li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
  transition: color 0.3s;
}

.breach.is-leaked .breach__db:not(.breach__db--verifier) li span {
  color: var(--alert);
}

.breach.is-leaked .breach__db--verifier li span {
  color: var(--signal);
}

.breach__db li::after {
  position: absolute;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  padding: 2px 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s;
  transition-delay: var(--d, 0ms);
}

.breach.is-leaked .breach__db li::after {
  opacity: 1;
}

.breach__db:not(.breach__db--verifier) li::after {
  content: "usable";
  background: var(--alert);
  color: #fff;
}

.breach__db--verifier li {
  padding-right: 118px;
}

.breach__db--verifier li::after {
  content: "public anyway";
  background: var(--signal);
  color: #000;
}

.breach__actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--canvas-deep);
}

.breach__verdict {
  margin: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 13px;
  color: var(--ink-2);
}

.code {
  margin-top: clamp(48px, 8vh, 88px);
  border: 1px solid var(--line);
  background: var(--canvas-deep);
}

.code .tabs {
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.code .tabs button {
  white-space: nowrap;
}

.code__body {
  min-height: 360px;
  margin: 0;
  padding: 24px 26px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}

.code__caption {
  margin: 0;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-dim);
  text-wrap: pretty;
}

.entries {
  margin-top: clamp(48px, 8vh, 88px);
}

/* hairlines from borders, not a background showing through gaps, so cells can fade in */
.entries__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.entry {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  transition: background-color 0.25s;
}

.entry--all {
  align-content: space-between;
  background: linear-gradient(135deg, rgb(0 255 136 / 0.07), transparent 70%), var(--canvas);
}

.entry--all a {
  justify-self: start;
  color: var(--signal);
  text-decoration: none;
}

.entry--all a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.entry--all b {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-bright);
}

.entry--all a::after {
  content: " →";
}

.entry:hover {
  background: var(--panel-3);
}

.entry code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.5px;
  color: var(--ink-bright);
  white-space: normal;
  overflow-wrap: anywhere;
}

.entry__where {
  justify-self: start;
  padding: 2px 6px;
  border: 1px solid var(--line-mid);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.entry__where[data-where="browser"] {
  border-color: rgb(102 170 255 / 0.5);
  color: var(--info);
}

.entry__where[data-where="server"] {
  border-color: rgb(255 179 64 / 0.5);
  color: var(--amber);
}

.entry__where[data-where="anywhere"] {
  border-color: rgb(0 255 136 / 0.4);
  color: var(--signal);
}

.entry p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: clamp(48px, 8vh, 88px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-mid);
}

.stats li {
  padding: 26px 20px 0 0;
}

.stats li + li {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.stats b {
  display: block;
  font-size: clamp(38px, 4.2vw, 60px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink-bright);
}

.stats span {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------ 09 standards */

.specs {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-mid);
}

.specs li {
  display: grid;
  grid-template-columns: 80px minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: baseline;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line);
  transition:
    background-color 0.25s,
    padding 0.35s var(--ease-out);
}

.specs li:hover {
  background: var(--panel-2);
  padding-left: 16px;
}

.specs__org {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

.specs b {
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-bright);
}

.specs li > span:last-child {
  font-size: 14.5px;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------ 10 wild */

.wild__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.wildcard {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 300px;
  padding: 26px;
  background: var(--canvas);
  text-decoration: none;
  transition: background-color 0.3s;
}

.wildcard:hover {
  background: var(--panel-3);
}

.wildcard__mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.04em;
  color: var(--ink-bright);
}

.wildcard__mark--nitz {
  background: #ffd21a;
  border-color: #ffd21a;
  color: #000;
}

.wildcard__mark--cp {
  color: var(--signal);
}

.wildcard b {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-bright);
}

.wildcard > span:not(.wildcard__mark):not(.wildcard__go) {
  font-size: 14.5px;
  color: var(--ink-muted);
}

.wildcard__go {
  margin-top: auto;
  padding-top: 18px;
  text-transform: none;
}

.wildcard__go::after {
  content: " →";
  transition: margin 0.3s var(--ease-out);
}

.wildcard:hover .wildcard__go::after {
  margin-left: 6px;
}

/* ------------------------------------------------------------ 11 finale */

.finale {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  margin-top: clamp(110px, 16vh, 190px);
  padding: 120px var(--side);
  overflow: hidden;
  border-top: 1px solid var(--line);
  isolation: isolate;
}

.finale__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.finale::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(closest-side, transparent 30%, var(--canvas) 100%);
  pointer-events: none;
}

.finale__inner {
  max-width: 1100px;
  text-align: center;
}

.finale__mark {
  width: 52px;
  height: 60px;
  margin: 0 auto 32px;
  color: var(--ink-bright);
}

.finale__title {
  margin: 0;
  font-size: clamp(48px, 8.4vw, 132px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
  color: var(--ink-bright);
  text-wrap: balance;
}

.finale__sub {
  margin: 26px 0 0;
  font-size: clamp(17px, 1.5vw, 21px);
  color: var(--ink-2);
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  padding: 16px 20px;
  border: 1px solid var(--line-mid);
  background: rgb(6 6 6 / 0.85);
  cursor: pointer;
  transition: border-color 0.25s;
}

.install:hover {
  border-color: var(--ink-dim);
}

.install code {
  font-size: clamp(13px, 1.5vw, 16px);
  color: var(--ink-bright);
}

.install__prompt {
  font-family: var(--mono);
  color: var(--signal);
}

.install__copy {
  padding-left: 14px;
  border-left: 1px solid var(--line-mid);
}

.finale__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.colophon {
  border-top: 1px solid var(--line);
}

.colophon__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px var(--side) 40px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.colophon__inner p {
  margin: 0;
}

.colophon__inner > p:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.colophon__mark {
  width: 14px;
  height: 16px;
  color: var(--ink);
}

.colophon__inner .label {
  text-transform: none;
  letter-spacing: 0.04em;
}

.colophon__links {
  display: flex;
  gap: 18px;
  margin-left: auto !important;
  font-family: var(--mono);
  font-size: 12px;
}

.colophon__links a {
  text-decoration: none;
}

.colophon__links a:hover {
  color: var(--ink-bright);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  translate: -50% 20px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line-mid);
  background: rgb(12 12 12 / 0.96);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s,
    translate 0.4s var(--ease-out);
}

.toast.is-on {
  opacity: 1;
  translate: -50% 0;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .mast__nav {
    display: none;
  }

  .chip {
    margin-left: auto;
  }

  .derive {
    grid-template-columns: 1fr;
  }

  .derive::before {
    left: 36px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 1px;
    height: auto;
  }

  .derive::after {
    display: none;
  }

  .derive__step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 18px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 22px;
  }

  .derive__step:first-child {
    border-top: 0;
  }

  .derive__n {
    grid-row: span 3;
    margin: 0;
  }

  .derive__val {
    min-height: 0;
    margin: 6px 0;
  }

  .consent__grid,
  .verify__grid,
  .revoke__stage,
  .devices__grid,
  .key__lab {
    grid-template-columns: 1fr;
  }

  .sheet,
  .heist {
    position: static;
  }

  .legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legend li:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .legend li:nth-child(2n) {
    border-right: 0;
  }

  .entries__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .stats li {
    padding-bottom: 26px;
  }
}

@media (max-width: 860px) {
  /* one column, reading order: words, then the orb, then the buttons */
  .cover__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cover__copy,
  .cover__art {
    display: contents;
  }

  .cover__eyebrow {
    order: 1;
    margin-bottom: 22px;
  }

  .cover__title {
    order: 2;
  }

  .cover__lead {
    order: 3;
    margin-top: 22px;
  }

  .orb {
    order: 4;
    justify-self: center;
    margin-top: 18px;
    --orb-size: min(320px, 76vw);
  }

  .readout {
    order: 5;
    justify-self: stretch;
    width: 100%;
  }

  .cover__cta {
    order: 6;
    margin-top: 26px;
  }

  .cover__fine {
    order: 7;
  }

  .versus {
    grid-template-columns: 1fr;
  }

  .versus__arrow {
    width: auto;
    height: 64px;
  }

  .versus__arrow::before {
    left: 50%;
    right: auto;
    top: 0;
    bottom: 0;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, var(--line-mid), var(--signal));
  }

  .stepup__grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .term {
    width: 100%;
    min-height: 0;
  }

  .breach {
    grid-template-columns: minmax(0, 1fr);
  }

  .wild__grid {
    grid-template-columns: 1fr;
  }

  .wildcard {
    min-height: 0;
  }

  .specs li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .anatomy__bar {
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
  }

  .anatomy__bar .tabs {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .anatomy__size {
    margin: 0;
    padding: 12px 16px;
  }

  .anatomy__bar [data-copy-jwt] {
    margin-left: auto;
    padding-right: 16px;
  }

  .code .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .breach__db li {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .entry {
    min-height: 0;
  }

  .cover__line {
    white-space: normal;
  }

  .slip {
    padding: 20px;
  }

  .slip__rows div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .pipe li {
    grid-template-columns: 38px 86px minmax(0, 1fr);
    padding-right: 12px;
  }

  .pipe li::before {
    left: 18px;
  }

  .pipe__state {
    display: none;
  }

  .legend {
    grid-template-columns: 1fr;
  }

  .legend li {
    border-right: 0 !important;
  }

  .entries__grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .stats li,
  .stats li + li {
    padding-left: 0;
    border-left: 0;
  }

  .term__log li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tree__devices {
    gap: 8px;
  }

  .device b {
    font-size: 12.5px;
  }

  .revoke__facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .phone {
    width: 270px;
    height: 550px;
  }

  .colophon__links {
    margin-left: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
