:root {
  --bg: #0b0d12;
  --bg2: #0f1115;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.06);
  --border: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(148, 163, 184, 0.32);

  --text: #e5e7eb;
  --muted: rgba(226, 232, 240, 0.75);

  --accent1: #20d6c7; /* teal */
  --accent2: #1a63ff; /* blue */
  --accent3: #ff8a2a; /* orange */

  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 10px;

  /* height of the sticky topbar used to offset anchor scrolling */
  --topbar-height: 25px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* ensure in-page anchor jumps account for the sticky header */
  scroll-padding-top: var(--topbar-height);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  color: var(--text);
  background: radial-gradient(1100px 700px at 15% -10%, rgba(32, 214, 199, 0.16), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(26, 99, 255, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.68);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.brand-name {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.topbar-cta {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 232, 240, 0.92);
  font-weight: 650;
  font-size: 0.9rem;
}

.chip:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

/* Hero */
.hero {
  padding: 3.25rem 1.25rem 2.25rem;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-title {
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

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

.hero-subtitle {
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  font-size: 0.95rem;
}

.btn.primary {
  border: none;
  background: linear-gradient(90deg, rgba(32, 214, 199, 0.95), rgba(26, 99, 255, 0.95));
  color: #061018;
  box-shadow: 0 14px 35px rgba(26, 99, 255, 0.18);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.35);
}

.hero-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(226, 232, 240, 0.86);
  font-size: 0.92rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

a.badge:hover {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent3);
  box-shadow: 0 0 0 4px rgba(255, 138, 42, 0.16);
}

/* Hero sample card */
.hero-card {
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(32, 214, 199, 0.14);
  border: 1px solid rgba(32, 214, 199, 0.32);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.85rem;
  font-weight: 750;
}

.muted {
  color: var(--muted);
}

.code-sample {
  margin: 0;
  padding: 1rem;
  min-height: auto;
  white-space: pre-wrap;
  color: rgba(226, 232, 240, 0.92);
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.90rem;
  line-height: 1.5;
}

/* Sections */
.section {
  padding: 2.4rem 1.25rem;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  margin: 0 0 0.5rem;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: 0 0 1.3rem;
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.6;
}

/* Playground */
.playground-shell {
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.playground-controls {
  display: flex;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.playground-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.playground-controls button {
  margin-left: auto;
}

.playground-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
}

/* Panels */
.panel {
  display: grid;
  gap: 0.5rem;
}

label {
  font-size: 0.9rem;
  color: rgba(203, 213, 245, 0.92);
}

/* Editor with syntax highlighting overlay */
.editor-wrap {
  position: relative;
  min-height: 320px;
}

.editor-wrap textarea,
.editor-wrap .editor-highlight {
  width: 100%;
  min-height: 320px;
  padding: 0.85rem;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin: 0;
}

.editor-wrap textarea {
  position: relative;
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: transparent;
  color: white;
  caret-color: #f8fafc;
  outline: none;
  z-index: 1;
}

.editor-wrap textarea:focus {
  border-color: rgba(32, 214, 199, 0.45);
  box-shadow: 0 0 0 4px rgba(32, 214, 199, 0.10);
}

.editor-wrap textarea::selection {
  background: rgba(32, 214, 199, 0.3);
}

/* Form controls */
select,
input[type="text"] {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(10, 12, 18, 0.55);
  color: rgba(226, 232, 240, 0.92);
  outline: none;
  font-size: 0.9rem;
}

select:focus,
input[type="text"]:focus {
  border-color: rgba(32, 214, 199, 0.45);
  box-shadow: 0 0 0 4px rgba(32, 214, 199, 0.10);
}

input[type="text"]::placeholder {
  color: rgba(226, 232, 240, 0.4);
}

button {
  padding: 0.6rem 1.05rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(32, 214, 199, 0.95), rgba(26, 99, 255, 0.95));
  color: #061018;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: -0.01em;
}

button:hover {
  filter: brightness(1.02);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}

/* Output blocks */
pre {
  min-height: 320px;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.5;
  overflow: auto;
}

/* Footer */
.footer {
  padding: 2rem 1.25rem 2.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.footer-title {
  font-weight: 900;
  letter-spacing: -0.02em;
}

.footer-subtitle {
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.92rem;
}

/* Make sure anchored sections are offset from the topbar */
.section,
.hero {
  scroll-margin-top: calc(var(--topbar-height) + 8px);
}

/* Responsive */
@media (max-width: 980px) {
  /* reduce the offset on small screens where the topbar is shorter */
  :root {
    --topbar-height: 64px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .playground-panels {
    grid-template-columns: 1fr;
  }

  .playground-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .playground-controls button {
    margin-left: 0;
  }

  .topbar-inner {
    grid-template-columns: 1fr auto;
  }

  .topbar-cta {
    display: none;
  }
}
