:root {
    --bg: #0f1220;
    --panel: #0f142a;
    --text: #e6e8f0;
    --muted: #9aa3b2;
    --accent: #7c5cff;
    --accent-2: #00d4ff;
    --ring: rgba(124, 92, 255, .35)
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(0, 212, 255, .15), transparent), radial-gradient(800px 400px at 90% 10%, rgba(124, 92, 255, .18), transparent), var(--bg);
    color: var(--text);
    font: 16px/1.6 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

.noise {
    position: fixed;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.015"/></svg>');
    pointer-events: none
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0
}

.nav ul {
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none
}

.nav a {
    color: var(--muted);
    text-decoration: none
}

.nav a:hover {
    color: var(--text)
}

.lang-switcher {
    background: var(--panel);
    border: 1px solid #2a2f45;
    border-radius: 8px;
    color: var(--text);
    padding: 6px 10px;
    font: inherit;
    cursor: pointer
}

.lang-switcher:hover,
.lang-switcher:focus {
    border-color: var(--ring);
    outline: none
}

.logo {
    font-weight: 800;
    letter-spacing: .5px
}

.logo span {
    color: var(--accent)
}

.hero {
    padding: 80px 0;
    text-align: center
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--ring);
    border-radius: 999px;
    color: var(--accent-2);
    background: rgba(0, 212, 255, .06);
    backdrop-filter: blur(4px);
    margin-bottom: 16px
}

.hero h1 {
    font-size: 48px;
    line-height: 1.1;
    margin: 10px 0 8px
}

.gradient {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent
}

.subtitle {
    color: var(--muted);
    max-width: 720px;
    margin: 0 auto 24px
}

.cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0 8px
}

.btn {
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #2a2f45;
    background: linear-gradient(180deg, #151a33, #0f142a);
    color: var(--text);
    text-decoration: none
}

.btn.primary {
    border-color: transparent;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #0b1020;
    font-weight: 700
}

.btn:hover {
    box-shadow: 0 0 0 4px var(--ring)
}

.socials {
    margin-top: 8px;
    display: flex;
    gap: 16px;
    justify-content: center
}

.card {
    background: linear-gradient(180deg, #121735, #0d1229);
    border: 1px solid #1c2442;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25)
}

.card h2 {
    margin-top: 0
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

.tile {
    background: linear-gradient(180deg, #151a3a, #0f142b);
    border: 1px solid #1e2644;
    border-radius: 14px;
    padding: 16px
}

.private-warning {
    color: #e6a23c;
    font-weight: 600
}

.footer {
    padding: 40px 0;
    color: var(--muted);
    text-align: center
}

@media (max-width:800px) {
    .hero h1 {
        font-size: 36px
    }

    .grid {
        grid-template-columns: 1fr
    }
}

/* Chat Widget Styles */
#chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: inherit;
}

#chat-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1020;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  font-weight: 700;
}

#chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
}

#chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  height: 550px;
  background: var(--panel);
  border: 1px solid #1c2442;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  transform-origin: bottom right;
}

#chat-window.chat-hidden {
  transform: scale(0.8);
  opacity: 0;
  pointer-events: none;
}

#chat-header {
  padding: 16px;
  background: linear-gradient(180deg, #151a33, #0f142a);
  border-bottom: 1px solid #1c2442;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

#chat-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

#chat-close:hover {
  color: var(--text);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.assistant {
  align-self: flex-start;
  background: #1c2442;
  border-bottom-left-radius: 2px;
  color: var(--text);
}

.message.assistant p {
  margin: 0 0 8px 0;
}

.message.assistant p:last-child {
  margin-bottom: 0;
}

.message.assistant ul {
  margin: 0;
  padding-left: 18px;
}

.message.assistant ol {
  margin: 0;
  padding-left: 20px;
}

.message.assistant li {
  margin: 4px 0;
}

.message.assistant h1,
.message.assistant h2,
.message.assistant h3,
.message.assistant h4,
.message.assistant h5,
.message.assistant h6 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 700;
}

.message.assistant pre {
  margin: 6px 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow-x: auto;
}

.message.assistant pre code {
  background: transparent;
  padding: 0;
}

.message.assistant code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 4px;
}

.message.assistant a {
  color: #a7c7ff;
  text-decoration: underline;
}

.message.assistant .chat-table-wrapper {
  margin-top: 8px;
  overflow-x: auto;
}

.message.assistant .chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.message.assistant .chat-table th,
.message.assistant .chat-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.message.assistant .chat-table th {
  background: rgba(255, 255, 255, 0.07);
  font-weight: 600;
}

.message.assistant .chat-table tbody tr:last-child td {
  border-bottom: none;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1020;
  border-bottom-right-radius: 2px;
  font-weight: 500;
}

#chat-input-area {
  padding: 16px;
  border-top: 1px solid #1c2442;
  display: flex;
  gap: 10px;
  margin: 0;
}

#chat-input {
  flex: 1;
  background: #0b1020;
  border: 1px solid #2a2f45;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  outline: none;
}

#chat-input:focus {
  border-color: var(--accent);
}

#chat-send {
  background: var(--accent);
  color: #0b1020;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#chat-send:hover {
  background: var(--accent-2);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: #1c2442;
  width: fit-content;
  border-radius: 14px;
  border-bottom-left-radius: 2px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: chat-bounce 1s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

@media (max-width: 480px) {
  #chat-window {
    width: calc(100vw - 48px);
    height: 70vh;
  }
}
