/* ─── pap/index.html — PAP Protocol page ─────────────────────────────────── */
/*
  This page uses a slightly different palette (indigo #6366f1, violet #8b5cf6)
  and Inter as body font. Variables are overridden locally here.
*/
:root {
  --indigo:  #6366f1;
  --violet:  #8b5cf6;
  --teal:    #14b8a6;
  --green:   #22c55e;
  --amber:   #f59e0b;
  --red:     #ef4444;
  --code-bg: #0d0e16;
}
@media (prefers-color-scheme: light) { :root { --code-bg: #eceaf4; } }
[data-theme="light"] { --code-bg: #eceaf4; }
[data-theme="dark"]  { --code-bg: #0d0e16; }

body { font-family: 'Inter', -apple-system, sans-serif; }
::selection { background: rgba(99,102,241,.35); }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px;
  background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.3);
  color: var(--indigo); font-size: .75rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
}
.badge-green  { background: rgba(34,197,94,.1);   border-color: rgba(34,197,94,.25);   color: var(--green); }
.badge-amber  { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.25);  color: var(--amber); }
.badge-red    { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.25);   color: var(--red); }

/* ─── Overrides ───────────────────────────────────────────────────────────── */
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.section-sm   { padding: 64px 0; }
.section-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--indigo); margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800; line-height: 1.2; margin-bottom: 20px; letter-spacing: -.02em;
}
.section-sub { font-size: 1.1rem; color: var(--muted); line-height: 1.7; max-width: 640px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.card:hover { border-color: var(--border2); background: var(--surface2); transition: all .2s ease; }

.btn { font-family: 'Inter', sans-serif; }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: #5254d9; color: #fff; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,.35); }
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ─── Hero ────────────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow: hidden; padding-top: 64px;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-bg::before {
  content: '';
  position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(ellipse at center,
    rgba(99,102,241,.12) 0%, rgba(139,92,246,.06) 40%, transparent 70%);
  animation: pulse-slow 8s ease-in-out infinite;
}
.hero-bg::after {
  content: ''; position: absolute; bottom: -10%; left: 15%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(20,184,166,.07) 0%, transparent 65%);
  animation: pulse-slow 10s ease-in-out infinite reverse;
}
@keyframes pulse-slow {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50% { opacity: .7; transform: translateX(-50%) scale(1.05); }
}
.hero-grid {
  display: flex; flex-direction: column; gap: 48px; align-items: center;
  padding: 80px 0; max-width: 900px; margin: 0 auto; text-align: center;
}
.hero-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; justify-content: center; }
.hero-logo { margin-bottom: 32px; }
.hero-logo-mark {
  font-family: var(--font-mono);
  font-size: 3.5rem; font-weight: 700; letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 50%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 900; line-height: 1.08;
  letter-spacing: -.04em; margin-bottom: 24px;
}
.hero-subtitle {
  font-size: 1.2rem; color: var(--muted); line-height: 1.7; margin-bottom: 36px;
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; justify-content: center; }
.hero-stats {
  display: flex; gap: 32px; padding-top: 36px;
  border-top: 1px solid var(--border); justify-content: center; flex-wrap: wrap;
}
.hero-stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.hero-stat-label { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ─── Trust visual ────────────────────────────────────────────────────────── */
.trust-visual { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; position: relative; }
.trust-visual-title { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 28px; }
.trust-node { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 4px; }
.trust-node-line { display: flex; flex-direction: column; align-items: center; }
.trust-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.trust-dot-root   { background: var(--indigo); box-shadow: 0 0 12px rgba(99,102,241,.6); }
.trust-dot-orch   { background: var(--violet); box-shadow: 0 0 10px rgba(139,92,246,.5); }
.trust-dot-down   { background: var(--teal);   box-shadow: 0 0 8px rgba(20,184,166,.4); }
.trust-dot-market { background: var(--faint); }
.trust-connector { width: 1px; flex: 1; min-height: 20px; background: linear-gradient(to bottom, var(--border2), transparent); margin-left: 4px; }
.trust-label  { font-size: .85rem; font-weight: 600; color: var(--text); }
.trust-desc   { font-size: .75rem; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.trust-indent-1 { padding-left: 20px; }
.trust-indent-2 { padding-left: 40px; }
.trust-indent-3 { padding-left: 60px; }
.handshake-label { font-size: .7rem; color: var(--faint); font-family: var(--font-mono); margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); line-height: 1.8; }

/* ─── Problem ─────────────────────────────────────────────────────────────── */
.problem-intro { max-width: 680px; margin: 0 auto; text-align: center; margin-bottom: 64px; }
.problem-quote {
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(139,92,246,.05));
  border: 1px solid rgba(99,102,241,.2); border-radius: var(--radius-lg);
  padding: 36px 40px; margin-bottom: 48px; position: relative; overflow: hidden;
}
.problem-quote::before { content: '"'; position: absolute; top: -20px; left: 24px; font-size: 140px; line-height: 1; color: rgba(99,102,241,.08); font-family: Georgia, serif; pointer-events: none; }
.problem-quote p { font-size: 1.2rem; line-height: 1.8; color: var(--text); position: relative; z-index: 1; }
.problem-quote cite { display: block; margin-top: 16px; font-size: .85rem; color: var(--muted); font-style: normal; position: relative; z-index: 1; }
.protocol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.protocol-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; position: relative; overflow: hidden; }
.protocol-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--red), transparent); }
.protocol-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.protocol-tagline { font-size: .8rem; color: var(--muted); margin-bottom: 16px; }
.protocol-missing { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.protocol-missing li { font-size: .82rem; color: var(--muted); display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.protocol-missing li::before { content: '✗'; color: var(--red); flex-shrink: 0; font-size: .85rem; margin-top: 1px; }

/* ─── How It Works ────────────────────────────────────────────────────────── */
#how { background: linear-gradient(180deg, var(--bg) 0%, rgba(16,17,26,.6) 100%); }
.constraints-header { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin-bottom: 72px; }
.constraints-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.constraint-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; position: relative; overflow: hidden; transition: all .2s ease; }
.constraint-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--indigo), var(--violet)); }
.constraint-card:hover { border-color: rgba(99,102,241,.3); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.constraint-num { font-size: 2.5rem; font-weight: 900; letter-spacing: -.05em; color: rgba(99,102,241,.15); line-height: 1; margin-bottom: 12px; }
.constraint-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.constraint-body { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.constraint-card-full { grid-column: 1 / -1; }

/* ─── Protocol Stack ──────────────────────────────────────────────────────── */
.stack-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.stack-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stack-table thead th { background: var(--surface); padding: 14px 20px; text-align: left; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.stack-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s ease; }
.stack-table tbody tr:last-child { border-bottom: none; }
.stack-table tbody tr:hover { background: var(--surface); }
.stack-table tbody td { padding: 14px 20px; vertical-align: top; }
.stack-table code { font-family: var(--font-mono); font-size: .8rem; background: var(--code-bg); padding: 2px 6px; border-radius: 4px; color: var(--teal); }
.stack-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .7rem; font-weight: 600; background: rgba(99,102,241,.12); color: var(--indigo); }
.stack-tag-teal { background: rgba(20,184,166,.1); color: var(--teal); }

/* ─── SDK Grid ────────────────────────────────────────────────────────────── */
.sdk-lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.sdk-lang-card { padding: 24px 16px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color .2s; }
.sdk-lang-card:hover { border-color: var(--border2); }
.sdk-lang-icon { font-size: 1.6rem; margin-bottom: 10px; }
.sdk-lang-name { font-size: .95rem; font-weight: 600; }

/* ─── Python SDK ──────────────────────────────────────────────────────────── */
.python-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.python-features { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.python-features li { font-size: .9rem; color: var(--muted); line-height: 1.6; display: flex; align-items: flex-start; gap: 10px; }
.python-features li::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex-shrink: 0; margin-top: 8px; }
.python-install { display: flex; align-items: center; gap: 12px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 20px; font-family: var(--font-mono); font-size: .9rem; margin-top: 20px; }
.python-install .prompt { color: var(--amber); }
.python-install .cmd { color: var(--text); }

/* ─── Examples ────────────────────────────────────────────────────────────── */
.examples-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.example-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 12px; transition: all .2s ease; }
.example-card:hover { border-color: rgba(99,102,241,.35); background: var(--surface2); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.example-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.2); flex-shrink: 0; }
.example-name { font-size: .95rem; font-weight: 700; }
.example-desc { font-size: .82rem; color: var(--muted); line-height: 1.6; }
.example-features { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.example-features li { font-size: .78rem; color: var(--muted); display: flex; align-items: flex-start; gap: 6px; }
.example-features li::before { content: '→'; color: var(--indigo); flex-shrink: 0; }
.example-cmd { font-family: var(--font-mono); font-size: .75rem; color: var(--teal); background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; margin-top: auto; }

/* ─── Comparison table ────────────────────────────────────────────────────── */
.compare-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.compare-table thead tr { background: var(--surface); }
.compare-table thead th { padding: 16px 20px; text-align: center; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.compare-table thead th:first-child { text-align: left; }
.compare-table thead th.col-pap { color: var(--green); background: rgba(34,197,94,.04); border-left: 1px solid rgba(34,197,94,.15); border-right: 1px solid rgba(34,197,94,.15); }
.compare-table tbody tr { border-bottom: 1px solid var(--border); }
.compare-table tbody tr:last-child { border-bottom: none; }
.compare-table tbody tr:hover { background: rgba(255,255,255,.02); }
.compare-table tbody td { padding: 14px 20px; text-align: center; vertical-align: middle; }
.compare-table tbody td:first-child { text-align: left; font-weight: 600; color: var(--text); }
.compare-table tbody td.col-pap { background: rgba(34,197,94,.04); border-left: 1px solid rgba(34,197,94,.1); border-right: 1px solid rgba(34,197,94,.1); }
.yes { color: var(--green); font-size: 1rem; }
.no  { color: var(--faint); font-size: 1rem; }
.partial { color: var(--amber); font-size: .8rem; font-weight: 600; }

/* ─── Quick start ─────────────────────────────────────────────────────────── */
.quickstart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.code-block { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(128,128,128,.04); border-bottom: 1px solid var(--border); }
.code-dots { display: flex; gap: 6px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-dot:nth-child(1) { background: #ff5f57; }
.code-dot:nth-child(2) { background: #febc2e; }
.code-dot:nth-child(3) { background: #28c840; }
.code-title { font-size: .75rem; color: var(--faint); font-family: var(--font-mono); }
.code-copy { font-size: .7rem; color: var(--faint); cursor: pointer; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); background: none; font-family: 'Inter', sans-serif; transition: all .15s ease; }
.code-copy:hover { color: var(--text); border-color: var(--border2); }
.code-body { padding: 20px; overflow-x: auto; }
.code-body pre { font-family: var(--font-mono); font-size: .82rem; line-height: 1.8; color: var(--text); white-space: pre; }
.code-body .c  { color: var(--faint); }
.code-body .kw { color: var(--violet); }
.code-body .st { color: var(--teal); }
.code-body .fn { color: #60a5fa; }
.code-body .op { color: var(--muted); }
.cargo-cmd { color: var(--indigo); }
.qs-steps { display: flex; flex-direction: column; gap: 20px; }
.qs-step { display: flex; gap: 16px; align-items: flex-start; }
.qs-step-num { width: 32px; height: 32px; border-radius: 50%; background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.3); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; color: var(--indigo); flex-shrink: 0; }
.qs-step-title { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.qs-step-body  { font-size: .85rem; color: var(--muted); line-height: 1.6; }

/* ─── Crates ──────────────────────────────────────────────────────────────── */
.crates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.crate-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: all .2s ease; text-decoration: none; color: inherit; display: block; }
.crate-card:hover { border-color: rgba(99,102,241,.3); transform: translateY(-2px); }
.crate-name { font-family: var(--font-mono); font-size: .82rem; font-weight: 600; color: var(--indigo); margin-bottom: 8px; }
.crate-desc { font-size: .8rem; color: var(--muted); line-height: 1.5; }

/* ─── CTA Banner ──────────────────────────────────────────────────────────── */
.cta-banner { background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.08)); border: 1px solid rgba(99,102,241,.2); border-radius: var(--radius-lg); padding: 64px 48px; text-align: center; position: relative; overflow: hidden; }
.cta-banner::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 600px; height: 300px; background: radial-gradient(ellipse, rgba(99,102,241,.1), transparent 65%); pointer-events: none; }
.cta-banner h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 16px; letter-spacing: -.03em; }
.cta-banner p  { color: var(--muted); max-width: 540px; margin: 0 auto 32px; font-size: 1.05rem; line-height: 1.7; }
.cta-actions   { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Footer override ─────────────────────────────────────────────────────── */
footer { padding: 48px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-logo { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; background: linear-gradient(135deg, var(--indigo), var(--violet)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 12px; display: block; }
.footer-tagline { font-size: .88rem; color: var(--muted); line-height: 1.6; margin-bottom: 20px; max-width: 280px; }
.footer-license { font-size: .75rem; color: var(--faint); font-family: var(--font-mono); }
.footer-col-title { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: .88rem; color: var(--muted); transition: color .15s ease; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--faint); }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--faint); }
.footer-bottom-links a:hover { color: var(--muted); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .crates-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .protocol-grid   { grid-template-columns: 1fr; }
  .constraints-header { grid-template-columns: 1fr; gap: 32px; }
  .constraints-grid { grid-template-columns: 1fr; }
  .examples-grid   { grid-template-columns: 1fr; }
  .quickstart-grid { grid-template-columns: 1fr; }
  .crates-grid     { grid-template-columns: repeat(2, 1fr); }
  .footer-grid     { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom   { flex-direction: column; gap: 16px; text-align: center; }
  .hero-stats      { gap: 20px; }
  .cta-banner      { padding: 40px 24px; }
  .sdk-lang-grid   { grid-template-columns: repeat(2, 1fr); }
  .python-grid     { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .crates-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
