/* ── Design tokens (matches static/www palette) ──────────────────── */
:root {
    --bg:       #171717;   /* kadamu-darker */
    --surface:  #1f1f1f;   /* kadamu-dark   */
    --border:   #3c4043;   /* kadamu-border */
    --hover:    #28292b;   /* kadamu-hover  */
    --text:     #ffffff;
    --muted:    #9ca3af;   /* gray-400 */
    --faint:    #6b7280;   /* gray-500 */
    --blue:     #2563eb;
    --blue-h:   #1d4ed8;
    --eyebrow:  #60a5fa;
    --green:    #10b981;
    --purple:   #8b5cf6;
    --orange:   #f97316;
    --yellow:   #f59e0b;
    --red:      #ef4444;
}

/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ── Layout helpers ──────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 56px 0; }
.center     { text-align: center; }
.flex       { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* ── Typography ──────────────────────────────────────────────────── */
.eyebrow {
    font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--eyebrow);
    margin-bottom: 12px;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; line-height: 1.2; }
h3 { font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
.lead {
    font-size: 1.0625rem; color: var(--muted); max-width: 580px;
    margin: 16px auto 0;
}
.text-muted { color: var(--muted); }
.text-faint { color: var(--faint); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-h); }
.btn-outline {
    background: transparent; color: var(--muted);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--hover); color: var(--text); }

/* ── Header ──────────────────────────────────────────────────────── */
header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(23,23,23,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 32px;
    height: 56px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.1rem; font-weight: 500;
    flex-shrink: 0;
}
.nav-links {
    display: flex; align-items: center; gap: 24px;
    flex: 1;
    font-size: 0.875rem; color: var(--muted);
}
.nav-cta { margin-left: auto; }
.nav-links a:hover { color: var(--text); }
.nav-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    color: var(--text); padding: 4px; line-height: 0;
}
@media (max-width: 680px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 0 20px; gap: 0; }
    .logo { height: 56px; }
    .nav-toggle { display: flex; align-items: center; height: 56px; margin-left: auto; }
    .nav-links {
        display: none; flex-direction: column; align-items: stretch;
        width: 100%; gap: 0; flex: 1 0 100%;
        border-top: 1px solid var(--border);
        padding: 6px 0 14px;
    }
    .nav-links.open { display: flex; }
    .nav-links a:not(.btn) { padding: 11px 0; }
    .nav-links a.btn { margin-top: 12px; text-align: center; }
    .nav-cta { margin-left: 0; }
}

/* ── Mega menu ───────────────────────────────────────────────────── */
.nav-item--mega {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-trigger {
    background: none; border: 0; padding: 0;
    color: var(--muted); cursor: pointer;
    font: inherit; font-size: 0.875rem;
    display: inline-flex; align-items: center; gap: 4px;
    transition: color 0.15s;
}
.nav-trigger:hover,
.nav-item--mega:hover .nav-trigger,
.nav-item--mega:focus-within .nav-trigger,
.nav-item--mega.open .nav-trigger { color: var(--text); }
.nav-caret {
    width: 12px; height: 12px;
    transition: transform 0.15s;
}
.nav-item--mega:hover .nav-caret,
.nav-item--mega:focus-within .nav-caret,
.nav-item--mega.open .nav-caret {
    transform: rotate(180deg);
}

.nav-panel {
    position: absolute;
    top: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    min-width: 640px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
    pointer-events: none;
    z-index: 200;
}
.nav-panel--align-left   { left: -16px; }
.nav-panel--align-center { left: 50%; margin-left: -320px; }
.nav-panel--align-right  { right: -16px; }
.nav-panel--narrow       { min-width: 460px; }
.nav-panel--narrow.nav-panel--align-center { margin-left: -230px; }
/* hover bridge */
.nav-panel::before {
    content: '';
    position: absolute;
    top: -12px; left: 0; right: 0; height: 14px;
}
.nav-item--mega:hover .nav-panel,
.nav-item--mega:focus-within .nav-panel,
.nav-item--mega.open .nav-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(8px);
}

.nav-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 4px 12px;
}
.nav-panel-grid--2 { grid-template-columns: repeat(2, minmax(180px, 1fr)); }

.nav-panel-heading {
    font-size: 0.6875rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--faint);
    margin: 4px 0 6px;
    padding: 0 10px;
}
.nav-panel-link {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px;
    border-radius: 10px;
    color: var(--muted);
    transition: background 0.12s, color 0.12s;
}
.nav-panel-link:hover {
    background: var(--hover);
    color: var(--text);
}
.nav-panel-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.nav-panel-text {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
}
.nav-panel-title {
    font-size: 0.875rem; font-weight: 500; color: var(--text);
    line-height: 1.3;
}
.nav-panel-desc {
    font-size: 0.75rem; color: var(--faint);
    line-height: 1.4;
}
.nav-panel-link.nav-panel-link--plain {
    padding: 7px 10px;
}
.nav-panel-link--plain .nav-panel-title { font-size: 0.875rem; }

.nav-flat {
    color: var(--muted);
    font-size: 0.875rem;
    transition: color 0.15s;
}
.nav-flat:hover { color: var(--text); }

@media (max-width: 980px) {
    .nav-panel--align-left   { left: auto; right: 0; }
    .nav-panel--align-center { left: auto; right: 0; margin-left: 0; }
}
@media (max-width: 680px) {
    .nav-item--mega { display: block; width: 100%; }
    .nav-trigger {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; padding: 11px 0;
    }
    .nav-panel {
        position: static;
        opacity: 1; visibility: visible; pointer-events: auto;
        transform: none;
        min-width: 0; margin-left: 0;
        padding: 0 0 10px;
        border: 0; background: transparent; box-shadow: none;
        display: none;
    }
    .nav-item--mega.open .nav-panel { display: block; }
    .nav-panel-grid, .nav-panel-grid--2 { grid-template-columns: 1fr; gap: 2px; }
    .nav-panel-heading { padding: 0 10px; margin: 14px 0 4px; }
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero { padding: 96px 0 72px; text-align: center; }
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Trust bar ───────────────────────────────────────────────────── */
.trust-bar {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.trust-bar-inner {
    display: flex; align-items: center; justify-content: center;
    gap: 32px; flex-wrap: wrap;
    font-size: 0.8125rem; color: var(--faint);
}
.trust-item { display: flex; align-items: center; gap: 6px; }
.trust-item svg { width: 14px; height: 14px; color: var(--faint); }

/* ── Feature grid ────────────────────────────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.feature-group-label {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px;
    font-size: 0.6875rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--faint);
}
.feature-group-label:first-child { margin-top: 0; }
.feature-group-label::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    transition: border-color 0.15s;
}
.feature-card:hover { border-color: #5a5f63; }
.feature-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px; flex-shrink: 0;
}
.feature-usecase {
    font-size: 0.75rem; color: var(--faint);
    font-style: italic; margin-top: 2px; margin-bottom: 6px;
}
.feature-card p {
    font-size: 0.875rem; color: var(--muted); margin-top: 4px; line-height: 1.5;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
    font-size: 0.6875rem; padding: 2px 8px; border-radius: 999px;
    background: rgba(255,255,255,0.06); color: var(--faint);
}

/* ── Protocol section ────────────────────────────────────────────── */
.protocol-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.protocol-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}
.protocol-card h3 { font-size: 1.0625rem; margin-bottom: 8px; }
.protocol-card p  { font-size: 0.875rem; color: var(--muted); margin-bottom: 16px; }
.code-block {
    background: #0d0d0d; border: 1px solid #2a2a2a;
    border-radius: 8px; padding: 12px 14px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem; color: #a3e635;
    overflow-x: auto; white-space: pre;
}

/* ── Security section ────────────────────────────────────────────── */
.security-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.auth-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.auth-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.8125rem; color: var(--muted);
    background: var(--surface);
}

/* ── AI section ──────────────────────────────────────────────────── */
.ai-section {
    background: linear-gradient(135deg, #0f172a 0%, #1a0a2e 50%, #0f1a2e 100%);
    border-top: 1px solid #1e2a4a;
    border-bottom: 1px solid #1e2a4a;
}
.ai-glow {
    position: relative;
    display: inline-block;
}
.ai-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    opacity: 0.25;
    filter: blur(12px);
    z-index: -1;
}
.ai-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8125rem; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: #a78bfa; margin-bottom: 16px;
}
.ai-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 12px; padding: 20px;
}
.ai-card h3 { color: #e9d5ff; }
.ai-card p  { font-size: 0.875rem; color: #9ca3af; margin-top: 4px; line-height: 1.5; }
.ai-card .tag { background: rgba(139,92,246,0.12); color: #a78bfa; }
.soon-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 10px; border-radius: 999px;
    font-size: 0.6875rem; font-weight: 500;
    background: rgba(245,158,11,0.12); color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.3);
    margin-bottom: 12px;
}
.ai-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 32px;
}

/* ── CTA banner ──────────────────────────────────────────────────── */
.cta-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    margin: 0 0 80px;
}
.cta-banner h2 { margin-bottom: 12px; }
.cta-banner p  { color: var(--muted); font-size: 0.9375rem; margin-bottom: 28px; }

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--faint);
}
footer a:hover { color: var(--text); }

/* ── Section divider label ───────────────────────────────────────── */
.section-label {
    display: flex; align-items: center; gap: 16px; margin-bottom: 40px;
}
.section-label.center { justify-content: center; flex-direction: column; }
.section-label h2 { margin-bottom: 8px; }

/* ── Check item ──────────────────────────────────────────────────── */
.check-item {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.875rem; color: var(--muted); margin-bottom: 10px;
}
.check-item svg { flex-shrink: 0; margin-top: 2px; color: var(--green); }

@media (max-width: 700px) {
    .protocol-grid { grid-template-columns: 1fr; }
    .security-grid { grid-template-columns: 1fr; }
    .feature-grid  { grid-template-columns: 1fr; }
}

/* ── Pricing ─────────────────────────────────────────────────────── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}
@media (max-width: 780px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.plan-card.featured { border-color: var(--blue); border-width: 2px; }
.popular-badge {
    position: absolute;
    top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--blue); color: #fff;
    font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 14px; border-radius: 999px;
    white-space: nowrap;
}
.plan-name { font-size: 1.0625rem; font-weight: 500; }
.plan-desc { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
.plan-price { margin: 24px 0; display: flex; align-items: baseline; gap: 4px; }
.price-amount { font-size: 2.5rem; font-weight: 500; line-height: 1; }
.price-unit { color: var(--muted); font-size: 0.875rem; }
.plan-features {
    list-style: none;
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 28px; flex: 1;
}
.plan-features li {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.875rem; color: var(--muted);
}
.plan-features li svg { flex-shrink: 0; margin-top: 2px; color: var(--green); }
.plan-features li strong { color: var(--text); }
.btn-lg { padding: 12px 28px; font-size: 0.9375rem; width: 100%; justify-content: center; }
.compliance-strip {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 12px 28px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 28px;
    font-size: 0.8125rem; font-weight: 500; color: var(--faint);
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}
@media (max-width: 640px) { .faq-grid { grid-template-columns: 1fr; } }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 22px;
}
.faq-item h3 { font-size: 0.9375rem; margin-bottom: 8px; }
.faq-item p { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

/* ── Prose (for blog posts, legal pages, etc.) ───────────────────── */
.prose {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.75;
}
.prose h1 { margin: 0 0 24px; }
.prose h2 { margin: 40px 0 16px; }
.prose h3 { margin: 28px 0 10px; font-size: 1.125rem; }
.prose p  { margin: 0 0 16px; color: var(--muted); }
.prose ul, .prose ol { margin: 0 0 16px 24px; color: var(--muted); }
.prose li { margin-bottom: 8px; }
.prose a  { color: var(--eyebrow); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--text); }
.prose code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: rgba(255,255,255,0.06);
    padding: 1px 6px; border-radius: 4px;
    font-size: 0.875em; color: #a3e635;
}
.prose pre {
    background: #0d0d0d; border: 1px solid #2a2a2a;
    border-radius: 8px; padding: 14px 16px;
    overflow-x: auto; margin: 0 0 16px;
}
.prose pre code { background: none; padding: 0; color: #a3e635; }
.prose blockquote {
    border-left: 3px solid var(--border);
    padding: 4px 0 4px 16px;
    color: var(--muted);
    margin: 0 0 16px;
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── Page header (for non-home pages) ────────────────────────────── */
.page-header { padding: 72px 0 40px; text-align: center; }
.page-header h1 { margin-bottom: 12px; }
.page-header .lead { margin: 0 auto; }

/* ── Post list (legacy compact form, kept for non-blog list pages) ─ */
.post-list { display: flex; flex-direction: column; gap: 8px; max-width: 720px; margin: 0 auto; }
.post-list-item {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    transition: border-color 0.15s;
}
.post-list-item:hover { border-color: #5a5f63; }
.post-list-item h3 { font-size: 1rem; margin-bottom: 4px; color: var(--text); }
.post-list-item .post-meta { font-size: 0.75rem; color: var(--faint); margin-bottom: 6px; }
.post-list-item p { font-size: 0.875rem; color: var(--muted); margin: 0; }

/* ── Blog gallery + filter bar ───────────────────────────────────── */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 0 0 32px;
    justify-content: center;
}
.filter-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.8125rem; font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-pill:hover {
    background: var(--hover);
    color: var(--text);
    border-color: #5a5f63;
}
.filter-pill.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.filter-count {
    font-size: 0.6875rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: inherit;
    font-weight: 500;
}
.filter-pill.active .filter-count { background: rgba(255,255,255,0.22); }

.post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    transition: border-color 0.15s, transform 0.15s;
    display: flex; flex-direction: column;
    min-height: 220px;
    color: var(--text);
}
.post-card:hover { border-color: #5a5f63; }
.post-card.is-hidden { display: none; }
.post-card-badges {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 14px;
}
.post-badge {
    font-size: 0.6875rem; font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--faint);
    letter-spacing: 0.02em;
}
/* Per-category accents (palette: blue / green / purple / orange / red / cyan) */
.post-badge--c0 { background: rgba(37,99,235,0.15);  color: #60a5fa; }
.post-badge--c1 { background: rgba(16,185,129,0.15); color: #34d399; }
.post-badge--c2 { background: rgba(139,92,246,0.15); color: #a78bfa; }
.post-badge--c3 { background: rgba(245,158,11,0.15); color: #fbbf24; }
.post-badge--c4 { background: rgba(239,68,68,0.15);  color: #f87171; }
.post-badge--c5 { background: rgba(6,182,212,0.15);  color: #22d3ee; }

.post-card h3 {
    font-size: 1.0625rem;
    margin-bottom: 8px;
    line-height: 1.3;
    color: var(--text);
}
.post-card-meta { font-size: 0.75rem; color: var(--faint); margin-bottom: 10px; }
.post-card-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.55; flex: 1; }
.post-card-arrow {
    margin-top: 14px;
    font-size: 0.8125rem; font-weight: 500;
    color: var(--eyebrow);
    display: inline-flex; align-items: center; gap: 4px;
}

.gallery-empty {
    text-align: center; color: var(--muted);
    padding: 48px 0;
    font-size: 0.9375rem;
    display: none;
}
.gallery-empty.is-visible { display: block; }

@media (max-width: 700px) {
    .post-gallery { grid-template-columns: 1fr; }
    .filter-bar { justify-content: flex-start; }
}
