/* DSend — product site styles */

:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #3d3d3d;
  --ink-3: #737373;
  --line: #e6e6e6;
  --line-strong: #d0d0d0;
  --accent: #0d9488;
  --accent-ink: #0f766e;
  --accent-soft: #ecfdf8;
  --code-bg: #0b0b0d;
  --code-text: #e8e8e8;
  --code-dim: #8b8b8b;
  --code-accent: #5eead4;
  --danger: #b91c1c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 16, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 16, 16, 0.08);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

p {
  margin: 0 0 1rem;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

::selection {
  background: rgba(13, 148, 136, 0.18);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

.nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.brand .brand-accent {
  color: var(--accent-ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a:not(.btn) {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-3);
  transition: color 0.15s;
}

.nav-links a:not(.btn):hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a:not(.btn) {
    padding: 8px 4px;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: #b3b3b3;
  background: var(--bg-subtle);
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13.5px;
}

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

.hero {
  padding: 96px 0 72px;
  background:
    linear-gradient(to bottom, #ffffff 0%, #fbfbfb 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(38px, 5.2vw, 56px);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: 24px;
}

.hero h1 .h1-accent {
  color: var(--accent-ink);
}

.hero-lead {
  font-size: 18px;
  color: var(--ink-3);
  max-width: 34em;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
}

.hero-meta a {
  color: var(--accent-ink);
  font-weight: 600;
}

.hero-meta a:hover {
  text-decoration: underline;
}

/* ---------- Code blocks ---------- */

.code-block {
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #1c1c1f;
}

.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--code-dim);
  letter-spacing: 0.02em;
}

.code-copy {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--code-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.code-copy:hover {
  color: var(--code-text);
  border-color: rgba(255, 255, 255, 0.3);
}

.code-copy.copied {
  color: var(--code-accent);
  border-color: var(--code-accent);
}

.code-block pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-text);
  tab-size: 4;
}

.code-block pre code {
  display: block;
  min-width: max-content;
}

/* inline code */
.inline-code {
  font-size: 0.88em;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--ink);
}

/* terminal variant */
.code-block.terminal pre {
  padding: 16px 20px;
  font-size: 13px;
}

.prompt {
  color: var(--code-accent);
}

.comment {
  color: var(--code-dim);
}

/* token hints */
.tok-fn {
  color: #7dd3fc;
}
.tok-str {
  color: #a7f3d0;
}
.tok-kw {
  color: #fcd34d;
}

/* ---------- Section scaffolding ---------- */

.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--bg-subtle);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head .eyebrow {
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 32px;
  font-weight: 680;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--ink-3);
  font-size: 16.5px;
  margin-bottom: 0;
}

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

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--accent-ink);
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 16.5px;
  font-weight: 650;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14.5px;
  color: var(--ink-3);
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 64px 0;
  }
}

/* ---------- Architecture diagram ---------- */

.arch {
  display: grid;
  grid-template-columns: 1fr auto 1.3fr auto 1fr;
  align-items: stretch;
  gap: 0;
}

.arch-node {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 140px;
}

.arch-node h4 {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.arch-node h4 .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.arch-node p {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0;
}

.arch-node.broker h4 .dot {
  background: var(--ink);
}

.arch-node ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.arch-node li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 8px;
}

.arch-wire {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  position: relative;
}

.arch-wire::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-strong);
}

.arch-wire::after {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  right: 4px;
  border: 5px solid transparent;
  border-left: 8px solid var(--line-strong);
}

.arch-wire span {
  position: relative;
  z-index: 1;
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  padding: 0 6px;
}

.arch-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--ink-3);
}

.arch-caption code {
  font-size: 12.5px;
}

.arch-caption .arrow {
  color: var(--accent-ink);
  font-family: var(--font-mono);
}

@media (max-width: 900px) {
  .arch {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .arch-wire {
    flex-direction: row;
    justify-content: flex-start;
    padding: 6px 0;
  }
  .arch-wire::before {
    top: auto;
    left: 6px;
    right: auto;
    width: 1px;
    height: 100%;
  }
  .arch-wire::after {
    top: auto;
    bottom: 2px;
    left: 0;
    right: auto;
    border: 5px solid transparent;
    border-top: 8px solid var(--line-strong);
  }
  .arch-wire span {
    background: transparent;
    padding-left: 22px;
  }
}

/* ---------- Quickstart / split code ---------- */

.split-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
}

.step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 8px;
}

.step p {
  font-size: 14.5px;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.step .inline-code {
  font-size: 0.85em;
}

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

/* ---------- Metrics band ---------- */

.metrics-band {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 64px;
  align-items: center;
}

.metrics-list {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.metrics-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.metrics-list li:last-child {
  border-bottom: none;
}

.metrics-list dt {
  font-weight: 600;
  color: var(--ink);
  min-width: 130px;
}

.metrics-list dd {
  margin: 0;
  color: var(--ink-3);
}

@media (max-width: 900px) {
  .metrics-band {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

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

.cta {
  padding: 88px 0;
  background: var(--ink);
  color: #fff;
}

.cta .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cta h2 {
  color: #fff;
  font-size: 30px;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.cta p {
  color: #a3a3a3;
  margin: 0;
}

.cta .btn-primary {
  background: #fff;
  color: var(--ink);
  flex-shrink: 0;
}

.cta .btn-primary:hover {
  background: #f2f2f2;
  box-shadow: none;
}

@media (max-width: 720px) {
  .cta .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--line);
  padding: 48px 0;
}

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

.footer-grid p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 13.5px;
}

.footer-links a {
  color: var(--ink-3);
  font-weight: 500;
}

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

/* =========================================================
   Docs page
   ========================================================= */

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 88px;
}

.docs-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 20px 0 6px;
  padding: 0 10px;
}

.docs-sidebar nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}

.docs-sidebar nav a:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.docs-sidebar nav a.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.docs-content {
  min-width: 0;
  max-width: 760px;
}

.docs-content .doc-title {
  font-size: 38px;
  font-weight: 680;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.docs-content .doc-subtitle {
  font-size: 17px;
  color: var(--ink-3);
  margin-bottom: 40px;
}

.docs-content section {
  margin-bottom: 64px;
}

.docs-content h2 {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  padding-top: 12px;
}

.docs-content h3 {
  font-size: 17px;
  font-weight: 650;
  margin: 28px 0 10px;
}

.docs-content h2 + p,
.docs-content h3 + p {
  color: var(--ink-3);
}

.docs-content ul,
.docs-content ol {
  padding-left: 22px;
  margin: 0 0 1rem;
}

.docs-content li {
  margin-bottom: 6px;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 24px;
}

.docs-content th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-strong);
  padding: 10px 12px;
}

.docs-content td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
  color: var(--ink-2);
}

.docs-content td code,
.docs-content th code {
  font-size: 0.92em;
}

.docs-content tr:last-child td {
  border-bottom: none;
}

.callout {
  display: flex;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 14.5px;
  color: var(--ink-2);
}

.callout.warn {
  border-left-color: var(--danger);
}

.callout code {
  font-size: 0.9em;
}

.method-sig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 0 4px;
}

.method-sig .sig-name {
  color: var(--accent-ink);
  font-weight: 600;
}

@media (max-width: 960px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
  }
  .docs-sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .docs-group-label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .docs-sidebar nav {
    grid-template-columns: 1fr;
  }
}
