/* =========================================
   OneAI — Custom Styles
   ========================================= */

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #05070d; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #00e0ff);
  border-radius: 10px;
  border: 2px solid #05070d;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #00e0ff, #ff3bd3); }

/* ---------- Background textures ---------- */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.noise {
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");
  background-size: 200px 200px;
}

/* ---------- Navbar ---------- */
#navbar.scrolled {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(7, 10, 18, 0.72);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Language switcher ---------- */
#lang-switcher { position: relative; }
#lang-menu {
  animation: langFadeIn .2s cubic-bezier(.2,.7,.2,1);
  z-index: 60;
}
@keyframes langFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.lang-option {
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.lang-option.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0,224,255,0.12), rgba(124,58,237,0.12));
  border-left: 2px solid #00e0ff;
}
.lang-option:focus-visible {
  outline: none;
  background: rgba(255,255,255,0.08);
}

/* ---------- Top AI chips (hero) ---------- */
.ai-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.005em;
  cursor: default;
  transition: transform .4s cubic-bezier(.2,.7,.2,1),
              border-color .4s,
              background .4s,
              box-shadow .4s;
}
.ai-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(130deg, rgba(0,224,255,.7), rgba(124,58,237,.7), rgba(255,59,211,.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.ai-chip:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(124,58,237,0.45);
}
.ai-chip:hover::before { opacity: 1; }

/* tiny live dot to signal "local" */
.ai-chip .local-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4ff8d4;
  box-shadow: 0 0 8px rgba(79,248,212,0.8), 0 0 14px rgba(79,248,212,0.45);
  margin-left: 0.15rem;
  flex-shrink: 0;
  animation: pulseSlow 2.2s ease-in-out infinite;
}

@media (max-width: 640px) {
  .ai-chip {
    padding: 0.45rem 0.75rem 0.45rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.4rem;
  }
  .ai-chip .local-dot { width: 5px; height: 5px; }
}

/* ---------- Model pills in hero mockup ---------- */
.model-pill {
  flex-shrink: 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  transition: all .3s;
  cursor: default;
}
.model-pill:hover { color: #fff; border-color: rgba(255,255,255,0.18); }
.model-pill.active {
  color: #05070d;
  background: linear-gradient(135deg, #00e0ff, #4ff8d4);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(0,224,255,0.5);
  font-weight: 600;
}
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Hero typewriter ---------- */
.typewriter { display: inline; }
.cursor {
  display: inline-block;
  color: #00e0ff;
  animation: blink 1s steps(2, end) infinite;
  margin-left: 2px;
  font-weight: 300;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- Feature cards ---------- */
.feature-card {
  position: relative;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), border-color .5s, background .5s;
}
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  padding: 1px;
  background: linear-gradient(130deg, rgba(0,224,255,0), rgba(124,58,237,0), rgba(255,59,211,0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .5s, background .5s;
  pointer-events: none;
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.15);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
}
.feature-card:hover::before {
  opacity: 1;
  background: linear-gradient(130deg, rgba(0,224,255,0.8), rgba(124,58,237,0.8), rgba(255,59,211,0.8));
}
.feature-card::after {
  content: "";
  position: absolute;
  width: 300px; height: 300px;
  left: var(--mx, 50%); top: var(--my, 50%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.feature-card:hover::after { opacity: 1; }

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  margin-bottom: 1.5rem;
  transition: transform .5s;
}
.feature-card:hover .feature-icon { transform: scale(1.08) rotate(-4deg); }

.feature-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: #fff;
}
.feature-desc {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.feature-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Step cards ---------- */
.step-card {
  position: relative;
  padding: 2rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.005));
  backdrop-filter: blur(10px);
  transition: transform .5s, border-color .5s, background .5s;
  overflow: hidden;
}
.step-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,0.4);
}
.step-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #00e0ff, #7c3aed 60%, #ff3bd3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ---------- Compare rows ---------- */
.compare-row {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Hardware bars ---------- */
.hw-row {
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  transition: background .3s, border-color .3s;
}
.hw-row:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.15);
}
.hw-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.hw-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00e0ff, #7c3aed 60%, #ff3bd3);
  box-shadow: 0 0 16px rgba(124,58,237,0.5);
  width: 0 !important;
  transition: width 1.6s cubic-bezier(.2,.7,.2,1);
}
.is-visible .hw-fill { width: var(--target) !important; }
/* fallback: when reveal fires, inline style width takes over — handled via JS */

/* ---------- Chat widget ---------- */
#chat-panel {
  animation: chatFadeUp .4s cubic-bezier(.2,.7,.2,1);
}
@keyframes chatFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

#chat-messages::-webkit-scrollbar { width: 5px; }
#chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border: none; }

.chat-user {
  display: flex;
  justify-content: flex-end;
}
.chat-user .bubble {
  background: linear-gradient(135deg, #00e0ff, #7c3aed);
  color: #05070d;
  border-radius: 16px 16px 4px 16px;
  padding: 0.55rem 0.9rem;
  max-width: 260px;
  font-weight: 500;
}
.chat-bot {
  display: flex;
  gap: 0.6rem;
}
.chat-bot .avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00e0ff, #7c3aed);
  flex-shrink: 0;
}
.chat-bot .bubble {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border-radius: 16px 16px 16px 4px;
  padding: 0.6rem 0.85rem;
  max-width: 260px;
}

.typing-dots span {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  margin: 0 1px;
  animation: typingDot 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Utility glow buttons ---------- */
@media (hover: hover) {
  a[href="#download"]:hover,
  #download a:hover {
    letter-spacing: 0.01em;
  }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
  .feature-card { padding: 1.5rem; }
  .step-card { padding: 1.5rem; }
  h1 { letter-spacing: -0.02em; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
