:root {
  --bg: #090a0f;
  --bg-elevated: #10121a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #f8fafc;
  --ink-muted: #94a3b8;
  --ink-dim: #64748b;
  --accent: #6366f1;
  --accent-bright: #818cf8;
  --teal: #2dd4bf;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --warn-border: rgba(245, 158, 11, 0.28);
  --warn-ink: #fcd34d;
  --err-bg: rgba(239, 68, 68, 0.12);
  --err-border: rgba(239, 68, 68, 0.35);
  --err-ink: #fca5a5;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --ok-border: rgba(16, 185, 129, 0.32);
  --ok-ink: #6ee7b7;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse 80% 50% at 50% -15%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 10%, rgba(45, 212, 191, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: rgba(9, 10, 15, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #090a0f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links button.nav-btn {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links button.nav-btn:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.nav-links a.lang-switch {
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  margin-left: 0.4rem;
}

.nav-links a.nav-cta {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  margin-left: 0.35rem;
  box-shadow: 0 2px 14px rgba(99, 102, 241, 0.35);
}

.nav-links a.nav-cta:hover {
  filter: brightness(1.1);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
}

.inline-form {
  display: inline;
}

/* Main */
main {
  flex: 1;
  padding: 2.75rem 0 4.5rem;
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4rem 3rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(45, 212, 191, 0.1), transparent 45%);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #c7d2fe;
  margin-bottom: 1.5rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.hero h1 {
  font-size: clamp(2.15rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0 0 1.25rem;
  max-width: 20ch;
  background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 1.12rem;
  color: var(--ink-muted);
  max-width: 58ch;
  margin: 0 0 2.25rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.45rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, filter 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.12);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-full {
  width: 100%;
}

/* Alerts & Banners */
.banner {
  border-radius: var(--radius);
  padding: 0.95rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.banner h2, .banner h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.banner p {
  margin: 0;
}

.banner-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

.banner-err {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: var(--err-ink);
}

.banner-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-ink);
}

/* Grids & Cards */
.section-title {
  font-size: 1.45rem;
  letter-spacing: -0.025em;
  margin: 2.5rem 0 1.15rem;
  color: var(--ink);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-spaced {
  margin: 1.25rem 0;
}

.card h1, .card h2, .card h3 {
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
}

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

.prose {
  max-width: 72ch;
}

.prose h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}

.meta-line {
  color: var(--ink-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.quote-block {
  border-left: 3px solid var(--accent-bright);
  background: var(--surface);
  padding: 1.35rem 1.6rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--ink);
  margin: 1rem 0 1.75rem;
}

.values-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.values-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.values-list strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.values-list span {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.clean-list {
  padding-left: 1.25rem;
  color: var(--ink-muted);
}

.clean-list li {
  margin-bottom: 0.55rem;
}

/* Forms */
.form-card {
  max-width: 520px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  margin-bottom: 0.4rem;
  color: var(--ink-muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(9, 10, 15, 0.75);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 1rem 0 1.25rem;
}

.checkbox-row input {
  margin-top: 0.25rem;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

/* Modern Minimal Chat Workspace */
.chat-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.chat-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin: 0 0 0.75rem;
}

.sidebar-section {
  margin-bottom: 1.4rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.app-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 11px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.22);
  color: #ccfbf1;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.app-chip small {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--teal);
}

.thread-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.thread-item a {
  display: block;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.thread-item a:hover,
.thread-item a.active {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--border);
}

.thread-item strong {
  display: block;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 0.74rem;
  color: var(--ink-dim);
  margin-top: 0.15rem;
}

.chat-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.chat-stage-centered {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.chat-welcome {
  max-width: 520px;
}

.chat-welcome h1 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}

.chat-welcome p {
  color: var(--ink-muted);
  margin: 0;
  font-size: 0.96rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

.status-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

.prompt-form {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.prompt-box {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  background: rgba(9, 10, 15, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 0.65rem 0.65rem 0.65rem 1.1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.prompt-box:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.prompt-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.5;
  resize: none;
  min-height: 28px;
  max-height: 200px;
  padding: 0.35rem 0;
}

.prompt-box textarea:focus {
  outline: none;
}

.prompt-box textarea::placeholder {
  color: var(--ink-dim);
}

.prompt-send {
  flex-shrink: 0;
  height: 38px;
  padding: 0 1.1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.prompt-send:hover {
  filter: brightness(1.12);
}

.prompt-send:active {
  transform: scale(0.97);
}

.prompt-hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-align: center;
}

/* Messages */
.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.thread-header h1 {
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.messages-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.msg {
  border-radius: 16px;
  padding: 0.95rem 1.15rem;
  max-width: 85%;
  font-size: 0.95rem;
}

.msg-customer {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.24), rgba(79, 70, 229, 0.18));
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.msg-operator {
  align-self: flex-start;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.msg-system {
  align-self: center;
  max-width: 92%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  font-size: 0.84rem;
  text-align: center;
}

.msg-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.74rem;
  color: var(--ink-dim);
  margin-bottom: 0.35rem;
}

.msg-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--surface-strong);
  color: var(--ink-muted);
}

.pill-supervised {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.pill-replied {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.code-box {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(9, 10, 15, 0.7);
  border: 1px dashed var(--accent-bright);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  display: inline-block;
  margin: 0.5rem 0;
  color: #e0e7ff;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.84rem;
  color: var(--ink-dim);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-inner a {
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--ink);
}

/* Responsive */
@media (max-width: 860px) {
  .grid-2,
  .values-list,
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2.25rem 1.4rem;
  }

  .chat-stage {
    padding: 1.25rem;
    min-height: 400px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 0 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
  }
}
