/* The account verification steps with the rail that fills. One dark card on a black page: a body with a soft
   gradient, a 1px edge that catches the light along the top and a fine grain; four rows on a thin rail. GSAP moves
   the tiles, the rows and the rail; the CSS only styles them. */
:root {
  --page: #000000;                        /* the page */
  --card-top: #17181c;                    /* the card, at the top */
  --card-bottom: #0f1013;                 /* the card, at the bottom */
  --edge: rgba(255, 255, 255, 0.08);      /* the 1px edge */
  --ink: #eef0f3;                         /* the words */
  --muted: #868b96;                       /* the small words */
  --dim: rgba(238, 240, 243, 0.34);       /* the steps still to come */
  --track: rgba(255, 255, 255, 0.075);    /* the empty rail and meters */
  --tile: #1b1d22;                        /* a tile still to check */
  --mint: #5fe3b1;                        /* the only accent */
  --mint-deep: #2fbf8c;                   /* the accent in shadow */
  --mint-ink: #06291c;                    /* the check on the mint */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

p,
h2,
ol {
  margin: 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ the card */
.verify {
  --a: 0deg;
  --beam: 0;
  position: relative;
  width: min(420px, 92vw);
  padding: clamp(14px, 3.6vh, 22px) clamp(14px, 4.6vw, 20px) clamp(14px, 3.4vh, 20px);
  border-radius: 22px;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 255, 255, 0.055), transparent 60%),
    linear-gradient(180deg, var(--card-top), var(--card-bottom));
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 14px 30px -12px rgba(0, 0, 0, 0.8),
    0 40px 80px -40px rgba(47, 191, 140, 0.16);
  isolation: isolate;
  opacity: 0;
}

/* a fine grain over the body */
.verify::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.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 0.5 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: -1;
}

/* the light that runs once around the edge at the end: a conic gradient seen only through a 1px ring */
.verify__beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--a), transparent 0deg, transparent 250deg, rgba(95, 227, 177, 0.25) 300deg, #c9ffe9 344deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: var(--beam);
  pointer-events: none;
}

/* ------------------------------------------------------------------ the head */
.verify__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(180deg, #24262c, #16171b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.mark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, #8ff5cd, var(--mint) 45%, var(--mint-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  opacity: var(--sealed, 0);
}

.mark svg {
  position: absolute;
  inset: 7px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark__logo {
  stroke: var(--ink);
  stroke-width: 1.9;
}

.mark__seal {
  z-index: 1;
  stroke: var(--mint-ink);
  stroke-width: 2.2;
}

.mark__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.verify__titles {
  min-width: 0;
}

.verify__title {
  font-size: 15.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.005em;
  line-height: 1.25;
}

.verify__sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.verify__title span,
.verify__sub span {
  display: inline-block;
}

.verify__pct {
  font-size: 22px;
  font-weight: 560;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: baseline;
}

.verify__pct [data-pct] {
  display: inline-block;
  min-width: 2.05em;
  text-align: right;
}

.verify__pct-sign {
  font-size: 13px;
  color: var(--muted);
  margin-left: 1px;
}

/* ------------------------------------------------------------------ the steps on the rail */
.steps {
  position: relative;
  margin-top: clamp(12px, 3.2vh, 20px);
  padding-top: clamp(10px, 2.4vh, 14px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.steps__list {
  list-style: none;
  padding: 0;
  position: relative;
}

/* the rail runs from the first tile's centre to the last; JS sets its top and height in pixels */
.rail {
  position: absolute;
  left: 13px;
  top: 0;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: var(--track);
}

.rail__fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--mint-deep), var(--mint));
}

/* the head of the fill: a short lighter stretch, no glow */
.rail__fill::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, #d8fff0);
  opacity: var(--head, 0);
}

.step {
  --pad-open: clamp(6px, 1.9vh, 10px);   /* a step still to check */
  --pad-done: clamp(3px, 1vh, 6px);      /* a step that passed: the row closes tighter */
  --tight: 0;
  --pad: calc(var(--pad-open) + (var(--pad-done) - var(--pad-open)) * var(--tight));
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  column-gap: 12px;
  padding: var(--pad) 8px var(--pad) 0;
  border-radius: 12px;
}

.step::before {
  content: '';
  position: absolute;
  inset: 1px -8px 1px -8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.028);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: var(--lit, 0);
  pointer-events: none;
}

@media (hover: hover) {
  .step:hover::before {
    opacity: max(var(--lit, 0), 0.6);
  }
  .step:hover .step__name {
    color: var(--ink);
  }
}

/* the tile: a rounded square with an icon, a beam that runs around while checking and a check when done */
.tile {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8.5px;
  background: var(--tile);
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, #94f6d0, var(--mint) 45%, var(--mint-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  opacity: var(--done, 0);
}

.tile svg {
  position: absolute;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile__frame {
  inset: 0;
  width: 28px;
  height: 28px;
  z-index: 2;
}

.tile__track {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}

.tile__ray {
  stroke: var(--mint);
  stroke-width: 1.5;
  stroke-dasharray: 0.24 0.76;
  stroke-dashoffset: 0;
  opacity: 0;
}

.tile__icon,
.tile__ok {
  left: 6px;
  top: 6px;
  width: 16px;
  height: 16px;
  z-index: 3;
}

.tile__icon {
  stroke: var(--muted);
  stroke-width: 1.35;
}

.tile__ok {
  stroke: var(--mint-ink);
  stroke-width: 2;
}

.tile__ok path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.step__body {
  min-width: 0;
  padding-top: 5px;
}

.step__name {
  font-size: 13.5px;
  font-weight: 520;
  line-height: 18px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step__more {
  height: 0;
  overflow: hidden;
}

.step__note {
  padding-top: 3px;
  font-size: 11.5px;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meter {
  position: relative;
  display: block;
  height: 2px;
  margin: 8px 0 3px;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
}

.meter i {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--mint-deep), var(--mint));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* the state on the right: Pending, Checking (with a light that runs through the letters), Verified */
.state {
  padding-top: 6px;
  font-size: 11.5px;
  font-weight: 520;
  line-height: 16px;
  letter-spacing: 0.01em;
  color: var(--dim);
  white-space: nowrap;
}

.state.is-checking {
  color: transparent;
  background: linear-gradient(100deg, var(--muted) 35%, #f4fffa 50%, var(--muted) 65%) 0 0 / 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: sheen 1.3s linear infinite;
}

.state.is-done {
  color: var(--mint);
}

@keyframes sheen {
  from { background-position: 130% 0; }
  to { background-position: -130% 0; }
}

/* ------------------------------------------------------------------ the button */
.go {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: clamp(10px, 2.8vh, 18px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.go:disabled {
  cursor: default;
}

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

.go__face {
  --on: 0;
  --shine: -120%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  color: color-mix(in srgb, var(--mint-ink) calc(var(--on) * 100%), var(--dim));
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* the awake face fades in over the sleeping one */
.go__face::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #8ff5cd, var(--mint) 55%, #48d6a0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  opacity: var(--on);
}

/* a glint that crosses the button once when it wakes */
.go__face::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--shine);
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}

.go__words,
.go__icon {
  position: relative;
  z-index: 1;
}

.go__words {
  font-size: 13.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.01em;
}

.go__icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .go:not(:disabled):hover .go__icon {
    transform: translateX(2px);
  }
  .go__icon {
    transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .state.is-checking {
    animation: none;
    color: var(--muted);
    background: none;
  }
}
