:root {
  --x-blue: rgb(29, 155, 240);
  --x-blue-dark: rgb(26, 140, 216);
  --text: #0f1419;
  --muted: #536471;
  --border: #eff3f4;
  --bg: #fff;
  --bg-soft: #f7f9fa;
  --bg-card: #fff;
  --shadow: 0 1px 2px rgba(15, 20, 25, 0.04), 0 8px 24px rgba(15, 20, 25, 0.06);
  --radius: 16px;
  --pink: #ff6b9d;
  --green: #00ba7c;
  --btn-bg: #0f1419;
  --btn-fg: #fff;
  --btn-hover: #272c30;
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --highlight-grad-start: #fff;
  --highlight-grad-end: #fef0f6;
  --highlight-border: #f5c2d4;
  --highlight-code-bg: #fff;
  --safe-grad-start: #fff;
  --safe-grad-end: #e8f9f0;
  --safe-border: #b8e8d0;
  --trust-grad-start: #f0f9ff;
  --trust-grad-end: #e0f2fe;
  --trust-border: #bae6fd;
  --trust-btn-bg: #fff;
}

[data-theme="dark"] {
  --text: #e7e9ea;
  --muted: #71767b;
  --border: #2f3336;
  --bg: #000000;
  --bg-soft: #16181c;
  --bg-card: #16181c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.6);
  --btn-bg: #e7e9ea;
  --btn-fg: #0f1419;
  --btn-hover: #c8cccd;
  --topbar-bg: rgba(0, 0, 0, 0.72);
  --highlight-grad-start: #16181c;
  --highlight-grad-end: #2d0e1c;
  --highlight-border: #4a1830;
  --highlight-code-bg: #1f1116;
  --safe-grad-start: #16181c;
  --safe-grad-end: #0a2d1c;
  --safe-border: #1c4a30;
  --trust-grad-start: #0c1f33;
  --trust-grad-end: #0a2945;
  --trust-border: #1e3a5c;
  --trust-btn-bg: #16181c;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--x-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

button {
  font: inherit;
  cursor: pointer;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}
.topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}
.topbar-links a { color: var(--text); font-weight: 600; }
.topbar-cta {
  background: var(--btn-bg);
  color: var(--btn-fg) !important;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none !important;
}
.topbar-cta:hover { background: var(--btn-hover); }
.topbar-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
}
.topbar-icon:hover {
  text-decoration: none;
  color: var(--x-blue);
}

/* Theme toggle icon swap */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-flex; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-flex; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Buttons */
.btn-primary, .btn-ghost {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg) !important;
}
.btn-primary:hover { background: var(--btn-hover); text-decoration: none; }
.btn-primary.big { padding: 18px 32px; font-size: 17px; }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--x-blue);
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero .lede {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 520px;
}
.hero .lede strong { color: var(--text); }
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-fineprint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Hero demo (browser frame mockup) — always dark to match X */
.hero-demo {
  position: relative;
}
.demo-frame {
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  border: 1px solid #2a3236;
}
.demo-frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #16181c;
  border-bottom: 1px solid #2a3236;
}
.demo-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.demo-dot.red { background: #ff5f57; }
.demo-dot.yellow { background: #febc2e; }
.demo-dot.green { background: #28c840; }
.demo-frame-title {
  margin-left: 14px;
  color: #71767b;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.demo-list {
  background: #000;
  color: #e7e9ea;
  min-height: 420px;
  padding: 4px 0 80px;
  position: relative;
}
.demo-toggle {
  position: absolute;
  bottom: 14px;
  right: 14px;
}
.toggle-btn {
  background: rgba(29, 155, 240, 0.95);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 16px 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(29, 155, 240, 0.4);
}
.toggle-btn:hover { background: var(--x-blue-dark); }
.toggle-knob {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s ease;
}
.toggle-btn[data-state="on"] .toggle-knob { transform: translateX(0); }

/* DM rows in demo */
.dm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #16181c;
  position: relative;
  transition: max-height 0.25s ease, filter 0.25s ease;
  max-height: 200px;
  overflow: hidden;
}
.dm-row.filtered {
  max-height: 56px;
}
.dm-row.filtered .dm-content {
  filter: blur(8px);
  pointer-events: none;
}
.dm-row .ofb-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(15, 20, 25, 0.6);
  z-index: 2;
}
.dm-row.filtered .ofb-overlay { display: flex; }
.ofb-pill {
  background: rgba(29, 155, 240, 0.95);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font: 700 11px/1 inherit;
  cursor: pointer;
}
.ofb-explain {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.dm-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.dm-info {
  flex: 1;
  min-width: 0;
}
.dm-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}
.dm-name {
  font-weight: 700;
  color: #e7e9ea;
}
.dm-verified {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin: 0 2px;
  flex-shrink: 0;
  color: rgb(29, 155, 240);
}
.dm-handle, .dm-time {
  color: #71767b;
}
.dm-snippet {
  font-size: 13px;
  color: #71767b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Signals section */
.signals {
  background: var(--bg-soft);
  padding: 80px 24px;
}
.signals header {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}
.signals h2,
.install h2,
.faq h2,
.closer h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.signals header p {
  color: var(--muted);
  font-size: 17px;
  margin: 0;
}
.signals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.signal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}
.signal-card.highlight {
  background: linear-gradient(180deg, var(--highlight-grad-start) 0%, var(--highlight-grad-end) 100%);
  border-color: var(--highlight-border);
}
.signal-card.safe {
  background: linear-gradient(180deg, var(--safe-grad-start) 0%, var(--safe-grad-end) 100%);
  border-color: var(--safe-border);
}
.sig-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--x-blue);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 14px;
  margin-bottom: 14px;
}
.signal-card.safe .sig-num { background: var(--green); }
.signal-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.signal-card p {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 14.5px;
}
.signal-card code {
  display: inline-block;
  font-size: 12.5px;
  background: var(--bg-soft);
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--text);
  border: 1px solid var(--border);
}
.signal-card.highlight code { background: var(--highlight-code-bg); }
.pill {
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Install */
.install {
  padding: 80px 24px;
  max-width: 880px;
  margin: 0 auto;
}
.install header {
  text-align: center;
  margin-bottom: 40px;
}
.install header p {
  color: var(--muted);
  font-size: 17px;
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}
.install-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.install-steps li {
  display: flex;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.step-body { flex: 1; }
.step-body h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
}
.step-body p {
  margin: 0 0 12px;
  color: var(--muted);
}
.step-body p:last-child { margin-bottom: 0; }

/* FAQ */
.faq {
  background: var(--bg-soft);
  padding: 80px 24px;
}
.faq h2 {
  max-width: 720px;
  margin: 0 auto 24px;
  text-align: center;
}
.faq details {
  max-width: 720px;
  margin: 0 auto 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.faq summary {
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--muted);
  transition: transform 0.2s;
}
.faq details[open] summary::after {
  content: "−";
}
.faq details p {
  color: var(--muted);
  margin: 12px 0 0;
}

/* Closer */
.closer {
  text-align: center;
  padding: 100px 24px;
}

/* Footer */
footer {
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.foot-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.foot-fine {
  font-size: 12px;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Permissions */
.permissions {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.permissions header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}
.permissions header p {
  color: var(--muted);
  font-size: 17px;
  margin: 0;
}
.permissions h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.perm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.perm-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  color: var(--text);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 12px;
  align-self: flex-start;
  border: 1px solid var(--border);
}
.perm-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.perm-card p:last-child { margin-bottom: 0; }
.perm-card strong { color: var(--text); }
.perm-card em { font-style: normal; color: var(--text); font-weight: 600; }
.perm-bound {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--green) !important;
  font-size: 13px !important;
  font-weight: 600;
}

.perms-not {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
}
.perms-not h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
}
.perms-not h3 em { color: var(--text); font-style: normal; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.perm-not-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 24px;
}
.perm-not-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--muted);
}
.perm-not-list .x {
  color: #ef4444;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  display: grid;
  place-items: center;
}

.trust-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  background: linear-gradient(135deg, var(--trust-grad-start) 0%, var(--trust-grad-end) 100%);
  border: 1px solid var(--trust-border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.trust-bar > div { flex: 1; min-width: 240px; color: var(--muted); }
.trust-bar strong { color: var(--text); }
.trust-bar .btn-ghost { background: var(--trust-btn-bg); flex-shrink: 0; }

/* Responsive */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 56px 20px 40px;
    gap: 40px;
  }
  .topbar { padding: 12px 16px; }
  .topbar-links { gap: 14px; font-size: 13px; }
  .topbar-links a:not(.topbar-cta) { display: none; }
  .signals, .faq { padding: 60px 20px; }
  .install { padding: 60px 20px; }
  .closer { padding: 70px 20px; }
}
