/*
 * NanoKoala lab visual system
 * Shared chrome and interaction polish. Lab-specific artwork and palettes
 * remain owned by each template.
 */

:root {
  --nk-lab-brand: #7c5bf2;
  --nk-lab-brand-deep: #5530bd;
  --nk-lab-ink: #1b1530;
  --nk-lab-surface: #ffffff;
  --nk-lab-line: rgba(124, 91, 242, 0.14);
  --nk-lab-shadow: 0 18px 50px -30px rgba(64, 39, 130, 0.42);
  --nk-lab-focus: 0 0 0 4px rgba(124, 91, 242, 0.22);
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.nk-lab-page {
  min-width: 320px;
  overflow-x: hidden;
}

body.nk-lab-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 4%, rgba(124, 91, 242, 0.09), transparent 24rem),
    radial-gradient(circle at 92% 16%, rgba(56, 189, 248, 0.07), transparent 22rem);
}

body.nk-lab-page > :is(.nk-lab-header, header) {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--nk-lab-line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 30px -24px rgba(27, 21, 48, 0.7);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

body.nk-lab-page > :is(.nk-lab-header, header) > div {
  min-height: 72px;
}

body.nk-lab-page > :is(.nk-lab-header, header) img[alt="NanoKoala"] {
  transition: transform 180ms ease, filter 180ms ease;
}

body.nk-lab-page > :is(.nk-lab-header, header) a:hover img[alt="NanoKoala"] {
  transform: translateY(-1px);
  filter: drop-shadow(0 6px 9px rgba(85, 48, 189, 0.18));
}

body.nk-lab-page > :is(.nk-lab-header, header) nav a {
  position: relative;
  isolation: isolate;
  border-radius: 14px;
}

body.nk-lab-page > :is(.nk-lab-header, header) nav a::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 12px;
  background: rgba(124, 91, 242, 0);
  transition: background-color 180ms ease;
}

body.nk-lab-page > :is(.nk-lab-header, header) nav a:hover::before {
  background: rgba(124, 91, 242, 0.08);
}

body.nk-lab-page > main {
  animation: nk-lab-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.nk-lab-page :where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--nk-lab-brand);
  outline-offset: 3px;
  box-shadow: var(--nk-lab-focus);
}

body.nk-lab-page :where(button, [role="button"], input[type="button"], input[type="submit"]) {
  -webkit-tap-highlight-color: transparent;
}

body.nk-lab-page :where(.panel, .card, .opt, .action-card, .premium-box) {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

body.nk-lab-page :where(.panel, .card, .premium-box) {
  box-shadow: var(--nk-lab-shadow);
}

body.nk-lab-page img {
  max-width: 100%;
}

body.nk-lab-page ::selection {
  color: #fff;
  background: var(--nk-lab-brand);
}

body.nk-lab-page * {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 91, 242, 0.5) rgba(124, 91, 242, 0.08);
}

body.nk-lab-page *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.nk-lab-page *::-webkit-scrollbar-track {
  background: rgba(124, 91, 242, 0.08);
}

body.nk-lab-page *::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(124, 91, 242, 0.48);
  background-clip: padding-box;
}

@keyframes nk-lab-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767px) {
  body.nk-lab-page > :is(.nk-lab-header, header) > div {
    min-height: 64px;
    height: 64px;
    padding-inline: 14px;
  }

  body.nk-lab-page > :is(.nk-lab-header, header) img[alt="NanoKoala"] {
    max-width: 148px;
  }

  body.nk-lab-page > :is(.nk-lab-header, header) #profile-btn > span:nth-child(2) {
    display: none;
  }

  body.nk-lab-page > main {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  body.nk-lab-page > header a[href="/register"],
  body.nk-lab-page > .nk-lab-header a[href="/register"] {
    flex: 0 0 42px !important;
    width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    justify-content: center !important;
    overflow: hidden !important;
    font-size: 0 !important;
  }

  body.nk-lab-page > header a[href="/register"] svg,
  body.nk-lab-page > header a[href="/register"] i,
  body.nk-lab-page > .nk-lab-header a[href="/register"] svg,
  body.nk-lab-page > .nk-lab-header a[href="/register"] i {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body.nk-lab-page > main {
    animation: none;
  }

  body.nk-lab-page *,
  body.nk-lab-page *::before,
  body.nk-lab-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
