/* The account security score that climbs on scroll. Colours in :root (the Playground palette): amber is the account
   at risk, mint is the account protected; the score mixes them into --score (moved by the script), everything else is
   neutral. GSAP moves .frame, the CSS styles .panel inside it. */
:root {
  --page: #08090b;          /* the page */
  --page-lift: #111318;     /* the soft lift of the page behind the panel */
  --panel: #121419;         /* the body of the panel */
  --panel-top: #181a20;     /* the top of the panel, where the light falls */
  --ink: #f1f2f4;           /* the words */
  --muted: #868a94;         /* the small words */
  --rule: rgba(255, 255, 255, 0.07); /* thin rules and edges */
  --risk: #f4a63a;          /* amber: the account at risk */
  --safe: #5be3a4;          /* mint: the account protected */
  --score: #f4a63a;         /* the colour of the score right now (moved by the script) */
  --glow: 0.4;              /* how strong the light behind the panel is (moved by the script) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--page); }
html, body { overflow-x: clip; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }

.check { position: relative; height: 420vh; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 7vw, 110px);
  padding: clamp(10px, 3vh, 40px) clamp(14px, 5vw, 64px);
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(110% 90% at 66% 50%, var(--page-lift), var(--page) 64%);
}
@supports (height: 100lvh) {
  .stage { height: 100lvh; }
}

/* the light the panel throws on the page, in the colour of the score */
.aura {
  position: absolute;
  z-index: -1;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--score) 75%, transparent), color-mix(in srgb, var(--score) 26%, transparent) 55%, transparent);
  filter: blur(40px);
  opacity: var(--glow);
}
.grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* the words at the side */
.words { width: clamp(220px, 34vw, 440px); flex: none; }
.words__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(11px, 1.5vh, 13px);
  font-weight: 600;
  margin-bottom: clamp(8px, 1.6vh, 14px);
}
.words__brand span { color: var(--muted); font-weight: 480; }
.words__logo, .head__icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.words__title {
  font-size: clamp(24px, min(4vw, 6vh), 52px);
  font-weight: 640;
  font-stretch: 108%;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.words__line { margin-top: clamp(10px, 2vh, 18px); font-size: clamp(13px, 1.9vh, 16px); line-height: 1.45; color: var(--muted); max-width: 30em; }

/* the panel */
.frame { flex: none; width: min(92vw, 372px); }
.panel {
  position: relative;
  border-radius: clamp(18px, 4vh, 24px);
  padding: clamp(12px, 3vh, 22px);
  background: linear-gradient(180deg, var(--panel-top), var(--panel) 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px var(--rule),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 12px 24px -12px rgba(0, 0, 0, 0.7),
    0 40px 80px -30px rgba(0, 0, 0, 0.9);
}
/* the light that follows the pointer over the panel */
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -40%), rgba(255, 255, 255, 0.05), transparent 70%);
}
/* the beam that runs once around the edge when the score is full */
.panel__beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(from var(--a, 0deg), transparent 0deg, transparent 250deg, color-mix(in srgb, var(--safe) 70%, transparent) 320deg, #ffffff 350deg, 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);
}
/* a slow glass sheen across the panel, moved by the scroll */
.panel__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
}
.panel__sheen::before {
  content: '';
  position: absolute;
  inset: -20% -60%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.035) 48%, rgba(255, 255, 255, 0.01) 53%, transparent 60%);
  transform: translateX(var(--sheen, -20%));
}

.head { position: relative; display: flex; align-items: center; gap: 10px; }
.head__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(28px, 7vh, 34px);
  height: clamp(28px, 7vh, 34px);
  border-radius: 10px;
  color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--score) 34%, #23252c), #17191e 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 14px -6px color-mix(in srgb, var(--score) 50%, transparent);
}
.head__text { min-width: 0; flex: 1; }
.head__title { font-size: clamp(13px, 3.4vh, 15px); font-weight: 600; letter-spacing: 0.005em; }
.head__text .muted { font-size: clamp(10.5px, 2.8vh, 12px); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 560;
  color: color-mix(in srgb, var(--score) 82%, #ffffff);
  background: color-mix(in srgb, var(--score) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--score) 34%, transparent);
}
.chip__words { display: inline-block; }

/* the dial: ticks that light from amber to mint, a thin arc inside, the score rolling in the middle */
.dial {
  position: relative;
  width: min(66%, 34vh, 236px);
  margin: clamp(6px, 2.4vh, 18px) auto clamp(6px, 2.2vh, 16px);
  container-type: inline-size;
}
.dial__svg { display: block; width: 100%; height: auto; overflow: visible; }
.stop-risk { stop-color: var(--risk); }
.stop-safe { stop-color: var(--safe); }
.dial__track, .dial__fill { fill: none; stroke-linecap: round; }
.dial__track { stroke: rgba(255, 255, 255, 0.07); stroke-width: 2; }
.dial__fill { stroke-width: 2.4; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.tick { stroke-linecap: round; stroke-width: 2.2; }
.dial__read {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
}
.score {
  display: inline-flex;
  font-size: 23cqw;
  line-height: 1;
  font-weight: 620;
  font-stretch: 96%;
  letter-spacing: -0.035em;
  font-variant-numeric: lining-nums;
}
.col { display: inline-block; height: 1em; overflow: hidden; text-align: center; }
.col--h { width: 0; }
.col__strip { display: flex; flex-direction: column; will-change: transform; }
.col__strip b { display: block; height: 1em; font-weight: inherit; }
.dial__label {
  margin-top: 1.6cqw;
  font-size: max(10px, 5.4cqw);
  color: var(--muted);
}
.dial__label span { display: inline-block; }

/* the list */
.list { position: relative; list-style: none; display: grid; gap: 2px; }
.focus {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 8px 18px -10px rgba(0, 0, 0, 0.8);
}
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: clamp(40px, 9.4vh, 54px);
  padding: 0 10px;
  border-radius: 14px;
  overflow: hidden;
}
.row__sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--safe) 14%, transparent) 50%, transparent 70%);
  transform: translateX(-110%);
}
.row__icon {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(26px, 6.4vh, 30px);
  height: clamp(26px, 6.4vh, 30px);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: var(--muted);
  transition: color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}
.row.is-on .row__icon {
  color: var(--safe);
  background: color-mix(in srgb, var(--safe) 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--safe) 24%, transparent);
}
.row__icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.row__text { position: relative; flex: 1; min-width: 0; display: grid; }
.row__text b { font-size: clamp(12px, 3.2vh, 13.5px); font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__text small { font-size: clamp(10px, 2.7vh, 11.5px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__pts {
  position: absolute;
  right: 54px;
  top: 50%;
  margin-top: -0.6em;
  font-size: 11px;
  font-weight: 600;
  color: var(--safe);
  opacity: 0;
  pointer-events: none;
}

/* the switch: GSAP moves the knob, the CSS draws its cap */
.toggle {
  position: relative;
  flex: none;
  width: 36px;
  height: 22px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle:focus-visible { outline: 2px solid var(--safe); outline-offset: 3px; }
.toggle__knob {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
}
.toggle__cap {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #dfe1e6);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 3px 6px -1px rgba(0, 0, 0, 0.45);
}

@media (hover: hover) {
  .toggle:hover .toggle__cap { background: linear-gradient(180deg, #ffffff, #eceef2); }
}

@media (max-width: 720px) {
  .stage { flex-direction: column; gap: clamp(8px, 2.4vh, 20px); }
  .words { width: 100%; text-align: center; }
  .words__brand { justify-content: center; margin-bottom: 4px; }
  .words__title { font-size: clamp(17px, min(5.4vw, 4.2vh), 28px); }
  .words__line { display: none; }
}
@media (max-width: 720px) and (max-height: 699px) {
  .words { display: none; }
}
@media (max-width: 360px) {
  .row { gap: 8px; padding: 0 7px; }
}
