/*
 * Dark-only design tokens, carried over verbatim from the Descry app
 * (app/src/styles.css) so the marketing site matches the product exactly.
 */
:root {
  --color-bg: #0b0d10;
  --color-sidebar: #212124;
  --color-surface: #16191d;
  --color-input: #1f1f21;
  --color-active-tint: #1f262e;
  --color-border: #262b31;

  --color-accent: #4cc2ff;
  --color-accent-fg: #0b0d10;

  --color-text: #f4f5f6;
  --color-text-muted: #9aa3ad;
  --color-text-dim: #9aa3ad;

  --color-success: #59bf73;
  --color-danger: #e5484d;

  --color-diff-add: #2ea043;
  --color-diff-add-bg: rgb(46 160 67 / 0.15);
  --color-diff-del: #f85149;
  --color-diff-del-bg: rgb(248 81 73 / 0.15);

  --radius: 0.5rem;
  --font-sans:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}

header.site .bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
}

header.site .bar > div {
  justify-self: end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

nav.primary {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav.primary a {
  color: var(--color-text-muted);
  font-size: 13.5px;
  font-weight: 500;
}

nav.primary a:hover,
nav.primary a.active {
  color: var(--color-text);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-accent-fg);
  border-color: var(--color-accent);
}

.btn-accent:hover {
  opacity: 0.9;
}

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

.btn-ghost:hover {
  background: var(--color-active-tint);
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-active-tint);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  font-weight: 650;
}

.hero p.lead {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero .cta-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero .cta-row .btn {
  padding: 11px 22px;
  font-size: 14.5px;
}

/* ---------- Mockup / screenshot frame ---------- */

.mockup {
  margin: 56px auto 0;
  max-width: 960px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6);
}

.mockup .titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

.mockup .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}

.mockup .dot.red {
  background: #ff5f57;
}
.mockup .dot.yellow {
  background: #febc2e;
}
.mockup .dot.green {
  background: #28c840;
}

.mockup .titlebar .appname {
  margin-left: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.mockup .body {
  padding: 24px;
}

.mockup .body.flush {
  padding: 0;
}

/* ---------- App UI replica pieces (crumb bar, tabs, diff, threads) ---------- */

.crumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}

.crumb-bar .crumbs {
  color: var(--color-text-dim);
}

.crumb-bar .crumbs b {
  color: var(--color-accent);
  font-weight: 600;
}

.crumb-bar .reindex {
  color: var(--color-text-dim);
}

.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12.5px;
}

.tab-bar .tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-bar .tab {
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--color-text-dim);
}

.tab-bar .tab.active {
  background: var(--color-active-tint);
  color: var(--color-text);
  font-weight: 600;
}

.tab-bar .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-dim);
}

.tab-bar .sha {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: var(--color-input);
  padding: 3px 8px;
  border-radius: 5px;
}

.tab-bar .badge {
  position: relative;
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: 11px;
}

.tab-bar .badge .count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #d29922;
  color: #0b0d10;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

.step-head {
  padding: 18px 20px 14px;
}

.step-head .title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.step-head h4 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
}

.step-head p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13.5px;
  max-width: 560px;
}

.step-head .actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
}

.pill-btn.muted {
  color: var(--color-text-dim);
  font-weight: 500;
}

.called-by {
  padding: 6px 20px;
  font-size: 12px;
  color: var(--color-text-dim);
  border-bottom: 1px solid var(--color-border);
}

.called-by b {
  color: var(--color-accent);
  font-weight: 500;
  font-family: ui-monospace, monospace;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  font-size: 12.5px;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
}

.file-row .hunks {
  color: var(--color-text-dim);
  font-weight: 400;
}

.hunk-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-active-tint) 45%, transparent);
}

.hunk-row .left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hunk-row .sparkle {
  color: #b794f6;
  flex-shrink: 0;
  margin-top: 1px;
}

.hunk-row .symbol {
  font-weight: 650;
  color: var(--color-text);
}

.hunk-row .desc {
  color: var(--color-text-muted);
}

.hunk-row .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
}

.hunk-row .comment-count {
  color: var(--color-accent);
}

.hunk-row .stat-add {
  color: var(--color-diff-add);
}

.hunk-row .stat-del {
  color: var(--color-diff-del);
}

.expand-row {
  padding: 6px 20px;
  font-size: 11.5px;
  color: var(--color-text-dim);
  border-bottom: 1px solid var(--color-border);
}

.diffcode {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}

.diffline {
  display: flex;
  padding: 0 20px;
}

.diffline .gut {
  width: 30px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 10px;
  color: var(--color-text-dim);
  user-select: none;
}

.diffline .mark {
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  user-select: none;
}

.diffline .code {
  white-space: pre;
  color: var(--color-text-muted);
}

.diffline.add {
  background: var(--color-diff-add-bg);
}
.diffline.add .gut,
.diffline.add .mark {
  color: var(--color-diff-add);
}
.diffline.add .code {
  color: var(--color-text);
}

.diffline.del {
  background: var(--color-diff-del-bg);
}
.diffline.del .gut,
.diffline.del .mark {
  color: var(--color-diff-del);
}
.diffline.del .code {
  color: var(--color-text-muted);
}

.diffline.anchor {
  border-left: 2px solid #d29922;
}

/* ---------- Syntax highlighting (Prism tokens), TS/JS diff code ---------- */

.token.keyword {
  color: #569cd6;
}
.token.operator {
  color: var(--color-text-muted);
}
.token.string {
  color: #ce9178;
}
.token.function {
  color: #dcdcaa;
}
.token.class-name,
.token.builtin,
.token.maybe-class-name {
  color: #4ec9b0;
}
.token.number,
.token.boolean {
  color: #b5cea8;
}
.token.punctuation {
  color: inherit;
}
.token.comment {
  color: var(--color-text-dim);
  font-style: italic;
}

/* ---------- Floating Ask / Comment toolbar ---------- */

.select-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #0f1216;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px -8px rgb(0 0 0 / 0.6);
  font-size: 12px;
  margin: 10px 20px;
}

.select-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--color-text);
  padding: 6px 10px;
  border-radius: 5px;
  font: inherit;
  font-weight: 600;
}

.select-toolbar .divider {
  width: 1px;
  height: 16px;
  background: var(--color-border);
}

.select-toolbar .close {
  color: var(--color-text-dim);
  padding: 6px 8px;
  font-weight: 400;
}

/* ---------- Inline thread / draft-comment panels ---------- */

.thread-box {
  margin: 0 20px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface);
}

.thread-box .thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--color-text-dim);
  border-bottom: 1px solid var(--color-border);
}

.thread-box .thread-head .loc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, monospace;
}

.thread-box .thread-body {
  padding: 14px;
}

.draft-comment {
  margin: 0 20px 0;
  border: 1px solid var(--color-border);
  border-top: 2px solid #d29922;
  border-radius: 0 0 8px 8px;
  background: var(--color-surface);
  padding: 10px 14px;
}

.draft-comment .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.draft-comment .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d29922;
}

.draft-comment .icons {
  display: flex;
  gap: 10px;
  color: var(--color-text-dim);
}

.draft-comment p {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.reply-row {
  margin: 0 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--color-text-dim);
}

/* ---------- Chain diagram modal ---------- */

.chain-modal-wrap {
  padding: 24px 20px;
}

.chain-modal-wrap .dimmed {
  opacity: 0.35;
  filter: blur(0.5px);
}

.chain-modal {
  margin: 0 auto;
  max-width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 30px 60px -16px rgb(0 0 0 / 0.7);
  padding: 16px 18px;
}

.chain-modal .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.chain-modal h5 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: ui-monospace, monospace;
}

.chain-modal p {
  margin: 0;
  font-size: 11.5px;
  color: var(--color-text-dim);
}

.chain-modal .close {
  color: var(--color-text-dim);
}

.chain-diagram-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chain-diagram-row.vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.chain-node {
  position: relative;
  display: inline-block;
  border: 1px solid var(--color-border);
  background: var(--color-active-tint);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--color-accent);
}

.chain-node::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f4f5f6;
}

.chain-arrow {
  color: var(--color-text-dim);
}

.chain-diagram-row.vertical .chain-arrow {
  padding-left: 22px;
  font-size: 13px;
}

/* ---------- Sidebar replicas (flow list / node tree) ---------- */

.side-panel {
  border-right: 1px solid var(--color-border);
  padding: 14px 0;
}

.side-panel .side-label {
  padding: 0 16px 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.flow-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
}

.flow-item.active {
  background: var(--color-active-tint);
}

.flow-item b {
  display: block;
  font-size: 12.5px;
  color: var(--color-text);
  margin-bottom: 4px;
}

.flow-item.active b {
  color: var(--color-accent);
}

.flow-item .flow-desc {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.flow-item .flow-meta {
  font-size: 10.5px;
  color: var(--color-text-dim);
}

.node-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  font-size: 12.5px;
}

.node-item.active {
  background: var(--color-active-tint);
  color: var(--color-accent);
  font-weight: 600;
}

.node-item.indent {
  padding-left: 32px;
}

.node-item.ref {
  padding-left: 32px;
  color: var(--color-text-dim);
  font-style: italic;
  font-size: 11.5px;
}

.node-item .badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-active-tint);
  color: var(--color-text-dim);
  font-size: 9.5px;
}

/* ---------- Sections ---------- */

section {
  padding: 72px 0;
  border-top: 1px solid var(--color-border);
}

section.no-border {
  border-top: none;
}

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

.section-head .kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: 30px;
  margin: 0 0 12px;
  font-weight: 650;
}

.section-head p {
  color: var(--color-text-muted);
  font-size: 15.5px;
}

/* ---------- Feature grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
}

.card .icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--color-active-tint);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 16px;
}

.card h3 {
  font-size: 15.5px;
  margin: 0 0 8px;
  font-weight: 600;
}

.card p {
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- Feature rows (features page) ---------- */

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--color-border);
}

.feature-row:first-of-type {
  border-top: none;
}

.feature-row.reverse .feature-copy {
  order: 2;
}

.feature-copy .tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.feature-copy h3 {
  font-size: 24px;
  margin: 0 0 12px;
  font-weight: 650;
}

.feature-copy p {
  color: var(--color-text-muted);
  font-size: 15px;
  margin: 0 0 12px;
}

.feature-copy ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.feature-copy li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
}

.feature-copy li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

/* ---------- Chat bubble mock, reused from the app's own styling ---------- */

.chat-mock {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 12.5px;
}

.chat-mock .turn-user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.chat-mock .turn-user span {
  background: var(--color-active-tint);
  color: var(--color-text);
  border-radius: 10px;
  padding: 7px 11px;
  max-width: 80%;
}

.chat-mock .turn-assistant .who {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 6px;
}

.chat-mock .turn-assistant p {
  color: var(--color-text-muted);
  margin: 0 0 8px;
}

.pill {
  display: inline-block;
  background: var(--color-active-tint);
  color: var(--color-accent);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
  font-size: 0.95em;
}

/* ---------- Steps (getting started) ---------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
}

.step:first-child {
  border-top: none;
}

.step .num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-active-tint);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 14px;
}

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

.step p {
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 14.5px;
}

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--color-input);
  border-radius: 5px;
}

code {
  padding: 2px 6px;
  font-size: 0.92em;
  color: var(--color-text);
}

pre {
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  font-size: 13px;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
}

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 56px 32px;
}

.cta-band h2 {
  font-size: 26px;
  margin: 0 0 12px;
  font-weight: 650;
}

.cta-band p {
  color: var(--color-text-muted);
  margin: 0 0 28px;
}

/* ---------- Footer ---------- */

footer.site {
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
}

footer.site .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

footer.site .links {
  display: flex;
  gap: 20px;
}

footer.site a {
  color: var(--color-text-dim);
  font-size: 13px;
}

footer.site small {
  color: var(--color-text-dim);
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .feature-row,
  .feature-row.reverse .feature-copy {
    grid-template-columns: 1fr;
    order: initial;
  }
  .feature-row {
    gap: 24px;
  }
  nav.primary {
    display: none;
  }
  .side-panel {
    display: none;
  }
  .hero h1 {
    font-size: 34px;
  }
}
