@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #0b1528;
  --muted: #50607a;
  --line: #dfe6f0;
  --accent: #0d5bff;
  --emerald: #0d9466;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  margin: 0;
  font-family: "Onest", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(960px 440px at 8% -6%, rgba(13, 91, 255, 0.08), transparent 65%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  padding: 6px 11px;
  border-radius: 999px;
  background: #e7f7f1;
  color: #065f46;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.is-offline {
  background: #fef3c7;
  color: #92400e;
}

.ghost-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.workspace {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.intro-block {
  max-width: 68ch;
  margin-bottom: 26px;
}

.intro-block h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.playground-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.panel-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.form-stack {
  display: grid;
  gap: 15px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field input[type="number"],
.field input[type="url"],
.field input[type="text"],
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fbfcfe;
}

.color-picker-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-picker-wrap input[type="color"] {
  width: 42px;
  height: 40px;
  padding: 2px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
}

.swatches {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}

.swatch:hover {
  transform: scale(1.15);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  font-family: inherit;
}

.btn-primary,
.btn-secondary,
.btn-emerald,
.btn-outline {
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), filter 0.2s ease, opacity 0.2s ease;
}

.btn-primary {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.btn-secondary {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
}

.btn-emerald {
  border: 0;
  background: var(--emerald);
  color: #ffffff;
}

.btn-outline {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

button:not(:disabled):active {
  transform: scale(0.97);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0 16px;
}

.sub-heading {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.sub-copy {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.event-log {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b1528;
  color: #dbeafe;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  min-height: 60px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-sdk-btn {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.code-block {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 12px;
  background: #0b1528;
  color: #e2e8f0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
}

.live-preview-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafd;
  overflow: hidden;
}

.preview-meta {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}

.preview-meta strong {
  font-family: "JetBrains Mono", monospace;
  color: var(--ink);
}

.preview-placeholder {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.live-preview-box iframe {
  width: 100%;
  height: 660px;
  border: 0;
  display: block;
}

@media (max-width: 900px) {
  .playground-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}
