/* memexweb chrome — hand-written effect layer (companions app.css/Tailwind).
   Owns the things utilities can't: blueprint grid, scanlines, glass,
   animated gradient borders, spinner states. Dark "tech" theme. */

:root {
  --ink-950: #0a0e14;
  --ink-900: #0f1620;
  --ink-800: #131c2b;
  --accent: #22d3ee;
  --glow: #a78bfa;
}

html { background: var(--ink-950); }

html, body { overflow-x: hidden; }

/* thin dark scrollbars everywhere (webkit + firefox) */
* { scrollbar-width: thin; scrollbar-color: rgba(34, 211, 238, 0.25) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, 0.22); border-radius: 3px; }
*::-webkit-scrollbar-track { background: transparent; }

body {
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(167, 139, 250, 0.07), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(34, 211, 238, 0.06), transparent 55%),
    var(--ink-950);
  min-height: 100vh;
}

/* fine blueprint grid overlay */
.fx-grid {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 78%);
}

/* subtle scanlines over everything (very low alpha, pointer-events none) */
.fx-scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0px,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

/* glassy panel */
.fx-glass {
  background: linear-gradient(160deg, rgba(19, 28, 43, 0.82), rgba(15, 22, 32, 0.88));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* animated conic gradient border for the primary panel.
   The border is a pseudo-element spinning a conic-gradient behind the panel. */
@property --_angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.fx-border-glow { position: relative; isolation: isolate; }
.fx-border-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--_angle),
    rgba(34, 211, 238, 0.0) 0%,
    rgba(34, 211, 238, 0.65) 12%,
    rgba(167, 139, 250, 0.5) 24%,
    rgba(34, 211, 238, 0.0) 38%,
    rgba(34, 211, 238, 0.0) 100%
  );
  -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, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: borderspin 6s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* glowing focus ring */
.fx-focus:focus-within, .fx-focus:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18), 0 0 22px rgba(34, 211, 238, 0.22);
}

/* button spinner state (JS adds .is-busy, keeps native submit flowing) */
.fx-spinner { position: relative; }
.fx-spinner.is-busy {
  color: transparent !important;
  pointer-events: none;
}
.fx-spinner.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.25);
  border-top-color: var(--accent);
  animation: fxspin 0.7s linear infinite;
}
@keyframes fxspin { to { transform: rotate(360deg); } }

/* skeleton shimmer block */
.fx-skeleton {
  background: linear-gradient(
    90deg,
    rgba(19, 28, 43, 0.9) 25%,
    rgba(34, 211, 238, 0.10) 50%,
    rgba(19, 28, 43, 0.9) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* gradient wordmark text */
.fx-wordmark {
  background: linear-gradient(100deg, var(--accent) 10%, #7dd3fc 45%, var(--glow) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* smooth everything interactive */
a, button, input, textarea, [role="button"] {
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* honor reduced motion for this hand-written layer too */
@media (prefers-reduced-motion: reduce) {
  .fx-border-glow::before, .fx-spinner.is-busy::after,
  .fx-skeleton, .fx-grid, .fx-scanlines {
    animation: none !important;
  }
}

/* pulsing "live" indicator for background processing */
.fx-live-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #22d3ee;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5);
  animation: fx-live-pulse 1.6s ease-out infinite;
}
@keyframes fx-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .fx-live-dot { animation: none; }
}
