/* ── Inscriti Help Center shared styles ── */
@font-face { font-family: 'Satoshi'; src: url('../uploads/Satoshi-Regular.otf') format('opentype'); font-weight: 400; }
@font-face { font-family: 'Satoshi'; src: url('../uploads/Satoshi-Medium.otf') format('opentype'); font-weight: 500; }
@font-face { font-family: 'Satoshi'; src: url('../uploads/Satoshi-Bold.otf') format('opentype'); font-weight: 700; }
@font-face { font-family: 'Satoshi'; src: url('../uploads/Satoshi-Black.otf') format('opentype'); font-weight: 900; }

:root {
    --purple: #7C5CFF;
    --purple-deep: #6B4DE6;
    --purple-soft: #F3EFFF;
    --cyan: #00D4FF;
    --dark: #0F0B1F;
    --text: #1A1A1A;
    --text-soft: #555;
    --text-mute: #888;
    --border: #ebebeb;
    --bg: #fff;
    --bg-soft: #faf9fc;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { -webkit-tap-highlight-color: transparent; }
button { -webkit-tap-highlight-color: transparent; font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
    html { scroll-behavior: auto; }
}

/* ── Nav ── */
.help-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top);
}
.help-nav-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 14px 32px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.help-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.help-brand img { height: 28px; display: block; }
.help-brand-tag {
    font-size: 13px; font-weight: 700; color: var(--purple);
    background: var(--purple-soft);
    padding: 4px 10px; border-radius: 6px;
    letter-spacing: 0.02em;
}
.help-nav-links { display: flex; gap: 24px; align-items: center; }
.help-nav-links a {
    color: var(--text-soft); text-decoration: none;
    font-weight: 500; font-size: 14px;
    transition: color 0.2s;
}
.help-nav-links a:hover { color: var(--purple); }
.help-nav-cta {
    background: var(--purple); color: white !important;
    padding: 9px 18px; border-radius: 9px;
    font-weight: 600 !important; font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.help-nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,92,255,0.3); }

.menu-btn {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: 8px; flex-direction: column; gap: 4px;
    min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}
.menu-btn span {
    width: 22px; height: 2px; background: var(--text);
    border-radius: 2px; transition: 0.3s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Hero (help home) ── */
.help-hero {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
    color: white;
    padding: 80px 32px 100px;
    text-align: center;
    position: relative; overflow: hidden;
}
.help-hero::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.07) 1px, transparent 0);
    background-size: 36px 36px;
    pointer-events: none;
}
.help-hero-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.help-hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 900; line-height: 1.1;
    margin-bottom: 16px;
    text-wrap: balance;
}
.help-hero p {
    font-size: clamp(16px, 2vw, 19px);
    color: rgba(255,255,255,0.88);
    margin-bottom: 36px;
}
.help-search {
    background: white;
    border-radius: 14px;
    padding: 6px 6px 6px 20px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    max-width: 560px; margin: 0 auto;
}
.help-search svg { flex-shrink: 0; color: var(--text-mute); }
.help-search input {
    flex: 1; border: none; outline: none;
    padding: 14px 0; font-size: 16px;
    font-family: inherit; background: transparent;
    color: var(--text);
}
.help-search input::placeholder { color: var(--text-mute); }
.help-search-clear {
    background: var(--purple); color: white;
    border: none; border-radius: 10px;
    padding: 11px 18px; font-weight: 600; font-size: 14px;
    cursor: pointer; font-family: inherit;
    transition: background 0.2s;
}
.help-search-clear:hover { background: var(--purple-deep); }

/* ── Section ── */
.help-section { padding: 72px 32px; }
.help-section-inner { max-width: 1200px; margin: 0 auto; }
.help-section-head { text-align: center; margin-bottom: 48px; }
.help-section-label {
    display: inline-block;
    font-size: 12px; font-weight: 700;
    color: var(--purple); text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 12px;
}
.help-section-head h2 {
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 900; color: var(--text);
    margin-bottom: 12px;
}
.help-section-head p {
    font-size: 17px; color: var(--text-soft);
    max-width: 600px; margin: 0 auto;
}

/* ── Category cards ── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.cat-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
    display: block;
}
.cat-card:hover {
    border-color: var(--purple);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(124,92,255,0.12);
}
.cat-card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--purple-soft);
    color: var(--purple);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}
.cat-card h3 {
    font-size: 18px; font-weight: 700;
    color: var(--text); margin-bottom: 6px;
}
.cat-card p {
    font-size: 14px; color: var(--text-soft);
    line-height: 1.55;
}
.cat-card-count {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px; color: var(--purple);
    font-weight: 600;
}

/* ── Doc article layout ── */
.doc-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px;
    display: grid;
    grid-template-columns: 260px 1fr 220px;
    gap: 48px;
}
.doc-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 8px;
}
.doc-sidebar-title {
    font-size: 12px; font-weight: 700;
    color: var(--text-mute); text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}
.doc-sidebar a {
    display: block;
    padding: 9px 12px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.doc-sidebar a:hover { background: var(--bg-soft); color: var(--text); }
.doc-sidebar a.active {
    background: var(--purple-soft);
    color: var(--purple);
    font-weight: 600;
}

.doc-main { min-width: 0; }
.doc-crumbs {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-mute);
    margin-bottom: 16px;
}
.doc-crumbs a { color: var(--text-mute); text-decoration: none; }
.doc-crumbs a:hover { color: var(--purple); }
.doc-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: start; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
}
.doc-header-text { flex: 1; min-width: 0; }
.doc-header h1 {
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 10px;
    text-wrap: balance;
}
.doc-header-sub {
    font-size: 16px; color: var(--text-soft);
}
.doc-print-btn {
    background: var(--purple);
    color: white;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 600; font-size: 14px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: inherit;
    transition: background 0.2s, transform 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.doc-print-btn:hover { background: var(--purple-deep); transform: translateY(-1px); }

.doc-content { font-size: 16px; line-height: 1.7; color: var(--text); }
.doc-content h2 {
    font-size: 24px; font-weight: 800;
    margin-top: 44px; margin-bottom: 16px;
    color: var(--text);
    padding-top: 8px;
    scroll-margin-top: 80px;
}
.doc-content h2:first-child { margin-top: 0; }
.doc-content h3 {
    font-size: 18px; font-weight: 700;
    margin-top: 28px; margin-bottom: 10px;
    color: var(--text);
    scroll-margin-top: 80px;
}
.doc-content p { margin-bottom: 16px; color: var(--text-soft); }
.doc-content strong { color: var(--text); font-weight: 700; }
.doc-content ul, .doc-content ol { margin: 0 0 16px 24px; color: var(--text-soft); }
.doc-content ul li, .doc-content ol li { margin-bottom: 8px; }
.doc-content code {
    background: var(--purple-soft);
    color: var(--purple);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
    font-family: ui-monospace, monospace;
}
.doc-content blockquote {
    border-left: 3px solid var(--purple);
    padding: 4px 20px;
    margin: 20px 0;
    color: var(--text-soft);
    background: var(--purple-soft);
    border-radius: 0 8px 8px 0;
}
.doc-content blockquote p:last-child { margin-bottom: 0; }
.doc-content hr {
    border: none; border-top: 1px solid var(--border);
    margin: 36px 0;
}

.doc-content .callout {
    background: var(--purple-soft);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    display: flex; gap: 12px; align-items: start;
}
.doc-content .callout-icon { color: var(--purple); flex-shrink: 0; margin-top: 2px; }
.doc-content .callout p { margin: 0; color: var(--text); }

.doc-content .step-list {
    counter-reset: step;
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}
.doc-content .step-list > li {
    counter-increment: step;
    position: relative;
    padding-left: 40px;
    margin-bottom: 14px;
}
.doc-content .step-list > li::before {
    content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--purple);
    color: white; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}

/* On-this-page nav */
.doc-toc {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.doc-toc-title {
    font-size: 12px; font-weight: 700;
    color: var(--text-mute); text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}
.doc-toc a {
    display: block;
    padding: 6px 0 6px 12px;
    color: var(--text-mute);
    text-decoration: none;
    font-size: 13px;
    border-left: 2px solid var(--border);
    transition: color 0.15s, border-color 0.15s;
}
.doc-toc a:hover, .doc-toc a.active {
    color: var(--purple);
    border-left-color: var(--purple);
}

/* Doc footer prev/next */
.doc-foot {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.doc-foot-link {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}
.doc-foot-link:hover { border-color: var(--purple); transform: translateY(-2px); }
.doc-foot-link.next { text-align: right; }
.doc-foot-link .small {
    display: block;
    font-size: 12px; color: var(--text-mute);
    margin-bottom: 4px;
}
.doc-foot-link .big {
    display: block;
    font-size: 15px; font-weight: 600; color: var(--text);
}
.doc-foot-link.disabled {
    opacity: 0.4; pointer-events: none;
}

/* ── Help footer ── */
.help-footer {
    background: var(--dark); color: white;
    padding: 48px 32px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    margin-top: 80px;
}
.help-footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
}
.help-footer-col h4 {
    font-size: 14px; font-weight: 700; margin-bottom: 14px;
}
.help-footer-col a, .help-footer-col p {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    line-height: 2;
    transition: color 0.2s;
}
.help-footer-col a:hover { color: white; }
.help-footer-logo { height: 24px; margin-bottom: 12px; display: block; }
.help-footer-bottom {
    max-width: 1200px;
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
}
.help-footer-bottom p {
    font-size: 12px; color: rgba(255,255,255,0.45);
}
.help-footer-jfeld { display: flex; align-items: center; gap: 8px; }
.help-footer-jfeld span { font-size: 12px; color: rgba(255,255,255,0.45); }
.help-footer-jfeld img { height: 16px; }

/* No-results helper */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-mute);
    font-size: 16px;
    display: none;
}
.no-results.show { display: block; }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .doc-layout { grid-template-columns: 240px 1fr; gap: 32px; }
    .doc-toc { display: none; }
}
@media (max-width: 800px) {
    .help-nav-links { display: none; }
    .menu-btn { display: flex; }
    .help-nav-inner { padding: 12px 20px; }
    .help-nav-links.mobile-open {
        display: flex; flex-direction: column;
        position: absolute; top: 100%; left: 0; right: 0;
        background: white;
        padding: 16px 24px 24px;
        border-bottom: 1px solid var(--border);
        gap: 6px; align-items: stretch;
        animation: slideDownNav 0.2s ease;
        box-shadow: 0 12px 24px rgba(0,0,0,0.06);
    }
    .help-nav-links.mobile-open a {
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
        font-size: 16px;
    }
    .help-nav-links.mobile-open a:last-child {
        border-bottom: none;
        text-align: center;
        padding: 14px;
        margin-top: 8px;
    }
    @keyframes slideDownNav { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
    .doc-layout { grid-template-columns: 1fr; padding: 24px; }
    .doc-sidebar {
        position: static; max-height: none;
        background: var(--bg-soft);
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 24px;
    }
    .help-footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
    .help-section { padding: 56px 24px; }
    .help-hero { padding: 60px 24px 80px; }
    .doc-foot { grid-template-columns: 1fr; }
    .doc-foot-link.next { text-align: left; }
    .doc-content h2 { font-size: 22px; margin-top: 36px; }
    .doc-content h3 { font-size: 17px; }
}
@media (max-width: 500px) {
    .help-footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .help-footer-bottom { flex-direction: column; align-items: flex-start; }
    .doc-header { flex-direction: column; }
    .doc-print-btn { width: 100%; justify-content: center; }
    .help-brand-tag { display: none; }
    .help-brand img { height: 26px; }
    .help-section-head h2 { font-size: 26px; }
    .help-section-head p { font-size: 16px; }
    .cat-grid { gap: 14px; }
    .cat-card { padding: 22px; }
    .help-search { padding: 4px 4px 4px 16px; }
    .help-search input { padding: 12px 0; font-size: 15px; }
    .help-hero { padding: 48px 20px 64px; }
    .help-section { padding: 48px 20px; }
    .doc-layout { padding: 20px; }
    .doc-content { font-size: 15px; }
}

/* ── Print styles ── */
@media print {
    .help-nav, .help-footer, .doc-sidebar, .doc-toc, .doc-print-btn, .doc-crumbs, .doc-foot, .menu-btn { display: none !important; }
    body { background: white; }
    .doc-layout { display: block; padding: 0; max-width: none; }
    .doc-main { padding: 0; }
    .doc-header { border-bottom: 2px solid var(--purple); padding-bottom: 16px; margin-bottom: 24px; }
    .doc-header h1 { color: var(--purple); font-size: 28px; }
    .doc-content { font-size: 12pt; line-height: 1.55; }
    .doc-content h2 { font-size: 18pt; margin-top: 24px; page-break-after: avoid; }
    .doc-content h3 { font-size: 13pt; page-break-after: avoid; }
    .doc-content p, .doc-content li { color: black; }
    .doc-content .step-list > li::before { background: var(--purple); }
    /* Print branded header & footer using @page */
    @page {
        margin: 0.6in 0.5in 0.7in 0.5in;
    }
    .print-header, .print-footer { display: block !important; }
}

/* Print-only elements (hidden on screen) */
.print-header, .print-footer { display: none; }
@media print {
    .print-header {
        text-align: center;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 1px solid #ccc;
    }
    .print-header img { height: 32px; }
    .print-footer {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        text-align: center;
        font-size: 9pt;
        color: #888;
        padding: 8px 0;
        border-top: 1px solid #ddd;
    }
}

/* ──────────────────────────────────────────────
   Polish pass — refined motion & entrance animations
   (CSS-only; no per-page JS required)
   ────────────────────────────────────────────── */

/* Smoother, springier hover timing to match the marketing site */
.cat-card { transition: border-color 0.3s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.cat-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(86,56,201,0.14); }
.cat-card-icon { transition: transform 0.4s var(--ease); }
.cat-card:hover .cat-card-icon { transform: scale(1.08) rotate(-4deg); }
.doc-foot-link { transition: border-color 0.3s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.doc-foot-link:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(86,56,201,0.12); }
.help-nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124,92,255,0.34); }
.doc-print-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124,92,255,0.3); }
.doc-sidebar a, .doc-toc a { transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), padding-left 0.2s var(--ease); }
.doc-sidebar a:hover { padding-left: 16px; }

/* Subtle grain to match the landing page */
body::after {
    content: ''; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
    opacity: 0.03; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Entrance animations on page load */
@keyframes helpRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.help-hero-inner > * { opacity: 0; animation: helpRise 0.7s var(--ease) forwards; }
.help-hero-inner > *:nth-child(1) { animation-delay: 0.05s; }
.help-hero-inner > *:nth-child(2) { animation-delay: 0.14s; }
.help-hero-inner > *:nth-child(3) { animation-delay: 0.22s; }

.cat-grid .cat-card { opacity: 0; animation: helpRise 0.6s var(--ease) forwards; }
.cat-grid .cat-card:nth-child(1) { animation-delay: 0.04s; }
.cat-grid .cat-card:nth-child(2) { animation-delay: 0.10s; }
.cat-grid .cat-card:nth-child(3) { animation-delay: 0.16s; }
.cat-grid .cat-card:nth-child(4) { animation-delay: 0.22s; }
.cat-grid .cat-card:nth-child(5) { animation-delay: 0.28s; }
.cat-grid .cat-card:nth-child(6) { animation-delay: 0.34s; }
.cat-grid .cat-card:nth-child(n+7) { animation-delay: 0.40s; }

.doc-header, .doc-content > * { opacity: 0; animation: helpRise 0.6s var(--ease) forwards; }
.doc-header { animation-delay: 0.05s; }
.doc-content > *:nth-child(1) { animation-delay: 0.12s; }
.doc-content > *:nth-child(2) { animation-delay: 0.16s; }
.doc-content > *:nth-child(3) { animation-delay: 0.20s; }

/* Respect reduced-motion and never hide content for it */
@media (prefers-reduced-motion: reduce) {
    .help-hero-inner > *, .cat-grid .cat-card, .doc-header, .doc-content > * {
        opacity: 1 !important; animation: none !important;
    }
    body::after { display: none; }
}

/* Never apply load-in animations / grain in print */
@media print {
    .help-hero-inner > *, .cat-grid .cat-card, .doc-header, .doc-content > * {
        opacity: 1 !important; animation: none !important;
    }
    body::after { display: none !important; }
}
