@font-face {
  font-family: "Kepu Sans";
  src: url("/ui/fonts/TikTokSans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Kepu Mono";
  src: url("/ui/fonts/GeistMono.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Kepu Display Mono";
  src: url("/ui/fonts/DepartureMono-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --kepu-bg: #fbfaf4;
  --kepu-surface: #ffffff;
  --kepu-surface-raised: #efede7;
  --kepu-ink: #101111;
  --kepu-muted: #666660;
  --kepu-soft: #8b8b83;
  --kepu-line: rgba(54, 54, 48, 0.14);
  --kepu-line-strong: rgba(16, 17, 17, 0.42);
  --kepu-accent: #c0fe04;
  --kepu-blue: #14268f;
  --kepu-coral: #f2542d;
  --kepu-focus: #14268f;
}

html.dark {
  --kepu-bg: #0f1111;
  --kepu-surface: #151717;
  --kepu-surface-raised: #1d2020;
  --kepu-ink: #f8f8f2;
  --kepu-muted: #b0b2ac;
  --kepu-soft: #838680;
  --kepu-line: rgba(230, 232, 232, 0.13);
  --kepu-line-strong: rgba(248, 248, 242, 0.42);
  --kepu-focus: #c0fe04;
}

html,
body,
#app {
  min-height: 100%;
}

body.kepu-theme {
  background: var(--kepu-bg) !important;
  color: var(--kepu-ink) !important;
  font-family: "Kepu Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-feature-settings: "ss01" 1, "ss02" 1;
  letter-spacing: 0 !important;
}

body.kepu-theme *,
body.kepu-theme *::before,
body.kepu-theme *::after {
  letter-spacing: 0 !important;
}

body.kepu-theme ::selection {
  background: var(--kepu-accent);
  color: #101111;
}

body.kepu-theme :focus-visible {
  outline: 2px dotted var(--kepu-focus) !important;
  outline-offset: 2px;
}

body.kepu-theme h1,
body.kepu-theme h2,
body.kepu-theme h3,
body.kepu-theme h4,
body.kepu-theme .sidebar-brand-title {
  color: var(--kepu-ink) !important;
  font-family: "Kepu Sans", "Noto Sans SC", "PingFang SC", sans-serif !important;
  font-weight: 750 !important;
}

body.kepu-theme .font-mono,
body.kepu-theme code,
body.kepu-theme pre,
body.kepu-theme kbd,
body.kepu-theme .badge,
body.kepu-theme .sidebar-section-title,
body.kepu-theme .kepu-shell-stamp {
  font-family: "Kepu Mono", "SFMono-Regular", Consolas, monospace !important;
}

/* Application shell */
body.kepu-theme .sidebar {
  background: var(--kepu-surface) !important;
  border-right: 1px solid var(--kepu-line) !important;
  box-shadow: none !important;
}

body.kepu-theme .sidebar-header {
  min-height: 72px;
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--kepu-line);
}

body.kepu-theme .sidebar-logo {
  border: 1px solid var(--kepu-line-strong);
  border-radius: 3px !important;
  box-shadow: none !important;
}

body.kepu-theme .sidebar-brand-title {
  max-width: 148px;
  overflow-wrap: anywhere;
  font-size: 14px !important;
  line-height: 1.15 !important;
  text-transform: uppercase;
}

body.kepu-theme .sidebar-brand > button {
  border: 1px solid var(--kepu-line) !important;
  border-radius: 2px !important;
  background: transparent !important;
  color: var(--kepu-muted) !important;
  font-family: "Kepu Mono", monospace !important;
}

body.kepu-theme .sidebar-nav {
  padding: 14px 12px !important;
}

body.kepu-theme .sidebar-section-title {
  padding: 18px 10px 8px !important;
  color: var(--kepu-soft) !important;
  font-size: 10px !important;
  text-transform: uppercase;
}

body.kepu-theme .sidebar-link {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 2px !important;
  color: var(--kepu-muted) !important;
  font-size: 13px !important;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease !important;
}

body.kepu-theme .sidebar-link:hover {
  background: var(--kepu-surface-raised) !important;
  border-color: var(--kepu-line) !important;
  color: var(--kepu-ink) !important;
  transform: none !important;
}

body.kepu-theme .sidebar-link-active,
body.kepu-theme .sidebar-link.router-link-exact-active {
  background: var(--kepu-accent) !important;
  border-color: #101111 !important;
  color: #101111 !important;
  box-shadow: none !important;
}

body.kepu-theme .sidebar-link-active svg,
body.kepu-theme .sidebar-link.router-link-exact-active svg {
  color: #101111 !important;
}

body.kepu-theme .sidebar-footer {
  border-top: 1px solid var(--kepu-line) !important;
  background: var(--kepu-surface) !important;
}

body.kepu-theme header.glass,
body.kepu-theme header {
  background: color-mix(in srgb, var(--kepu-bg) 94%, transparent) !important;
  border-color: var(--kepu-line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(12px) !important;
}

body.kepu-theme header > div {
  min-height: 72px;
}

body.kepu-theme main {
  background: transparent !important;
}

body.kepu-theme .bg-mesh-gradient {
  background: var(--kepu-bg) !important;
  background-image: none !important;
}

body.kepu-theme .navigation-progress-bar {
  background: var(--kepu-accent) !important;
  background-image: none !important;
}

body.kepu-theme .bg-gradient-to-br.from-primary-500,
body.kepu-theme .bg-gradient-to-br.from-primary-600 {
  background: var(--kepu-accent) !important;
  background-image: none !important;
  color: #101111 !important;
}

body.kepu-theme .kepu-shell-stamp {
  display: block;
  margin-top: 5px;
  color: var(--kepu-soft);
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
}

/* Surfaces and dense data UI */
body.kepu-theme .card,
body.kepu-theme .card-glass,
body.kepu-theme .dropdown,
body.kepu-theme .modal,
body.kepu-theme .modal-content {
  background: var(--kepu-surface) !important;
  border: 1px solid var(--kepu-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.kepu-theme .modal-overlay {
  background: rgba(15, 17, 17, 0.58) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: blur(3px) !important;
}

body.kepu-theme .modal-content {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24) !important;
}

body.kepu-theme .card {
  position: relative;
  overflow: hidden;
}

body.kepu-theme .card:hover {
  border-color: var(--kepu-line-strong) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.kepu-theme .rounded-2xl,
body.kepu-theme .rounded-xl,
body.kepu-theme .rounded-lg,
body.kepu-theme .rounded-md {
  border-radius: 4px !important;
}

body.kepu-theme table,
body.kepu-theme thead,
body.kepu-theme tbody,
body.kepu-theme tr,
body.kepu-theme th,
body.kepu-theme td {
  border-color: var(--kepu-line) !important;
}

body.kepu-theme thead,
body.kepu-theme th {
  background: var(--kepu-surface-raised) !important;
  color: var(--kepu-muted) !important;
  font-family: "Kepu Mono", monospace !important;
  font-size: 11px !important;
  text-transform: uppercase;
}

body.kepu-theme tbody tr:hover {
  background: color-mix(in srgb, var(--kepu-accent) 10%, transparent) !important;
}

body.kepu-theme input,
body.kepu-theme textarea,
body.kepu-theme select,
body.kepu-theme .select-trigger,
body.kepu-theme .date-picker-trigger {
  background: var(--kepu-surface) !important;
  border-color: var(--kepu-line-strong) !important;
  border-radius: 3px !important;
  color: var(--kepu-ink) !important;
  box-shadow: none !important;
}

body.kepu-theme input::placeholder,
body.kepu-theme textarea::placeholder {
  color: var(--kepu-soft) !important;
}

body.kepu-theme input:focus,
body.kepu-theme textarea:focus,
body.kepu-theme select:focus,
body.kepu-theme .select-trigger:focus {
  border-color: var(--kepu-focus) !important;
  box-shadow: 0 0 0 1px var(--kepu-focus) !important;
}

body.kepu-theme .btn,
body.kepu-theme button {
  box-shadow: none !important;
}

body.kepu-theme .btn {
  border-radius: 3px !important;
  font-weight: 650 !important;
}

body.kepu-theme .btn-primary {
  background: var(--kepu-accent) !important;
  border-color: #101111 !important;
  color: #101111 !important;
}

body.kepu-theme .btn-primary:hover {
  background: #d2ff49 !important;
  transform: translateY(-1px) !important;
}

body.kepu-theme .btn-secondary,
body.kepu-theme .btn-ghost {
  background: transparent !important;
  border-color: var(--kepu-line) !important;
  color: var(--kepu-ink) !important;
}

body.kepu-theme .btn-secondary:hover,
body.kepu-theme .btn-ghost:hover {
  background: var(--kepu-surface-raised) !important;
  border-color: var(--kepu-line-strong) !important;
  transform: none !important;
}

body.kepu-theme .badge {
  border: 1px solid currentColor;
  border-radius: 2px !important;
  box-shadow: none !important;
}

body.kepu-theme .bg-primary-50,
body.kepu-theme .bg-primary-100 {
  background: color-mix(in srgb, var(--kepu-accent) 18%, var(--kepu-surface)) !important;
}

body.kepu-theme .bg-primary-500,
body.kepu-theme .bg-primary-600,
body.kepu-theme .bg-emerald-500,
body.kepu-theme .bg-emerald-600 {
  background: var(--kepu-accent) !important;
  color: #101111 !important;
}

body.kepu-theme .text-primary-300,
body.kepu-theme .text-primary-400,
body.kepu-theme .text-primary-500,
body.kepu-theme .text-primary-600,
body.kepu-theme .text-primary-700,
body.kepu-theme .text-emerald-600,
body.kepu-theme .text-emerald-700 {
  color: var(--kepu-blue) !important;
}

html.dark body.kepu-theme .text-primary-300,
html.dark body.kepu-theme .text-primary-400,
html.dark body.kepu-theme .text-primary-500,
html.dark body.kepu-theme .text-primary-600,
html.dark body.kepu-theme .text-primary-700,
html.dark body.kepu-theme .text-emerald-600,
html.dark body.kepu-theme .text-emerald-700 {
  color: var(--kepu-accent) !important;
}

body.kepu-theme .shadow-sm,
body.kepu-theme .shadow-md,
body.kepu-theme .shadow-lg,
body.kepu-theme .shadow-xl,
body.kepu-theme .shadow-2xl,
body.kepu-theme .shadow-glow {
  box-shadow: none !important;
}

/* Authentication surfaces */
body.kepu-auth {
  --kepu-ink: #ffffff;
  --kepu-muted: rgba(255, 255, 255, 0.72);
  --kepu-soft: rgba(255, 255, 255, 0.5);
  --kepu-line: rgba(255, 255, 255, 0.18);
  --kepu-line-strong: rgba(255, 255, 255, 0.48);
  background: #0a185d !important;
}

body.kepu-auth #app {
  position: relative;
  z-index: 2;
}

body.kepu-auth #app > .relative.flex.min-h-screen,
body.kepu-auth #app > div > .relative.flex.min-h-screen {
  justify-content: flex-end !important;
  padding: 24px 64px !important;
}

body.kepu-auth .bg-mesh-gradient,
body.kepu-auth [class*="blur-2xl"],
body.kepu-auth [class*="blur-3xl"] {
  background: transparent !important;
  opacity: 0 !important;
}

body.kepu-auth #app .bg-gradient-to-br.from-gray-50,
body.kepu-auth #app [class*="bg-[linear-gradient"] {
  background: transparent !important;
  background-image: none !important;
}

body.kepu-auth .kepu-auth-stage {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0a185d;
}

body.kepu-auth .kepu-auth-stage::after {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 36, 0.2);
  content: "";
}

body.kepu-auth .kepu-auth-brand {
  position: absolute;
  z-index: 2;
  top: 38px;
  left: 48px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

body.kepu-auth .kepu-auth-kicker {
  position: absolute;
  z-index: 2;
  top: 108px;
  left: 48px;
  max-width: 430px;
  color: #ffffff;
  font-family: "Kepu Sans", sans-serif;
  font-size: 42px;
  font-weight: 800;
  line-height: 0.98;
  text-transform: uppercase;
}

body.kepu-auth .kepu-auth-hello {
  position: absolute;
  z-index: 1;
  top: 36%;
  left: 3.5%;
  width: min(66vw, 960px);
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  object-fit: contain;
}

body.kepu-auth .kepu-auth-nib,
body.kepu-auth .kepu-auth-eyes {
  position: absolute;
  z-index: 2;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.22));
}

body.kepu-auth .kepu-auth-nib {
  right: 38%;
  bottom: 9%;
  width: 112px;
  transform: rotate(10deg);
}

body.kepu-auth .kepu-auth-eyes {
  top: 28px;
  right: 37%;
  width: 104px;
  transform: rotate(-9deg);
}

body.kepu-auth .kepu-auth-meta {
  position: absolute;
  z-index: 2;
  left: 48px;
  bottom: 32px;
  color: rgba(255, 255, 255, 0.78);
  font-family: "Kepu Display Mono", "Kepu Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

body.kepu-auth #app [class*="max-w-md"],
body.kepu-auth #app [class*="max-w-lg"] {
  position: relative;
  z-index: 3;
  margin: 0 !important;
}

body.kepu-auth #app .glass,
body.kepu-auth #app .card,
body.kepu-auth #app .card-glass,
body.kepu-auth #app [class*="bg-white"] {
  background: rgba(251, 250, 244, 0.96) !important;
  border: 1px solid rgba(16, 17, 17, 0.5) !important;
  border-radius: 4px !important;
  color: #101111 !important;
  box-shadow: 16px 16px 0 rgba(3, 8, 36, 0.28) !important;
  backdrop-filter: blur(16px) !important;
}

body.kepu-auth #app .glass *,
body.kepu-auth #app .card *,
body.kepu-auth #app .card-glass *,
body.kepu-auth #app [class*="bg-white"] * {
  --kepu-ink: #101111;
  color: #101111 !important;
}

body.kepu-auth #app .card-glass a {
  color: var(--kepu-blue) !important;
}

body.kepu-auth #app .card-glass .btn-primary,
body.kepu-auth #app .card-glass .btn-primary * {
  color: #101111 !important;
}

body.kepu-auth #app .text-gradient {
  background: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
}

body.kepu-auth #app [class*="max-w-md"] > div:first-child p,
body.kepu-auth #app [class*="max-w-lg"] > div:first-child p,
body.kepu-auth #app [class*="max-w-md"] > p,
body.kepu-auth #app [class*="max-w-lg"] > p {
  color: rgba(255, 255, 255, 0.72) !important;
}

body.kepu-auth #app [class*="max-w-md"] > p a,
body.kepu-auth #app [class*="max-w-lg"] > p a {
  color: var(--kepu-accent) !important;
}

@media (max-width: 1023px) {
  body.kepu-auth #app > .relative.flex.min-h-screen,
  body.kepu-auth #app > div > .relative.flex.min-h-screen {
    justify-content: center !important;
    padding: 20px !important;
  }

  body.kepu-auth .kepu-auth-brand {
    top: 24px;
    left: 24px;
  }

  body.kepu-auth .kepu-auth-kicker {
    top: 70px;
    left: 24px;
    max-width: 330px;
    font-size: 32px;
  }

  body.kepu-auth .kepu-auth-hello {
    top: 18%;
    left: -8%;
    width: 92vw;
    opacity: 0.72;
  }

  body.kepu-auth .kepu-auth-eyes,
  body.kepu-auth .kepu-auth-nib {
    display: none;
  }

  body.kepu-auth .kepu-auth-meta {
    left: 24px;
    bottom: 18px;
  }
}

@media (max-width: 640px) {
  body.kepu-theme main {
    padding: 16px !important;
  }

  body.kepu-auth #app [class*="max-w-md"] > div:first-child,
  body.kepu-auth #app [class*="max-w-lg"] > div:first-child {
    display: none !important;
  }

  body.kepu-auth .kepu-auth-kicker {
    max-width: 280px;
    font-size: 28px;
  }

  body.kepu-auth .kepu-auth-hello {
    top: 22%;
    left: -26%;
    width: 140vw;
    opacity: 0.5;
  }

  body.kepu-auth #app .glass,
  body.kepu-auth #app .card,
  body.kepu-auth #app [class*="bg-white"] {
    box-shadow: 8px 8px 0 rgba(3, 8, 36, 0.24) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.kepu-theme *,
  body.kepu-theme *::before,
  body.kepu-theme *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
