/* ctrlPi site, bright startup design system */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2563eb;
  --emerald: #10b981;
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --rose: #ec4899;
  --ink: #0f172a;
  --slate: #475569;
  --muted: #94a3b8;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
  --shadow-lift: 0 16px 48px rgba(31, 38, 135, 0.14);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 500px at 85% -5%, rgba(6, 182, 212, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(16, 185, 129, 0.10), transparent 55%),
    radial-gradient(800px 600px at 55% 105%, rgba(139, 92, 246, 0.07), transparent 60%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: -0.02em; line-height: 1.15; }
code, pre { font-family: 'JetBrains Mono', monospace; }
a { color: var(--blue); text-decoration: none; }
img, svg { max-width: 100%; }

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

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: flex; align-items: baseline; gap: 7px; margin-right: auto; }
/* Logo, all-blue wordmark, matching the webhook-watch page */
.logo .mark {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.35rem;
  letter-spacing: -0.5px; color: var(--blue);
}
.logo .mark .pi { color: var(--blue); }
.nav a.link { font-size: 0.9rem; font-weight: 600; color: var(--slate); transition: color 0.15s; }
.nav a.link:hover { color: var(--blue); }
.nav .gh {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: #fff; font-size: 0.85rem; font-weight: 600;
  padding: 8px 16px; border-radius: 99px; transition: transform 0.12s, box-shadow 0.15s;
}
.nav .gh:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.3); }
.nav .gh svg { width: 16px; height: 16px; fill: currentColor; }
.nav .gh { padding: 9px 11px; }
.nav .gh svg { width: 18px; height: 18px; }
.nav .npmb { background: #cb3837; }
.nav .npmb:hover { box-shadow: 0 6px 18px rgba(203, 56, 55, 0.4); }
@media (max-width: 760px) { .nav a.link { display: none; } }

/* ── Hero ── */
.hero { padding: 88px 0 64px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 6px 16px; border-radius: 99px; margin-bottom: 26px;
}
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); font-weight: 800; max-width: 850px; margin: 0 auto 22px; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--blue) 10%, var(--cyan) 45%, var(--emerald) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: 1.18rem; color: var(--slate); max-width: 640px; margin: 0 auto 38px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.95rem; font-weight: 700; padding: 13px 26px; border-radius: 14px;
  transition: transform 0.12s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(100deg, var(--blue), var(--cyan)); color: #fff; box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35); }
.btn.primary:hover { box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--shadow); }

/* ── Sections ── */
section { padding: 72px 0; }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.sec-head .kicker {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 12px; display: block;
}
.sec-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 14px; }
.sec-head p { color: var(--slate); font-size: 1.05rem; }
.k-blue { color: var(--blue); } .k-green { color: #059669; } .k-cyan { color: #0891b2; }
.k-violet { color: var(--violet); } .k-amber { color: #d97706; } .k-rose { color: var(--rose); }

/* ── Cards ── */
.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.icon.i-blue { background: rgba(37, 99, 235, 0.12); }
.icon.i-green { background: rgba(16, 185, 129, 0.14); }
.icon.i-cyan { background: rgba(6, 182, 212, 0.14); }
.icon.i-violet { background: rgba(139, 92, 246, 0.13); }
.icon.i-amber { background: rgba(245, 158, 11, 0.15); }
.icon.i-rose { background: rgba(236, 72, 153, 0.12); }
.card h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.card h3 code { font-size: 0.95em; background: none; padding: 0; color: inherit; }
.card p { color: var(--slate); font-size: 0.92rem; flex: 1; }
.card .links { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.card .links a { font-size: 0.85rem; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.card .links a.more::after { content: '→'; transition: transform 0.15s; display: inline-block; }
.card .links a.more:hover::after { transform: translateX(3px); }
.card .links a.ext { color: var(--slate); }
.card .links a.ext:hover { color: var(--ink); }
.tag {
  display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 99px; margin-bottom: 14px; width: fit-content;
}
.tag.t-agent { background: rgba(16, 185, 129, 0.13); color: #047857; }
.tag.t-bridge { background: rgba(139, 92, 246, 0.13); color: #6d28d9; }
.tag.t-ai { background: rgba(236, 72, 153, 0.12); color: #be185d; }

/* ── How it works ── */
.flow {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 40px; box-shadow: var(--shadow); overflow-x: auto;
}
.flow pre {
  font-size: 0.82rem; line-height: 1.7; color: var(--ink); min-width: 620px;
}
.flow .c-blue { color: var(--blue); font-weight: 700; }
.flow .c-green { color: #059669; font-weight: 700; }
.flow .c-cyan { color: #0891b2; font-weight: 700; }
.flow .c-violet { color: #7c3aed; font-weight: 700; }
.flow .c-rose { color: #db2777; font-weight: 700; }
.flow .c-mut { color: var(--muted); }
.steps { counter-reset: step; margin-top: 40px; }
.step { display: flex; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: none; }
.step .num {
  counter-increment: step; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 10px; font-weight: 800; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, var(--blue), var(--cyan)); color: #fff;
}
.step .num::before { content: counter(step); }
.step h4 { font-size: 1rem; margin-bottom: 4px; }
.step p { color: var(--slate); font-size: 0.92rem; }

/* ── Doc pages ── */
.doc-hero { padding: 64px 0 40px; }
.crumb { font-size: 0.85rem; font-weight: 700; color: var(--slate); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 26px; }
.crumb:hover { color: var(--blue); }
.doc-hero .title-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.doc-hero .icon { width: 64px; height: 64px; border-radius: 18px; font-size: 1.9rem; display: flex; align-items: center; justify-content: center; }
.doc-hero h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 800; }
.doc-hero .tagline { color: var(--slate); font-size: 1.1rem; max-width: 720px; margin-top: 16px; }
.badges { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 20px; }
.badge {
  font-size: 0.76rem; font-weight: 700; padding: 5px 13px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); color: var(--slate);
}
.badge b { color: var(--ink); }
.doc-hero .cta-row { justify-content: flex-start; margin-top: 26px; }
.btn.sm { padding: 10px 20px; font-size: 0.88rem; border-radius: 12px; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

.doc { padding: 8px 0 72px; }
.doc h2 { font-size: 1.45rem; font-weight: 800; margin: 44px 0 16px; }
.doc h2:first-child { margin-top: 0; }
.doc p { color: var(--slate); margin-bottom: 14px; max-width: 780px; }
.doc p code, .doc li code, .doc td code {
  background: rgba(37, 99, 235, 0.08); color: #1d4ed8;
  padding: 1px 7px; border-radius: 6px; font-size: 0.86em;
}
.doc ul { color: var(--slate); margin: 0 0 14px 4px; list-style: none; }
.doc ul li { padding-left: 26px; position: relative; margin-bottom: 9px; }
.doc ul li::before { content: ''; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px; border-radius: 3px; background: linear-gradient(120deg, var(--emerald), var(--cyan)); }
.doc pre {
  background: #0b1120; color: #e2e8f0; border-radius: 16px; padding: 20px 24px;
  font-size: 0.84rem; line-height: 1.65; overflow-x: auto; margin: 0 0 20px;
  box-shadow: var(--shadow);
}
.doc pre .cm { color: #64748b; }
.doc pre .k { color: #34d399; }
.doc pre .s { color: #7dd3fc; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); margin: 0 0 20px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.doc th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.doc td { padding: 11px 18px; border-bottom: 1px solid var(--line); color: var(--slate); vertical-align: top; }
.doc tr:last-child td { border-bottom: none; }
.doc td:first-child { white-space: nowrap; font-weight: 600; color: var(--ink); }
.callout {
  display: flex; gap: 14px; background: rgba(6, 182, 212, 0.07);
  border: 1px solid rgba(6, 182, 212, 0.22); border-radius: 16px;
  padding: 16px 20px; margin: 0 0 20px; font-size: 0.92rem; color: var(--slate);
}
.callout .ico { font-size: 1.2rem; flex-shrink: 0; }
.callout b { color: var(--ink); }

/* ── Framed pages (pinouts, live watch), site nav + full-height embed ── */
.framepage { overflow: hidden; }
.framewrap { height: calc(100vh - 64px); }
.framewrap iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ── Motion & modern touches ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.fade-1, .fade-2, .fade-3, .fade-4 { animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.fade-2 { animation-delay: 0.12s; }
.fade-3 { animation-delay: 0.24s; }
.fade-4 { animation-delay: 0.36s; }
@media (prefers-reduced-motion: reduce) {
  .fade-1, .fade-2, .fade-3, .fade-4 { animation: none; }
}
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald); animation: pulse 1.8s ease-in-out infinite; flex-shrink: 0;
}

/* Glow blobs behind the hero */
.hero { position: relative; }
.hero .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); z-index: -1; pointer-events: none;
}
.hero .blob.b1 { width: 380px; height: 380px; top: -60px; left: -120px; background: rgba(6, 182, 212, 0.18); }
.hero .blob.b2 { width: 320px; height: 320px; top: 40px; right: -100px; background: rgba(139, 92, 246, 0.14); }
.hero .blob.b3 { width: 260px; height: 260px; bottom: -120px; left: 38%; background: rgba(16, 185, 129, 0.16); }

/* Hero terminal mock */
.term {
  max-width: 720px; margin: 52px auto 0; text-align: left;
  background: #0b1120; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.term .bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.term .bar i { width: 11px; height: 11px; border-radius: 50%; }
.term .bar i:nth-child(1) { background: #f87171; }
.term .bar i:nth-child(2) { background: #fbbf24; }
.term .bar i:nth-child(3) { background: #34d399; }
.term .bar span { margin-left: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: #64748b; }
.term pre {
  padding: 18px 22px; font-size: 0.8rem; line-height: 1.75; color: #e2e8f0;
  overflow-x: auto; font-family: 'JetBrains Mono', monospace;
}
.term .p { color: #34d399; }
.term .c { color: #7dd3fc; }
.term .d { color: #64748b; }

/* Card accent bar on hover */
.card { position: relative; overflow: hidden; }
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--emerald));
  opacity: 0; transition: opacity 0.2s;
}
.card:hover::before { opacity: 1; }

/* ── Footer ── */
footer { border-top: 1px solid var(--line); padding: 44px 0 52px; margin-top: 40px; }
.foot { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot .logo { margin-right: auto; }
.foot a { font-size: 0.88rem; font-weight: 600; color: var(--slate); }
.foot a:hover { color: var(--blue); }
.foot .copy { width: 100%; font-size: 0.8rem; color: var(--muted); margin-top: 16px; }
