:root {
  --bg: #0b0e14;
  --bg-soft: #121620;
  --card: #171c29;
  --card-hover: #1c2233;
  --border: #262d40;
  --text: #e8ecf4;
  --muted: #9aa5bd;
  --accent: #4f8cff;
  --accent-2: #8b5cf6;
  --good: #34d399;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 96px 0 72px; text-align: center; }
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  margin: 20px auto 0; max-width: 640px;
  color: var(--muted); font-size: 1.15rem;
}
.hero .cta {
  margin-top: 36px; display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 10px;
  font-weight: 600; font-size: 0.98rem; cursor: pointer; border: none;
}
.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}
.btn-primary:hover { filter: brightness(1.1); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card); text-decoration: none; }

/* Sections */
section { padding: 56px 0; }
.section-title { font-size: 1.7rem; font-weight: 750; letter-spacing: -0.02em; }
.section-sub { color: var(--muted); margin-top: 6px; margin-bottom: 32px; }

/* Product grid */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background 0.15s, transform 0.15s;
}
.card:hover { background: var(--card-hover); transform: translateY(-2px); }
.card .icon { font-size: 1.9rem; line-height: 1; }
.card h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.badge {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 999px;
}
.badge-live { background: rgba(52, 211, 153, 0.12); color: var(--good); }
.badge-dev { background: rgba(79, 140, 255, 0.12); color: var(--accent); }
.ask { font-size: 0.9rem; font-weight: 600; cursor: pointer; color: var(--accent); background: none; border: none; padding: 0; }
.ask:hover { text-decoration: underline; }

/* About strip */
.about {
  background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.about .inner { max-width: 720px; }
.about p { color: var(--muted); margin-top: 12px; }

/* Contact */
.contact-form { max-width: 560px; display: grid; gap: 14px; }
.contact-form label { font-size: 0.9rem; font-weight: 600; color: var(--muted); display: grid; gap: 6px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font); font-size: 0.98rem;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.form-status { font-size: 0.95rem; min-height: 1.4em; }
.form-status.ok { color: var(--good); }
.form-status.err { color: #f87171; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Footer */
footer {
  border-top: 1px solid var(--border); padding: 36px 0; margin-top: 40px;
  color: var(--muted); font-size: 0.9rem;
}
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

/* Policy pages */
.policy { max-width: 760px; padding: 56px 24px; margin: 0 auto; }
.policy h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.policy .updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 32px; }
.policy h2 { font-size: 1.25rem; margin: 32px 0 10px; }
.policy p, .policy li { color: var(--muted); }
.policy ul { padding-left: 22px; margin: 10px 0; }

/* Chat widget */
#chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; font-size: 1.5rem; border: none; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center;
}
#chat-fab:hover { filter: brightness(1.1); }

#chat-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 100;
  width: min(380px, calc(100vw - 44px));
  height: min(540px, calc(100vh - 130px));
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: none; flex-direction: column; overflow: hidden;
}
#chat-panel.open { display: flex; }
.chat-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card);
}
.chat-head strong { font-size: 0.98rem; }
.chat-head small { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.chat-close { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 0.92rem; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: white; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.bot a { color: var(--accent); }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-contact-hint {
  align-self: flex-start; font-size: 0.85rem;
}
.chat-input {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--card);
}
.chat-input input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font); font-size: 0.92rem;
}
.chat-input input:focus { outline: none; border-color: var(--accent); }
.chat-input button {
  padding: 10px 16px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--accent); color: white; font-weight: 600;
}
.chat-input button:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 560px) {
  .hero { padding: 64px 0 48px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 0.82rem; white-space: nowrap; }
  .logo { font-size: 1.05rem; }
}
