/* Fingerprint Lab v3 experience layer — additive, accessible, and removable. */

:root {
  --font-ui: "Avenir Next", "Segoe UI Variable Text", "SF Pro Text", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Avenir Next", "Segoe UI Variable Display", "SF Pro Display", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-code: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  --pointer-x: 74vw;
  --pointer-y: 16vh;
  --accent-blue: #7799ff;
  --accent-violet: #ab87ff;
  --accent-cyan: #4ee4da;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 42%, transparent);
}

html {
  scrollbar-color: color-mix(in srgb, var(--accent-blue) 42%, transparent) transparent;
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
  font-synthesis: none;
}

:where(h1, h2, h3, h4, .brand b, .detail-value, .score-orb strong, .signal-card strong) {
  font-family: var(--font-display) !important;
}

:where(code, pre, kbd, samp) {
  font-family: var(--font-code) !important;
}

::selection {
  color: #fff;
  background: color-mix(in srgb, var(--accent-blue) 65%, #4939a8);
}

:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-cyan) 75%, white);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

.skip-link {
  z-index: 1000;
  color: #071018;
  background: #74eee4;
  border-radius: 0 0 12px 12px;
  padding: 11px 16px;
  font-weight: 700;
  position: fixed;
  top: 0;
  left: 18px;
  transform: translateY(-130%);
  transition: transform .18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  position: absolute !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page-progress {
  z-index: 250;
  height: 2px;
  pointer-events: none;
  position: fixed;
  inset: 0 0 auto;
}

.page-progress i {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet) 52%, var(--accent-cyan));
  width: 100%;
  height: 100%;
  display: block;
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent-blue) 72%, transparent);
}

.app-shell::before {
  content: "";
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(520px circle at var(--pointer-x) var(--pointer-y), #6c77ff15, transparent 67%),
    linear-gradient(120deg, transparent 14%, #4ee4da05 50%, transparent 82%);
  position: fixed;
  inset: 0;
}

.app-shell > main {
  position: relative;
  z-index: 1;
}

.onboarding::before,
.onboarding::after {
  content: "";
  pointer-events: none;
  border: 1px solid #91a5ff1a;
  border-radius: 50%;
  position: absolute;
  width: min(70vw, 760px);
  aspect-ratio: 1;
  animation: experience-orbit 24s linear infinite;
}

.onboarding::after {
  width: min(52vw, 560px);
  border-style: dashed;
  border-color: #4ee4da1a;
  animation-direction: reverse;
  animation-duration: 32s;
}

.onboard-card {
  isolation: isolate;
  background:
    linear-gradient(145deg, #111725e8, #090c14d9),
    radial-gradient(circle at 80% 0, #7184ff22, transparent 36%);
  box-shadow: 0 45px 160px #000c, inset 0 1px #ffffff12;
}

.onboard-card::before {
  content: "";
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 25%, #ffffff0a 47%, transparent 68%);
  position: absolute;
  inset: 0;
  transform: translateX(-110%);
  animation: experience-sheen 8s ease-in-out 1.4s infinite;
}

.onboard-card h1 em {
  background-size: 180% auto;
  animation: experience-gradient 7s ease-in-out infinite;
}

.onboard-about article,
.mode-grid button {
  transition: border-color .22s ease, background .22s ease, transform .22s ease, box-shadow .22s ease;
}

.onboard-about article:hover,
.mode-grid button:hover {
  background: #ffffff09;
  border-color: #83a0ff47;
  transform: translateY(-3px);
  box-shadow: 0 18px 45px #0005;
}

.sidebar nav button[data-nav-boundary="true"] {
  margin-top: 29px;
}

.sidebar nav button[data-nav-boundary="true"]::before {
  content: attr(data-nav-group);
  color: color-mix(in srgb, var(--muted) 78%, var(--accent-blue));
  letter-spacing: .16em;
  text-transform: uppercase;
  pointer-events: none;
  font-size: 8px;
  font-weight: 750;
  position: absolute;
  top: -20px;
  left: 11px;
}

.sidebar nav button[data-nav-boundary="true"]:first-child {
  margin-top: 20px;
}

.sidebar nav button {
  overflow: visible;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sidebar nav button:hover {
  transform: translateX(3px);
}

.sidebar nav button.active {
  box-shadow: inset 0 1px #ffffff0a, 0 8px 24px #405bd313;
}

.search:focus-within {
  border-color: #7797ff69;
  background: color-mix(in srgb, var(--panel) 88%, #637cff 12%);
  box-shadow: 0 0 0 3px #6482ff12, 0 16px 45px #0003;
}

.search input::placeholder {
  transition: color .18s ease;
}

.search:focus-within input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, white);
}

.glass {
  isolation: isolate;
}

.experience-reveal {
  opacity: 0;
  transform: translateY(18px) scale(.992);
  transition:
    opacity .62s cubic-bezier(.2, .75, .22, 1),
    transform .62s cubic-bezier(.2, .75, .22, 1);
  transition-delay: calc(var(--reveal-order, 0) * 38ms);
}

.experience-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.experience-tilt {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  transform: perspective(1000px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  will-change: transform;
}

.experience-tilt:hover {
  transform: perspective(1000px) translateY(-4px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.experience-tilt::after {
  content: "";
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--spot-x, 50%) var(--spot-y, 50%), #ffffff12, transparent 66%);
  border-radius: inherit;
  position: absolute;
  inset: 0;
  transition: opacity .2s ease;
}

.experience-tilt:hover::after {
  opacity: 1;
}

.dashboard-score,
.fingerprint-constellation,
.connection-map {
  position: relative;
  overflow: hidden;
}

.dashboard-score::before,
.connection-map::after {
  content: "";
  opacity: .62;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #82a2ff14, transparent);
  height: 1px;
  position: absolute;
  inset: 0 0 auto;
  animation: experience-scan 6s ease-in-out infinite;
}

.fingerprint-constellation .constellation-core::after {
  content: "";
  pointer-events: none;
  border: 1px solid #80a0ff2e;
  border-radius: inherit;
  position: absolute;
  inset: -13px;
  animation: experience-core-pulse 3.8s ease-in-out infinite;
}

.live i,
.eyebrow i {
  animation: experience-live 2.4s ease-in-out infinite;
}

.back-to-top {
  z-index: 45;
  width: 44px;
  height: 44px;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  background: color-mix(in srgb, var(--surface) 87%, transparent);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
  box-shadow: 0 16px 50px #0005;
}

.back-to-top:hover {
  border-color: #7898ff66;
  transform: translateY(-2px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.noscript-message {
  z-index: 9999;
  color: #f5f7fb;
  background: #111725;
  border: 1px solid #809dff55;
  border-radius: 16px;
  max-width: 620px;
  padding: 20px;
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 30px 120px #000b;
}

@keyframes experience-orbit {
  to { transform: rotate(360deg); }
}

@keyframes experience-sheen {
  0%, 66%, 100% { transform: translateX(-115%); }
  82% { transform: translateX(115%); }
}

@keyframes experience-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes experience-scan {
  0%, 100% { top: 0; opacity: 0; }
  12% { opacity: .65; }
  65% { opacity: .2; }
  80% { top: 100%; opacity: 0; }
}

@keyframes experience-live {
  0%, 100% { box-shadow: 0 0 7px var(--cyan); }
  50% { box-shadow: 0 0 17px var(--cyan); }
}

@keyframes experience-core-pulse {
  0%, 100% { opacity: .28; transform: scale(.94); }
  50% { opacity: .72; transform: scale(1.04); }
}

@media (max-width: 980px) {
  .sidebar nav button[data-nav-boundary="true"] {
    margin-top: 31px;
  }

  .back-to-top {
    bottom: 18px;
  }
}

@media (max-width: 760px) {
  .back-to-top {
    right: 12px;
    bottom: 84px;
  }

  .app-shell::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .onboarding::before,
  .onboarding::after {
    width: 120vw;
  }

  .onboard-about article:hover,
  .mode-grid button:hover,
  .experience-tilt:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .experience-reveal,
  .experience-reveal.is-visible,
  .experience-tilt,
  .experience-tilt:hover {
    opacity: 1;
    transform: none;
  }

  .onboarding::before,
  .onboarding::after,
  .onboard-card::before,
  .dashboard-score::before,
  .fingerprint-constellation .constellation-core::after,
  .connection-map::after,
  .live i,
  .eyebrow i {
    animation: none !important;
  }
}
