@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }

body {
  margin: 0;
  width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #06070a;
  color: #e7eaee;
  overflow-x: hidden;
  /* iOS ignores user-scalable=no in some versions; this blocks the
     double-tap-to-zoom gesture specifically (still allows normal scrolling). */
  touch-action: manipulation;
}

code, .mono { font-family: 'JetBrains Mono', monospace; }
.display { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -0.02em; }

.App { min-height: 100vh; }

/* === BACKGROUND === */
.tx-bg {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(52, 211, 153, 0.10), transparent 60%),
    radial-gradient(900px 500px at 95% 10%, rgba(167, 139, 250, 0.09), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(251, 191, 36, 0.06), transparent 60%),
    linear-gradient(180deg, #06070a 0%, #08090c 100%);
}

/* Floating animated orbs */
.tx-orbs::before, .tx-orbs::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  animation: floatOrb 20s ease-in-out infinite;
}
.tx-orbs::before {
  width: 420px; height: 420px;
  background: radial-gradient(closest-side, rgba(52,211,153,0.55), transparent);
  top: -140px; left: -90px;
}
.tx-orbs::after {
  width: 500px; height: 500px;
  background: radial-gradient(closest-side, rgba(167,139,250,0.45), transparent);
  top: 30%; right: -180px;
  animation-delay: -8s;
}
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
}

.tx-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at center, black 40%, transparent 85%);
}

/* === CARDS === */
.tx-card {
  background:
    linear-gradient(180deg, rgba(22, 25, 31, 0.88), rgba(13, 15, 19, 0.88));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  position: relative;
}
.tx-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), transparent 35%);
  pointer-events: none;
}

.tx-card-hover {
  transition: transform 280ms cubic-bezier(.2,.7,.2,1), border-color 280ms ease, box-shadow 280ms ease;
}
.tx-card-hover:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 24px 70px -22px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.025);
}

/* Premium animated gradient border */
.tx-card-glow {
  position: relative;
}
.tx-card-glow::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 0deg,
    rgba(52,211,153,0.55),
    rgba(96,165,250,0.35),
    rgba(167,139,250,0.45),
    rgba(251,191,36,0.35),
    rgba(52,211,153,0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.75;
  animation: glowSpin 10s linear infinite;
}
@keyframes glowSpin {
  to { transform: rotate(360deg); }
}

/* === CHIPS === */
.tx-chip {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #c9cfd6;
  background: rgba(255,255,255,0.02);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tx-chip:hover { border-color: rgba(255,255,255,0.20); color: #fff; transform: translateY(-1px); }

/* === ICON TILES === */
.tx-icon-tile {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1), box-shadow 220ms ease;
}
.tx-card-hover:hover .tx-icon-tile { transform: rotate(-4deg) scale(1.06); }

.tx-tone-emerald { color: #34d399; background: linear-gradient(135deg, rgba(52,211,153,0.18), rgba(52,211,153,0.06)); border-color: rgba(52,211,153,0.30); box-shadow: 0 0 18px -6px rgba(52,211,153,0.35); }
.tx-tone-violet  { color: #a78bfa; background: linear-gradient(135deg, rgba(167,139,250,0.18), rgba(167,139,250,0.06)); border-color: rgba(167,139,250,0.30); box-shadow: 0 0 18px -6px rgba(167,139,250,0.35); }
.tx-tone-amber   { color: #fbbf24; background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(251,191,36,0.06)); border-color: rgba(251,191,36,0.30); box-shadow: 0 0 18px -6px rgba(251,191,36,0.35); }
.tx-tone-blue    { color: #60a5fa; background: linear-gradient(135deg, rgba(96,165,250,0.18), rgba(96,165,250,0.06)); border-color: rgba(96,165,250,0.30); box-shadow: 0 0 18px -6px rgba(96,165,250,0.35); }

.tx-pill-emerald { color: #6ee7b7; background: rgba(52, 211, 153, 0.10); border: 1px solid rgba(52, 211, 153, 0.28); }
.tx-pill-violet  { color: #c4b5fd; background: rgba(167, 139, 250, 0.10); border: 1px solid rgba(167, 139, 250, 0.28); }
.tx-pill-amber   { color: #fcd34d; background: rgba(251, 191, 36, 0.10);  border: 1px solid rgba(251, 191, 36, 0.28); }
.tx-pill-blue    { color: #93c5fd; background: rgba(96, 165, 250, 0.10);  border: 1px solid rgba(96, 165, 250, 0.28); }

/* === DIVIDER === */
.tx-divider {
  height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
}

/* === SHIMMER === */
.tx-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === ANIMATIONS === */
.tx-fade-up { animation: fadeUp 480ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.tx-fade-in { animation: fadeIn 380ms ease both; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* === INPUT === */
.tx-input {
  width: 100%;
  background: rgba(7, 8, 10, 0.65);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e7eaee;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.tx-input::placeholder { color: rgba(231,234,238,0.32); }
.tx-input:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
  background: rgba(7, 8, 10, 0.9);
}

/* === BUTTONS === */
.tx-btn-primary {
  background: linear-gradient(180deg, #5eead4 0%, #22c55e 100%);
  color: #052e16;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: 0 8px 22px -6px rgba(34, 197, 94, 0.55), inset 0 1px 0 rgba(255,255,255,0.32);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.tx-btn-primary::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-100%);
  transition: transform 600ms ease;
}
.tx-btn-primary:hover::before { transform: translateX(100%); }
.tx-btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(34, 197, 94, 0.65), inset 0 1px 0 rgba(255,255,255,0.4); }
.tx-btn-primary:active { transform: translateY(0); }
.tx-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.tx-btn-outline {
  background: rgba(255,255,255,0.025);
  color: #e7eaee;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
  font-weight: 500;
  cursor: pointer;
}
.tx-btn-outline:hover { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.06); transform: translateY(-1px); }

.tx-btn-tone-emerald { border-color: rgba(52,211,153,0.38); color: #5eead4; }
.tx-btn-tone-emerald:hover { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.6); }
.tx-btn-tone-violet  { border-color: rgba(167,139,250,0.38); color: #c4b5fd; }
.tx-btn-tone-violet:hover { background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.6); }
.tx-btn-tone-amber   { border-color: rgba(251,191,36,0.38); color: #fcd34d; }
.tx-btn-tone-amber:hover { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.6); }

/* === NOISE === */
.tx-grain::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.045;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* === OVERLAY === */
.tx-overlay {
  position: fixed; inset: 0;
  background: rgba(6,7,10,0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  z-index: 60;
  animation: fadeIn 220ms ease both;
  overflow-y: auto;
}

::selection { background: rgba(52,211,153,0.40); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.20); }
::-webkit-scrollbar-track { background: transparent; }

/* === GRADIENT TEXT === */
.tx-gradient-text-emerald {
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 50%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tx-gradient-text-violet {
  background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tx-gradient-text-amber {
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tx-gradient-text-aurora {
  background: linear-gradient(120deg, #34d399 0%, #60a5fa 35%, #a78bfa 70%, #fbbf24 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: auroraShift 8s ease-in-out infinite;
}
@keyframes auroraShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* === DOT === */
.tx-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.55);
  animation: dotPulse 1.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.5); }
  50% { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
}

/* === SCROLL PROGRESS === */
.tx-scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
.tx-scroll-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #34d399, #60a5fa, #a78bfa, #fbbf24);
  width: 0%;
  transition: width 80ms linear;
  box-shadow: 0 0 14px rgba(52,211,153,0.7);
}

/* === MOBILE === */
@media (max-width: 640px) {
  .tx-input { padding: 14px 16px; font-size: 15px; }
  .tx-card { border-radius: 18px; }
  .tx-btn-primary, .tx-btn-outline { padding: 12px 16px; font-size: 14px; }
  input, textarea, select { font-size: 16px !important; }
  .tx-orbs::before { width: 260px; height: 260px; top: -80px; left: -60px; }
  .tx-orbs::after { width: 300px; height: 300px; right: -100px; }
  h1, h2, h3 { letter-spacing: -0.02em; }
  footer { padding-bottom: env(safe-area-inset-bottom, 0); }
}

@media (hover: none) {
  .tx-card-hover:hover { transform: none; }
  .tx-card-hover:hover .tx-icon-tile { transform: none; }
}

/* Premium focus ring */
.tx-btn-primary:focus-visible,
.tx-btn-outline:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2), 0 8px 20px -8px rgba(34,197,94,0.5);
}

/* === SHEEN ANIMATION === */
.tx-sheen {
  position: relative; overflow: hidden;
}
.tx-sheen::after {
  content: "";
  position: absolute; top: 0; left: -150%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
  transform: skewX(-22deg);
  animation: sheen 6s ease-in-out infinite;
}
@keyframes sheen {
  0%, 70%, 100% { left: -150%; }
  85% { left: 150%; }
}

/* === TOASTS (vanilla port of shadcn/radix toast) === */
.tx-toast-viewport {
  position: fixed;
  top: 0; z-index: 100;
  display: flex; flex-direction: column-reverse;
  max-height: 100vh; width: 100%;
  padding: 16px;
  pointer-events: none;
}
@media (min-width: 640px) {
  .tx-toast-viewport { bottom: 0; right: 0; top: auto; left: auto; flex-direction: column; max-width: 420px; }
}
.tx-toast {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0d0f13;
  color: #e7eaee;
  padding: 14px 30px 14px 16px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.8);
  margin-top: 8px;
  animation: fadeUp 220ms ease both;
}
.tx-toast-title { font-size: 13.5px; font-weight: 600; }
.tx-toast-desc { font-size: 12.5px; opacity: 0.7; margin-top: 2px; }
.tx-toast-close {
  position: absolute; right: 8px; top: 8px;
  background: none; border: none; color: rgba(231,234,238,0.5);
  cursor: pointer; padding: 4px; border-radius: 6px; line-height: 0;
}
.tx-toast-close:hover { color: #fff; background: rgba(255,255,255,0.06); }
