/* MailAgent landing — spacing aligned with Resend marketing pages */

:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --surface: #111111;
  --surface-hover: #161616;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededed;
  --text-muted: #888888;
  --text-dim: #666666;
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.9);
  --glow: rgba(120, 200, 255, 0.12);
  --code-green: #4ade80;
  --code-blue: #60a5fa;
  --code-purple: #c084fc;
  --code-orange: #fb923c;
  --radius: 10px;
  --radius-lg: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", "SF Mono", "Fira Code", ui-monospace, monospace;
  --max: 1080px;
  --nav-h: 64px;
  /* Resend-like rhythm: 24px → 32px horizontal, 96px section vertical */
  --px: 24px;
  --section-y: 96px;
  --hero-top: 80px;
  --stack-gap: 48px;
}

@media (min-width: 768px) {
  :root {
    --px: 32px;
    --section-y: 120px;
    --hero-top: 96px;
  }
}

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

html {
  scroll-behavior: smooth;
}

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

[id] {
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

img {
  max-width: 100%;
  height: auto;
}

/* —— Nav —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #888 100%);
  display: grid;
  place-items: center;
}

.logo-mark svg {
  width: 16px;
  height: 16px;
  color: #000;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.nav-github {
  display: none;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }

  .nav-github {
    display: inline-flex;
  }
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

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

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

.btn-primary {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-soft);
}

.btn-outline {
  color: var(--text);
  background: transparent;
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--surface);
}

/* —— Hero block (hero + repo + stack) —— */
.hero-block {
  padding-bottom: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: var(--hero-top) var(--px) 0;
}

.hero-glow {
  pointer-events: none;
  position: absolute;
  inset: -40% 0 auto;
  height: 80%;
  background: radial-gradient(
    ellipse 60% 50% at 50% 0%,
    var(--glow) 0%,
    transparent 70%
  );
}

.hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--code-green);
  box-shadow: 0 0 8px var(--code-green);
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 32px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 32rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* —— Code panel —— */
.code-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 48px rgba(0, 0, 0, 0.5);
}

.code-tabs {
  display: flex;
  gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.code-tab {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.code-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.code-body {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}

.code-body pre {
  margin: 0;
}

.t-kw {
  color: var(--code-purple);
}
.t-fn {
  color: var(--code-blue);
}
.t-str {
  color: var(--code-green);
}
.t-cm {
  color: var(--text-dim);
}
.t-key {
  color: var(--code-orange);
}

/* —— Sections —— */
.page-section {
  padding: var(--section-y) var(--px);
  border-top: 1px solid var(--border);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 16px;
}

.section-title {
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-desc {
  margin: 0 0 56px;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.6;
}

.section-desc:last-child {
  margin-bottom: 0;
}

/* —— GitHub repo bar —— */
.repo-bar {
  padding: var(--stack-gap) var(--px) 0;
}

.repo-bar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.repo-bar-link:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.repo-bar-icon {
  display: flex;
  color: var(--text);
}

.repo-bar-icon svg {
  width: 28px;
  height: 28px;
}

.repo-bar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.repo-bar-text strong {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.repo-bar-meta {
  font-size: 13px;
  color: var(--text-dim);
}

.repo-bar-arrow {
  color: var(--text-dim);
  font-size: 18px;
}

/* —— Stack strip (tech chips) —— */
.stack-strip {
  padding: 32px var(--px) var(--section-y);
}

.stack-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 16px 40px rgba(0, 0, 0, 0.35);
}

@media (min-width: 768px) {
  .stack-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 28px;
  }
}

.stack-label {
  margin: 0;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  white-space: nowrap;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.stack-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.stack-chip-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  flex-shrink: 0;
}

.stack-chip-icon svg {
  width: 14px;
  height: 14px;
}

.stack-chip-tag {
  padding: 2px 6px;
  margin-left: -2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* —— Features grid —— */
.features-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  padding: 28px;
  background: var(--bg);
  transition: background 0.15s;
}

.feature-card:hover {
  background: var(--surface);
}

/* Stroke icons — Resend-style, matches logo mark */
.feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* —— MCP tools —— */
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color 0.15s, background 0.15s;
}

.tool-row:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.tool-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--code-green);
}

.tool-desc {
  flex: 1;
  min-width: 200px;
  font-size: 14px;
  color: var(--text-muted);
}

.tool-badge {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(74, 222, 128, 0.12);
  color: var(--code-green);
}

/* —— Steps —— */
.steps {
  display: grid;
  gap: 32px;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

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

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

/* —— Compare —— */
.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  background: var(--surface);
  font-weight: 500;
  color: var(--text-muted);
}

.compare-table td {
  background: var(--bg-elevated);
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-yes {
  color: var(--code-green);
}

.compare-muted {
  color: var(--text-dim);
}

.table-scroll {
  margin: 0 -4px;
  padding: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* —— CTA —— */
.cta-block {
  text-align: center;
  padding: var(--section-y) var(--px);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 50% 60% at 50% 100%,
    var(--glow) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.cta-inner {
  position: relative;
  max-width: 32rem;
  margin: 0 auto;
}

.cta-inner h2 {
  margin: 0 0 16px;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

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

/* —— Footer —— */
.footer {
  padding: 64px var(--px) 48px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 48px;
  }
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

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

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  max-width: var(--max);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

/* —— QA section —— */
.qa-section {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 55%);
}

.qa-pain-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .qa-pain-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.qa-pain-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

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

.qa-pain-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.qa-code-panel {
  margin-bottom: 20px;
}

.qa-docs-link {
  margin: 24px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.qa-docs-link a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compare-table th:nth-child(3),
.compare-table td:nth-child(3) {
  color: var(--text-muted);
}

/* —— Docs pages —— */
.doc-page .doc-main {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) var(--px) var(--section-y);
}

.doc-page h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.doc-lead {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 40px;
}

.doc-page h2 {
  margin: 40px 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
}

.doc-page p {
  color: var(--text-muted);
  margin: 0 0 16px;
}

.doc-pre {
  margin: 0 0 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.doc-pre code {
  color: var(--text);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 24px;
}

.doc-table th,
.doc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.doc-table th {
  color: var(--text-dim);
  font-weight: 500;
}

.doc-list {
  color: var(--text-muted);
  padding-left: 1.25rem;
}

.doc-list a {
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-note {
  margin-top: 48px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-dim);
}

/* —— Open source —— */
.pill-oss .pill-dot {
  background: var(--code-green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.oss-section {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.04) 0%, transparent 60%);
}

.oss-inner {
  text-align: center;
}

.oss-desc {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 40px;
}

.oss-list {
  margin: 0 auto 28px;
  padding: 0;
  list-style: none;
  max-width: 32rem;
  text-align: left;
  color: var(--text-muted);
  font-size: 15px;
}

.oss-list li {
  margin-bottom: 10px;
  padding-left: 1.25rem;
  position: relative;
}

.oss-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--code-green);
  font-weight: 600;
}

.oss-ctas {
  justify-content: center;
}
