* {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f7f4;
  color: #111827;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.10), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(15, 23, 42, 0.08), transparent 28%),
    radial-gradient(circle at 50% 90%, rgba(99, 102, 241, 0.10), transparent 30%),
    #f7f7f4;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.055;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.glass {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.08);
}

.soft-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.07);
}

.product-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 14px 45px rgba(15, 23, 42, 0.06);
  transition: 0.22s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.22);
}

.btn {
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.gradient-title {
  background: linear-gradient(135deg, #111827 0%, #1d4ed8 48%, #111827 100%);
  -webkit-background-clip: text;
  color: transparent;
}

.preview-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.fade-in {
  animation: fadeIn 0.8s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating {
  animation: floating 5s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-top: 1.3rem;
  margin-bottom: 0.6rem;
}

.markdown-body h1 { font-size: 2rem; }
.markdown-body h2 { font-size: 1.55rem; }
.markdown-body h3 { font-size: 1.25rem; }
.markdown-body p { margin: 0.75rem 0; color: #475569; font-weight: 600; line-height: 1.75; }
.markdown-body ul, .markdown-body ol { margin: 0.75rem 0 0.75rem 1.25rem; color: #475569; font-weight: 600; }
.markdown-body li { margin: 0.4rem 0; }
.markdown-body a { color: #2563eb; font-weight: 900; }
.markdown-body code { background: #eef2ff; color: #1e3a8a; padding: 0.15rem 0.35rem; border-radius: 0.45rem; font-weight: 800; }
.markdown-body pre { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 1.25rem; overflow-x: auto; margin: 1rem 0; }
.markdown-body pre code { background: transparent; color: inherit; padding: 0; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border-radius: 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.84);
  padding: 0.95rem 1rem;
  font-weight: 700;
  outline: none;
  transition: 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.form-label {
  display: grid;
  gap: 0.55rem;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 900;
}

.code-window pre,
.code-window code {
  white-space: pre-wrap;
  word-break: break-word;
}

.zyphra-chat {
  position: fixed !important;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 99999;
  display: grid !important;
  justify-items: end;
  gap: 0.8rem;
  pointer-events: none;
}

.zyphra-chat-button,
.zyphra-chat-panel {
  pointer-events: auto;
}

.zyphra-chat-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  padding: 0.72rem 1rem;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22);
  transition: 0.2s ease;
}

.zyphra-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.zyphra-chat-button-icon {
  display: grid;
  height: 2.45rem;
  width: 2.45rem;
  place-items: center;
  border-radius: 1rem;
  background: #2563eb;
  color: #fff;
}

.zyphra-chat-button-icon svg,
.zyphra-chat-form button svg {
  height: 1.25rem;
  width: 1.25rem;
}

.zyphra-chat-panel {
  width: min(24rem, calc(100vw - 2rem));
  overflow: hidden;
  border-radius: 1.6rem;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.20);
}

.zyphra-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 1rem;
}

.zyphra-chat-close {
  display: grid;
  height: 2.25rem;
  width: 2.25rem;
  place-items: center;
  border: 0;
  border-radius: 0.9rem;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.zyphra-chat-messages {
  display: grid;
  max-height: 22rem;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
}

.zyphra-msg {
  display: flex;
}

.zyphra-msg-user {
  justify-content: flex-end;
}

.zyphra-msg-ai {
  justify-content: flex-start;
}

.zyphra-msg-bubble {
  max-width: 88%;
  border-radius: 1.15rem;
  padding: 0.78rem 0.92rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-wrap;
}

.zyphra-msg-user .zyphra-msg-bubble {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}

.zyphra-msg-ai .zyphra-msg-bubble {
  background: #f1f5f9;
  color: #334155;
  border-bottom-left-radius: 0.35rem;
}

.zyphra-msg-loading .zyphra-msg-bubble::after {
  content: '';
  display: inline-block;
  width: 1.3rem;
  text-align: left;
  animation: zyphraDots 1.2s infinite;
}

@keyframes zyphraDots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

.zyphra-chat-suggestions {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 0.8rem 1rem 0;
}

.zyphra-chat-suggestions button {
  flex: 0 0 auto;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.45rem 0.72rem;
  font-size: 0.75rem;
  font-weight: 900;
}

.zyphra-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 1rem;
}

.zyphra-chat-form input {
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1rem;
  background: #fff;
  padding: 0.82rem 0.95rem;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 800;
  outline: none;
}

.zyphra-chat-form input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.zyphra-chat-form button {
  display: grid;
  height: 2.85rem;
  width: 2.85rem;
  place-items: center;
  border: 0;
  border-radius: 1rem;
  background: #0f172a;
  color: #fff;
}

.zyphra-chat-form button:disabled,
.zyphra-chat-form input:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (max-width: 640px) {
  .zyphra-chat {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .zyphra-chat-panel {
    width: calc(100vw - 1.7rem);
  }

  .zyphra-chat-messages {
    max-height: 20rem;
  }
}

.zyphra-msg-bubble a {
  color: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.zyphra-msg-ai .zyphra-msg-bubble a {
  color: #1d4ed8;
}
