:root {
  --bg: #050814;
  --bg-alt: #0b1020;
  --card-bg: #101524;
  --border-subtle: #222943;
  --accent: #4f8bff;
  --accent-soft: rgba(79, 139, 255, 0.12);
  --accent-strong: rgba(79, 139, 255, 0.2);
  --text-main: #f5f6ff;
  --text-muted: #a3a8c6;
  --danger: #ff6b7a;
  --success: #8be589;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* скрытые элементы */
[hidden] {
  display: none !important;
}

/* base */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  background: radial-gradient(circle at top, #151b34 0, #050814 55%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(5, 8, 20, 0.92),
    rgba(5, 8, 20, 0.78),
    transparent
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.logo-mark {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: radial-gradient(circle at 30% 20%, #61c4ff, #4f8bff);
  font-size: 14px;
}

.logo-text {
  font-size: 16px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.nav a {
  color: var(--text-muted);
  padding: 4px 0;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.18s ease-out;
}

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

.nav a:hover::after {
  width: 100%;
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out,
    background-color 0.08s ease-out, border-color 0.08s ease-out;
  white-space: nowrap;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-primary {
  background: linear-gradient(135deg, #4f8bff, #7b61ff);
  color: #fff;
  box-shadow: 0 10px 25px rgba(79, 139, 255, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(79, 139, 255, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

/* hero */

.hero {
  padding: 40px 0 32px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.hero-text h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 10px;
}

.hero-subtitle {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.hero-meta span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-card {
  border-radius: var(--radius-lg);
  background: radial_gradient(circle at 0 0, #223061 0, #101524 45%, #050814 100%);
}

/* Firefox не любит radial_gradient без дефиса */
.hero-card {
  background: radial-gradient(circle at 0 0, #223061 0, #101524 45%, #050814 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  font-size: 13px;
}

.hero-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(to right, rgba(9, 13, 28, 0.95), rgba(9, 13, 28, 0.7));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.dot-red {
  background: #ff5f57;
}
.dot-yellow {
  background: #febc2e;
}
.dot-green {
  background: #27c840;
}

.hero-card-title {
  margin-left: 6px;
  color: var(--text-muted);
}

.hero-card-body {
  padding: 12px 14px 14px;
}

.hero-code {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #dbe2ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-height: 160px;
  overflow: auto;
}

.hero-card-caption {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* sections */

.section {
  padding: 32px 0;
}

.section-alt {
  background: radial-gradient(circle at top left, #182036 0, #050814 55%);
}

.section h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.section-subtitle {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* features */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.feature {
  background: rgba(8, 12, 29, 0.9);
  border-radius: var(--radius-md);
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.feature p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* playground */

.section-header {
  max-width: 640px;
}

.playground {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 18px;
}

.playground-left,
.playground-right {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 14px 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.field-label-spaced {
  margin-top: 10px;
}

.prompt-input {
  width: 100%;
  background: #050814;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 11px;
  resize: vertical;
  min-height: 120px;
}

.prompt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 139, 255, 0.6);
}

.playground-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 8px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.checkbox input {
  accent-color: var(--accent);
}

.playground-actions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.run-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.field-error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

/* status right side */

.status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}

.status-label {
  color: var(--text-muted);
}

.status-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.status-idle {
  color: var(--text-muted);
}

.status-running {
  color: var(--accent);
}

.status-error {
  color: var(--danger);
}

.status-success {
  color: var(--success);
}

.log-panel {
  background: #050814;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 140px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.log-line {
  margin: 0;
  white-space: pre-wrap;
}

.log-line + .log-line {
  margin-top: 2px;
}

.log-prefix {
  color: #59608c;
}

.log-system {
  color: #7da2ff;
}

.log-error {
  color: var(--danger);
}

.log-faint {
  color: #4f5576;
}

.blinking-dot::after {
  content: "…";
  animation: blink 1.1s infinite steps(1, start);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hint-box {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 9px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

/* FAQ */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.faq-item {
  background: rgba(8, 12, 29, 0.9);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.faq-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* footer */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 0 18px;
  background: rgba(5, 8, 20, 0.98);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-meta {
  color: #4f5576;
}

/* modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 20, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  margin-top: 4px;
}

.modal-text {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.text-input {
  width: 100%;
  background: #050814;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 9px;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 139, 255, 0.5);
}

.modal-footer {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* эффект для кнопки "Посмотреть, как это работает" */

.how-pulse {
  box-shadow: 0 0 0 0 rgba(79, 139, 255, 0.7);
  animation: pulse 0.9s ease-out 1;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 139, 255, 0.7);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(79, 139, 255, 0);
  }
}

/* responsive */

@media (max-width: 880px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    order: -1;
  }

  .nav {
    display: none;
  }

  .playground {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .hero-text h1 {
    font-size: 26px;
  }

  .hero {
    padding-top: 26px;
  }

  .site-header {
    position: static;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
