:root {
  --bg: #080a0d;
  --surface: #11161d;
  --fg: #e7ecf1;
  --muted: #93a0ad;
  --accent: #1d9bf0;
  --border: rgba(231, 236, 241, 0.11);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
}

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

button,
textarea {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: min(1020px, calc(100% - 44px));
  margin: 0 auto;
}

/* Borderless top navigation */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 16px 0;
  border-bottom: 1px solid transparent;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), backdrop-filter 200ms var(--ease);
}

.topbar.is-scrolled {
  background: rgba(8, 10, 13, 0.85);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.nav a {
  padding: 8px 4px;
  transition: color 180ms var(--ease);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--fg);
}

.nav-cta {
  padding: 7px 15px !important;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg) !important;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease) !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  border-color: rgba(29, 155, 240, 0.55);
  background: rgba(29, 155, 240, 0.12);
}

/* Hero — calm obsidian stage, zero backdrop noise */
.hero {
  position: relative;
  min-height: 100dvh;
  padding: 96px 0 64px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(56% 42% at 50% 8%, rgba(29, 155, 240, 0.11) 0%, rgba(29, 155, 240, 0) 100%),
    var(--bg);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.hero-copy {
  text-align: center;
  max-width: 680px;
}

.eyebrow {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4.6vw, 50px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.hero-subtitle {
  margin: 0 auto;
  font-size: 16px;
  color: var(--muted);
  text-wrap: pretty;
}

/* Interactive X Composer Stage */
.stage-shell {
  width: min(700px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 4px;
}

.preset-tabs {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.preset-btn {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 2px;
  min-height: 36px;
  cursor: pointer;
  transition: color 160ms var(--ease);
}

.preset-btn:hover {
  color: var(--fg);
}

.preset-btn.is-active {
  color: var(--fg);
  font-weight: 600;
}

.preset-btn.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.premium-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 160ms var(--ease);
}

.premium-toggle:hover {
  color: var(--fg);
}

.premium-toggle .toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(147, 160, 173, 0.45);
  transition: background-color 180ms var(--ease);
}

.premium-toggle.is-on {
  color: var(--accent);
}

.premium-toggle.is-on .toggle-dot {
  background: var(--accent);
}

.composer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px 16px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42);
}

.reply-context {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.reply-context[hidden] {
  display: none;
}

.reply-thread-line {
  width: 2px;
  margin: 4px auto 0;
  background: rgba(147, 160, 173, 0.35);
  border-radius: 999px;
}

.reply-body {
  font-size: 14px;
  color: var(--muted);
}

.reply-meta {
  margin-bottom: 3px;
}

.reply-meta strong {
  color: var(--fg);
  font-weight: 600;
}

.reply-body p {
  margin: 0;
  line-height: 1.5;
}

.composer-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(29, 155, 240, 0.14);
  border: 1px solid rgba(29, 155, 240, 0.36);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.composer-main {
  min-width: 0;
}

.composer-main textarea {
  width: 100%;
  min-height: 68px;
  resize: none;
  overflow: hidden;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-size: 17px;
  line-height: 1.6;
  padding: 2px 0 8px;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.x-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 140ms var(--ease);
}

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

.x-btn-primary {
  background: rgba(29, 155, 240, 0.16);
  border-color: rgba(29, 155, 240, 0.45);
  color: var(--accent);
}

.x-btn-primary:hover,
.x-btn-primary:focus-visible {
  background: rgba(29, 155, 240, 0.25);
}

.x-btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.x-btn-ghost:hover,
.x-btn-ghost:focus-visible {
  background: rgba(231, 236, 241, 0.06);
}

.x-btn[hidden] {
  display: none;
}

.shortcut-tip {
  margin-left: 4px;
  font-size: 13px;
  color: var(--muted);
}

.char-meter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 4px;
}

.meter-ring {
  transform: rotate(-90deg);
}

.meter-track {
  fill: none;
  stroke: rgba(231, 236, 241, 0.12);
  stroke-width: 2.4;
}

.meter-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: stroke-dashoffset 120ms linear, stroke 180ms var(--ease);
}

.char-count {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.char-meter.is-over .char-count {
  color: #f45d48;
  font-weight: 600;
}

.char-meter.is-over .meter-progress {
  stroke: #f45d48;
}

.post-native-btn {
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 0;
  background: var(--fg);
  color: #080a0d;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 160ms var(--ease), transform 140ms var(--ease);
}

.post-native-btn:hover {
  opacity: 0.9;
}

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

.stage-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.stage-status[hidden] {
  display: none;
}

/* CTAs */
.hero-actions,
.closing-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  transition: filter 180ms var(--ease);
}

.btn-download:hover,
.btn-download:focus-visible {
  filter: brightness(1.08);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: rgba(231, 236, 241, 0.28);
  background: rgba(231, 236, 241, 0.05);
}

/* Sections on pure canvas */
.section {
  padding: 92px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.section-kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.centered-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 52px;
}

.section-lead {
  margin: 0 0 24px;
  color: var(--muted);
  text-wrap: pretty;
}

.engine-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.engine-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 18px;
  min-height: 38px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 180ms var(--ease), background-color 180ms var(--ease);
}

.engine-tab.is-active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* Canvas 3-step horizontal flow (no nested boxes!) */
.flow-canvas {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 34px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.flow-step {
  min-width: 0;
}

.flow-num {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.flow-step h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.flow-step p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  text-wrap: pretty;
}

.flow-arrow {
  padding-top: 26px;
  font-size: 18px;
  color: rgba(147, 160, 173, 0.45);
  user-select: none;
}

.support-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 28px;
}

.support-strip[hidden] {
  display: none;
}

.support-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.support-col strong {
  font-size: 15px;
  font-weight: 600;
}

.support-col span {
  font-size: 14px;
  color: var(--muted);
}

/* Section 3: Concise hairline spine */
.section-head {
  margin-bottom: 38px;
}

.spine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.spine-item {
  display: grid;
  grid-template-columns: 64px 200px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 180ms var(--ease);
}

.spine-item:hover {
  border-bottom-color: rgba(29, 155, 240, 0.45);
}

.spine-num {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.spine-title {
  font-size: 17px;
  font-weight: 600;
}

.spine-text {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  text-wrap: pretty;
}

/* Section 4: Install steps without code pill clutter */
.steps-canvas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 42px;
}

.step-col {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.step-index {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.step-col h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.step-col p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  text-wrap: pretty;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 38px;
  color: var(--muted);
  font-size: 14px;
}

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

.footer-brand,
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-links {
  gap: 20px;
}

.footer-links a:hover {
  color: var(--fg);
}

@media (max-width: 820px) {
  .flow-canvas {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .flow-arrow {
    display: none;
  }

  .support-strip,
  .steps-canvas {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .spine-item {
    grid-template-columns: 44px 1fr;
    gap: 6px 14px;
  }

  .spine-text {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(1020px, calc(100% - 28px));
  }

  .nav a:not(.nav-cta) {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 80px 0 48px;
  }

  .hero-inner {
    gap: 20px;
  }

  .hero-copy h1 {
    font-size: 30px;
  }

  .composer-card {
    padding: 15px 16px 14px;
    border-radius: 16px;
  }

  .composer-row,
  .reply-context {
    grid-template-columns: 32px 1fr;
    gap: 10px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .composer-main textarea {
    font-size: 16px;
    min-height: 56px;
  }

  .shortcut-tip {
    display: none;
  }

  .section {
    padding: 64px 0;
  }

  .centered-head {
    margin-bottom: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
