:root {
  --noah-bg: #16181d;
  --noah-bg-2: #1b1e24;
  --noah-surface: rgba(32, 36, 44, 0.88);
  --noah-surface-2: #242831;
  --noah-surface-3: #2a303a;
  --noah-border: rgba(255, 255, 255, 0.10);
  --noah-border-strong: rgba(255, 255, 255, 0.16);
  --noah-text: #f8fafc;
  --noah-muted: #c4cad4;
  --noah-soft: #8f99a8;
  --noah-lime: #22c55e;
  --noah-lime-2: #4ade80;
  --noah-cyan: #86e8dc;
  --noah-amber: #ff9d67;
  --noah-rose: #fb7185;
  --noah-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  --noah-shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.24);
  --noah-radius: 22px;
  --noah-radius-sm: 14px;
  --noah-radius-xs: 10px;
  --noah-font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --noah-font-mono: "JetBrains Mono", ui-monospace, monospace;
  --noah-ease: cubic-bezier(.22, 1, .36, 1);
}

html, body {
  min-height: 100%;
  background: var(--noah-bg);
  color: var(--noah-text);
  font-family: var(--noah-font-sans);
  color-scheme: dark;
}

body {
  margin: 0;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,0.035), transparent 34%);
  opacity: .8;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,1) 1px, transparent 0);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* Keep the native accessibility contract intact even when a component sets display. */
:where([hidden]) {
  display: none !important;
}

/* Keep touch feedback quiet without erasing intentional active/selected states. */
:where(button, a, [role="button"], [role="tab"], input, select, textarea) {
  -webkit-tap-highlight-color: transparent;
}

:where(button, a, [role="button"], [role="tab"]) {
  touch-action: manipulation;
}

:where(button, a, [role="button"], [role="tab"], input, select, textarea):focus {
  outline: none;
}

:where(button, a, [role="button"], [role="tab"], input, select, textarea):focus-visible {
  outline: 2px solid var(--noah-cyan);
  outline-offset: 3px;
}

::selection {
  background: rgba(34, 197, 94, 0.28);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.noah-shell {
  position: relative;
  z-index: 1;
}

.noah-mesh {
  position: fixed;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 25%, rgba(34, 197, 94, 0.18), transparent 28%),
    radial-gradient(circle at 80% 30%, rgba(134, 232, 220, 0.15), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(255, 157, 103, 0.10), transparent 34%);
  /* The gradients already have soft falloff; a viewport-wide blur forces full repaints. */
  opacity: .75;
  transform: translateZ(0);
}

/* The landing page owns its atmospheric background. Product screens stay
   quiet so data cards and controls remain the visual focus. */
body:not(.landing-page) .noah-mesh {
  display: none;
}

.glass-panel,
.glass-card,
.glass-bar {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid var(--noah-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--noah-shadow-soft);
}

.glass-panel {
  border-radius: var(--noah-radius);
}

.glass-card {
  border-radius: calc(var(--noah-radius) - 4px);
}

.glass-bar {
  border-radius: 999px;
}

/* Shared brand lockup: keep the mark and word cleanly separated from surfaces. */
.noah-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: var(--noah-text);
  background: transparent;
  box-shadow: none;
  transition: color .2s var(--noah-ease), transform .2s var(--noah-ease);
}

.noah-brand-pill::after {
  display: none;
}

.noah-brand-pill:hover {
  color: var(--noah-text);
  background: transparent;
  box-shadow: none;
  transform: translate3d(0, -1px, 0);
}

.noah-brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 10px 10px 10px 4px;
  color: #111;
  background: var(--noah-lime);
  font: 700 14px/1 var(--noah-font-mono);
  transform: rotate(-8deg);
  box-shadow: 0 0 28px rgba(215, 243, 107, .25);
}

.noah-brand-word {
  color: var(--noah-text);
  font: 800 17px/1.5 var(--noah-font-sans);
  letter-spacing: -.04em;
}

.noah-button,
.noah-icon-button {
  border: 1px solid transparent;
  border-radius: 14px;
  transition:
    transform .2s var(--noah-ease),
    box-shadow .2s var(--noah-ease),
    background .2s var(--noah-ease),
    border-color .2s var(--noah-ease),
    color .2s var(--noah-ease);
}

.noah-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.noah-button.primary {
  color: #091108;
  background: linear-gradient(135deg, var(--noah-lime), var(--noah-cyan));
  box-shadow: 0 14px 34px rgba(34, 197, 94, 0.18);
}

.noah-button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(34, 197, 94, 0.24);
}

.noah-button.secondary {
  color: var(--noah-text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--noah-border);
}

.noah-button.secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(134, 232, 220, 0.42);
}

.noah-button.ghost {
  color: var(--noah-muted);
  background: transparent;
  border-color: transparent;
}

.noah-button.ghost:hover {
  color: var(--noah-text);
  background: rgba(255, 255, 255, 0.04);
}

.noah-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--noah-muted);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--noah-border);
}

.noah-icon-button:hover {
  transform: translateY(-2px);
  color: var(--noah-text);
  border-color: rgba(134, 232, 220, 0.42);
  background: rgba(255, 255, 255, 0.06);
}

.noah-input,
.noah-select,
.noah-textarea {
  width: 100%;
  color: var(--noah-text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--noah-border);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color .2s var(--noah-ease), box-shadow .2s var(--noah-ease), background .2s var(--noah-ease);
}

.noah-input:focus,
.noah-select:focus,
.noah-textarea:focus {
  border-color: rgba(134, 232, 220, 0.5);
  box-shadow: 0 0 0 3px rgba(134, 232, 220, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.noah-badge,
.noah-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--noah-border);
  color: var(--noah-muted);
  background: rgba(255, 255, 255, 0.03);
  font: 600 12px var(--noah-font-mono);
  letter-spacing: .02em;
}

.noah-badge.success { color: #b8ffcf; border-color: rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .12); }
.noah-badge.info { color: #bbf7ff; border-color: rgba(134, 232, 220, .3); background: rgba(134, 232, 220, .10); }
.noah-badge.warning { color: #ffd1af; border-color: rgba(255, 157, 103, .3); background: rgba(255, 157, 103, .10); }
.noah-badge.danger { color: #fecdd3; border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .12); }

.noah-grid {
  display: grid;
  gap: 16px;
}

.noah-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.noah-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.noah-grid.auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.noah-section {
  padding: 28px;
}

.noah-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.noah-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--noah-lime);
  font: 600 11px var(--noah-font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.noah-title {
  margin: 8px 0 0;
  font: 700 clamp(28px, 4vw, 48px) / .98 var(--noah-font-mono);
  letter-spacing: -.06em;
}

.noah-subtitle {
  margin: 12px 0 0;
  color: var(--noah-muted);
  line-height: 1.7;
}

.noah-stat {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--noah-border);
  background: rgba(255, 255, 255, 0.03);
}

.noah-stat-value {
  display: block;
  margin-bottom: 4px;
  font: 800 24px var(--noah-font-mono);
  letter-spacing: -.05em;
}

.noah-stat-label {
  color: var(--noah-muted);
  font-size: 13px;
}

.noah-progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
}

.noah-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--noah-lime), var(--noah-cyan));
  box-shadow: 0 0 20px rgba(134, 232, 220, .18);
  transform: scale3d(var(--noah-progress, 0), 1, 1);
  transform-origin: left center;
  transition: transform .35s var(--noah-ease);
}

.noah-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  width: min(100%, 420px);
  margin-inline: auto;
  min-height: 180px;
  padding: 28px;
  text-align: center;
  color: var(--noah-muted);
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
}

.noah-empty strong {
  color: var(--noah-text);
}

.noah-skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.05);
}

.noah-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  animation: noahShimmer 1.4s infinite;
  will-change: transform;
}

.noah-skeleton-line {
  display: block;
  height: 12px;
  border-radius: 999px;
}

.noah-toast-stack {
  position: fixed;
  top: max(14px, calc(env(safe-area-inset-top) + 10px));
  left: 50%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
  transform: translateX(-50%);
}

.noah-toast {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: min(250px, calc(100vw - 24px));
  max-width: min(480px, calc(100vw - 24px));
  padding: 10px 10px 10px 13px;
  border-radius: 18px;
  border: 1px solid var(--noah-border);
  background: rgba(12, 18, 32, 0.92);
  box-shadow: var(--noah-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 12px;
  pointer-events: auto;
  /* The toast owns only its small surface, so both swipe directions can dismiss it. */
  touch-action: none;
  user-select: none;
  will-change: opacity, transform;
  animation: noahToastIn .22s var(--noah-ease) both;
}

.noah-toast.is-dismissing {
  pointer-events: none;
  animation: noahToastOut .2s var(--noah-ease) both;
}

.noah-toast-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--noah-cyan);
  background: rgba(134, 232, 220, .12);
  font: 700 11px/1 var(--noah-font-mono);
}

.noah-toast-copy {
  min-width: 0;
  color: var(--noah-text);
  line-height: 1.35;
}

.noah-toast-copy strong,
.noah-toast-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.noah-toast-copy small {
  margin-top: 2px;
  color: var(--noah-muted);
  font-size: 11px;
}

.noah-toast-close {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--noah-muted);
  background: transparent;
  font-size: 17px;
  line-height: 1;
  transition: color .16s var(--noah-ease), background .16s var(--noah-ease), transform .16s var(--noah-ease);
}

.noah-toast-close:hover {
  color: var(--noah-text);
  background: rgba(255, 255, 255, .08);
  transform: scale(1.06);
}

.noah-toast.success { border-color: rgba(34, 197, 94, .28); }
.noah-toast.info { border-color: rgba(134, 232, 220, .28); }
.noah-toast.warning { border-color: rgba(255, 157, 103, .28); }
.noah-toast.danger { border-color: rgba(251, 113, 133, .28); }

.noah-toast.success .noah-toast-icon { color: #b8ffcf; background: rgba(34, 197, 94, .14); }
.noah-toast.warning .noah-toast-icon { color: #ffd1af; background: rgba(255, 157, 103, .14); }
.noah-toast.danger .noah-toast-icon { color: #fecdd3; background: rgba(251, 113, 133, .14); }

.noah-toast small {
  color: var(--noah-muted);
}

@keyframes noahToastIn {
  from { opacity: 0; transform: translate3d(0, -10px, 0) scale(.96); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes noahToastOut {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(0, -10px, 0) scale(.96); }
}

@media (max-width: 520px) {
  .noah-toast-stack {
    width: calc(100vw - 24px);
  }

  .noah-toast {
    width: 100%;
    min-width: 0;
  }
}

.noah-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--noah-ease), transform .55s var(--noah-ease);
  transition-delay: var(--noah-reveal-delay, 0ms);
}

/* Promote only while an entrance is actually running; permanent layers hurt scrolling. */
.noah-reveal.is-revealing {
  will-change: opacity, transform;
}

.noah-reveal.reveal-instant,
.noah-reveal.reveal-instant.show {
  transition: none !important;
  transition-delay: 0ms !important;
  will-change: auto;
}

.noah-reveal.show {
  opacity: 1;
  transform: none;
}

.noah-fade {
  animation: noahFadeUp .45s var(--noah-ease);
}

@keyframes noahFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes noahShimmer {
  100% { transform: translateX(100%); }
}

@keyframes noahFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -8px, 0); }
}

@media (max-width: 900px) {
  .noah-grid.two,
  .noah-grid.three {
    grid-template-columns: 1fr;
  }

  .noah-section {
    padding: 22px;
  }
}

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

  .noah-reveal {
    opacity: 1;
    transform: none;
  }
}
