/* ============================================================
   AGENTPAY — Landing v6
   Layout: Polar.sh-inspired. Centered hero, white cards,
   massive whitespace, clean type scale.
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --bg:           #f8f7f4;
  --bg-card:      #ffffff;
  --border:       #e8e6e0;
  --border-soft:  #f0ede8;
  --text-primary: #111110;
  --text-secondary: #6b6b63;
  --text-muted:   #a3a39b;
  --accent:       #2d5a3d;

  /* Terminal */
  --term-bg:      #111110;
  --term-border:  #282826;
  --term-comment: #57574f;
  --term-keyword: #9fb89c;
  --term-flag:    #878780;
  --term-string:  #a8c5a3;
  --term-url:     #b4a8d0;
  --term-plain:   #656560;

  /* Type */
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --section-gap:  140px;
  --radius-card:  16px;
  --radius-sm:    10px;
  --max-w:        1100px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reveal (scroll-driven) ────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 244, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.logo svg { color: var(--accent); }

.nav-cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.16s;
}
.nav-cta:hover { color: var(--text-primary); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 128px 0 140px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

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

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: #edf4ef;
  border: 1px solid #c6ddc9;
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 32px;
  animation: heroIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Title — two-line mask reveal */
.hero-title {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: 28px;
  max-width: 760px;
}

.hero-title-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hero-title-mask span {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-title-mask:nth-child(1) span { animation-delay: 0.25s; }
.hero-title-mask:nth-child(2) span { animation-delay: 0.42s; }

.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 440px;
  margin-bottom: 40px;
  font-weight: 400;
  animation: heroIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: heroIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s,
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}

.btn-primary {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}
.btn-primary:hover {
  background: #1c1c1a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card);
  border-color: #c8c6be;
  transform: translateY(-2px);
}

/* ── Section shared ────────────────────────────────────────── */
.section {
  padding: var(--section-gap) 0;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.section-heading {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--text-primary);
  margin-bottom: 18px;
  max-width: 640px;
}

.section-body {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 64px;
}

.section-body--narrow {
  max-width: 440px;
}

/* ── Feature Cards ─────────────────────────────────────────── */
.features {
  border-bottom: 1px solid var(--border);
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 28px 36px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.card:hover {
  border-color: #d0cec7;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #edf4ef;
  border: 1px solid #c6ddc9;
  border-radius: 10px;
  color: var(--accent);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.68;
}

/* ── How It Works ──────────────────────────────────────────── */
.how {
  border-bottom: 1px solid var(--border);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 48px;
  background: var(--bg-card);
}

.step {
  padding: 32px 28px 36px;
  border-right: 1px solid var(--border);
}
.step:last-child { border-right: none; }

.step-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.step-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Code Block ────────────────────────────────────────────── */
.code-block {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--term-border);
}

.code-dots {
  display: flex;
  gap: 6px;
}
.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333330;
}
.code-dots span:nth-child(1) { background: #3d3d3a; }
.code-dots span:nth-child(2) { background: #3d3d3a; }
.code-dots span:nth-child(3) { background: #3d3d3a; }

.code-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--term-comment);
  letter-spacing: 0.05em;
  margin-left: 4px;
}

.code-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-x: auto;
}

.cl {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}
.cl-spacer { height: 10px; }
.cl-in { padding-left: 0; }

.cc { color: var(--term-comment); }
.ck { color: var(--term-keyword); }
.cf { color: var(--term-flag); }
.cu { color: var(--term-url); }
.cs { color: var(--term-string); }
.cp { color: var(--term-plain); }

/* ── Control Section ───────────────────────────────────────── */
.control {
  border-bottom: 1px solid var(--border);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px 32px 40px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.control-card:hover {
  border-color: #d0cec7;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.control-tag {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  border-radius: 100px;
  padding: 4px 13px;
  margin-bottom: 20px;
}

.control-tag--contained {
  background: #edf4ef;
  color: var(--accent);
  border: 1px solid #c6ddc9;
}

.control-tag--open {
  background: #f4f0e8;
  color: #7a6a3a;
  border: 1px solid #ddd4b8;
}

.control-card-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.control-card-body {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.68;
  margin-bottom: 28px;
}

.control-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-list li {
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c8c6be;
  flex-shrink: 0;
}

/* ── Get Started ───────────────────────────────────────────── */
.getstarted {
  padding-bottom: 160px;
}

.getstarted-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.install-row {
  margin-bottom: 28px;
}

.install-block {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 16px;
  min-width: 360px;
  max-width: 540px;
}

.install-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.install-cmd {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  user-select: all;
}

.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.copy-btn:hover {
  color: var(--text-primary);
  border-color: #c8c6be;
  background: var(--bg);
}
.copy-btn.copied {
  color: var(--accent);
  border-color: #c6ddc9;
  background: #edf4ef;
}

.getstarted-link { }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.16s;
}
.arrow-link:hover { color: var(--text-primary); }
.arrow-link svg { transition: transform 0.18s; }
.arrow-link:hover svg { transform: translateX(3px); }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.footer-logo svg { color: var(--accent); }

.footer-sub {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 1px;
}

.footer-nav {
  display: flex;
  gap: 24px;
  padding-top: 2px;
}

.footer-link {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.16s;
}
.footer-link:hover { color: var(--text-primary); }

.agent-crawl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.04em;
  padding-bottom: 4px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --section-gap: 100px; }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .steps {
    grid-template-columns: 1fr;
    border-radius: var(--radius-sm);
  }
  .step {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .step:last-child { border-bottom: none; }

  .control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root { --section-gap: 80px; }

  .container { padding: 0 20px; }

  .hero { padding: 88px 0 96px; }
  .hero-title { font-size: 40px; }
  .hero-sub { font-size: 16px; }
  .hero-ctas { flex-direction: column; align-items: center; width: 100%; }
  .btn { width: 100%; max-width: 280px; }

  .section-heading { font-size: 26px; }
  .section-body { font-size: 15px; margin-bottom: 44px; }

  .install-block { min-width: 0; width: 100%; }
  .install-cmd { font-size: 12px; }

  .code-body { padding: 18px 20px 22px; }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
  }
}

@media (max-width: 400px) {
  .hero-title { font-size: 34px; }
}
