
/* =========================================================
   LUMEN HELP — RESPONSIVE DOCUMENTATION
   ========================================================= */

.help-page {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;

    background: var(--bg);
    color: var(--ink);

    font-family: var(--font-body);

    overflow-x: hidden;
    box-sizing: border-box;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.help-page *,
.help-page *::before,
.help-page *::after {
    box-sizing: border-box;
}


/* =========================================================
   TOP BAR
   ========================================================= */

.help-topbar {
    position: sticky;
    top: 0;
    z-index: 100;

    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
    padding: 12px 24px;

    background: rgba(255, 255, 255, 0.92);

    border-bottom: 1px solid var(--line);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    box-shadow:
        0 4px 18px rgba(27, 33, 29, 0.035);
}

.help-brand-logo {
    display: block;

    width: auto;
    height: 28px;

    flex-shrink: 0;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.help-brand-logo:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.exploring-label {
    flex: 1;
    min-width: 0;

    text-align: center;

    color: var(--ink-soft);

    font-size: 0.84rem;
    line-height: 1.3;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exploring-label strong {
    color: var(--accent-deep);
    font-weight: 600;
}

.help-topbar-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.tour-btn,
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 9px 16px;

    border: 1px solid var(--ink);
    border-radius: 999px;

    background: var(--ink);
    color: var(--bg);

    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;

    line-height: 1;
    text-decoration: none;

    cursor: pointer;

    box-shadow:
        0 3px 10px rgba(27, 33, 29, 0.07);

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.tour-btn:hover,
.primary-btn:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);

    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(27, 33, 29, 0.10);
}

.tour-btn:active,
.primary-btn:active {
    transform: translateY(0);

    box-shadow:
        0 2px 7px rgba(27, 33, 29, 0.07);
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 9px 16px;

    border: 1px solid var(--line);
    border-radius: 999px;

    background: var(--surface);
    color: var(--ink);

    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;

    line-height: 1;

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}

.secondary-btn:hover {
    border-color: var(--accent-deep);
    color: var(--accent-deep);
    background: var(--surface-tint);

    transform: translateY(-1px);
}

.secondary-btn:active {
    transform: translateY(0);
}

.home-link {
    color: var(--accent-deep);

    font-size: 0.82rem;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 0.15s ease,
        opacity 0.15s ease;
}

.home-link:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* =========================================================
   MAIN PAGE SHELL
   ========================================================= */

.help-shell {
    width: 100%;
    max-width: 1500px;

    margin: 0 auto;

    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);

    min-height: calc(100vh - 53px);
}


/* =========================================================
   DOCUMENTATION NAVIGATION
   ========================================================= */

.help-nav {
    position: sticky;
    top: 53px;

    height: calc(100vh - 53px);

    overflow-y: auto;

    padding: 24px 14px 40px;

    background: var(--surface);

    border-right: 1px solid var(--line);

    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 16px;
    padding: 0 6px;
}

.nav-title {
    margin: 0;

    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 600;

    letter-spacing: -0.015em;
}

.search-trigger {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: var(--surface-tint);
    color: var(--ink-soft);

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.search-trigger:hover {
    border-color: var(--accent-deep);
    background: var(--accent-soft);
    color: var(--accent-deep);

    transform: translateY(-1px);
}

.nav-list {
    list-style: none;

    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;

    margin-bottom: 3px;
    padding: 9px 11px;

    border-radius: 10px;

    color: var(--ink-soft);

    font-size: 0.86rem;
    font-weight: 500;

    line-height: 1.35;
    text-decoration: none;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.nav-link:hover {
    background: var(--surface-tint);
    color: var(--ink);

    transform: translateX(2px);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-deep);

    font-weight: 600;

    box-shadow:
        inset 3px 0 0 var(--accent-deep);
}


/* =========================================================
   MAIN DOCUMENTATION AREA
   ========================================================= */

.help-main {
    width: 100%;
    min-width: 0;

    padding:
        32px
        clamp(20px, 4vw, 60px)
        90px;
}


/* =========================================================
   DOCUMENTATION STACK
   ========================================================= */

.docs-stack {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto;

    display: flex;
    flex-direction: column;

    gap: 20px;
}


/* =========================================================
   DOCUMENTATION SECTIONS
   ========================================================= */

.doc-section {
    position: relative;

    width: 100%;

    padding: clamp(26px, 3vw, 40px);

    background: var(--surface);

    border: 1px solid var(--line);
    border-radius: 20px;

    box-shadow:
        0 5px 20px rgba(27, 33, 29, 0.025);

    /* Prevent sticky header from covering anchor targets */
    scroll-margin-top: 76px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.doc-section:hover {
    border-color: var(--line-strong, #c7cad6);

    box-shadow:
        0 9px 28px rgba(27, 33, 29, 0.045);
}

.doc-section.active-section {
    border-color: var(--accent-deep);

    box-shadow:
        0 0 0 2px rgba(98, 100, 179, 0.14),
        0 10px 28px rgba(27, 33, 29, 0.05);
}

.section-marker {
    position: absolute;

    left: 0;
    top: 24px;
    bottom: 24px;

    width: 4px;

    border-radius: 0 5px 5px 0;

    background: transparent;

    transition:
        background 0.2s ease;
}

.doc-section.active-section .section-marker {
    background: var(--accent-deep);
}


/* =========================================================
   DOCUMENTATION TYPOGRAPHY
   ========================================================= */

.doc-section h1,
.doc-section h2 {
    margin: 0 0 14px;

    font-family: var(--font-display);
    font-weight: 600;

    color: var(--ink);

    letter-spacing: -0.02em;
}

.doc-section h1 {
    font-size: clamp(1.55rem, 2.5vw, 2.05rem);
    line-height: 1.12;
}

.doc-section h2 {
    font-size: clamp(1.22rem, 2vw, 1.5rem);
    line-height: 1.18;
}

.doc-section h3 {
    margin: 22px 0 8px;

    color: var(--ink);

    font-size: 1rem;
    font-weight: 600;

    line-height: 1.35;
}

.doc-section p {
    max-width: 900px;

    margin: 0 0 13px;

    color: var(--ink-soft);

    font-size: 0.96rem;
    line-height: 1.72;
}

.doc-section p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   LISTS
   ========================================================= */

.feature-list {
    margin: 0 0 18px;
    padding-left: 22px;

    color: var(--ink-soft);

    font-size: 0.96rem;
    line-height: 1.72;
}

.feature-list li {
    padding-left: 3px;
    margin-bottom: 5px;
}

.feature-list li:last-child {
    margin-bottom: 0;
}

.feature-list strong {
    color: var(--ink);
    font-weight: 600;
}


/* =========================================================
   FLOW DIAGRAMS
   ========================================================= */

.flow-diagram {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 9px;

    margin: 20px 0;
    padding: 20px;

    background:
        linear-gradient(
            135deg,
            var(--surface-tint),
            rgba(242, 244, 255, 0.72)
        );

    border: 1px solid rgba(216, 218, 226, 0.8);
    border-radius: 16px;
}

.flow-step {
    padding: 9px 15px;

    background: var(--surface);

    border: 1px solid var(--line);
    border-radius: 11px;

    color: var(--ink);

    font-size: 0.84rem;
    font-weight: 600;

    line-height: 1.3;
    text-align: center;

    box-shadow:
        0 2px 7px rgba(27, 33, 29, 0.035);
}

.flow-step.accent {
    background: var(--accent);

    border-color: var(--accent);

    box-shadow:
        0 4px 12px rgba(98, 100, 179, 0.10);
}

.flow-arrow {
    color: var(--ink-faint);

    font-size: 0.85rem;
    font-weight: 600;
}


/* =========================================================
   HINTS
   ========================================================= */

.hint-text {
    font-size: 0.84rem !important;
    line-height: 1.55 !important;

    color: var(--ink-faint) !important;

    font-style: italic;
}


/* =========================================================
   GESTURE ACTIONS
   ========================================================= */

.gesture-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin: 18px 0;
}

.gesture-actions .communication-button {
    flex: 1 1 180px;
    min-width: 0;
}


/* =========================================================
   TROUBLESHOOTING
   ========================================================= */

.trouble-item {
    margin-bottom: 20px;
    padding-bottom: 18px;

    border-bottom: 1px solid var(--line);
}

.trouble-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;

    border-bottom: none;
}


/* =========================================================
   INSTALLATION
   ========================================================= */

.install-steps {
    margin: 0 0 22px;
    padding-left: 24px;

    color: var(--ink-soft);

    line-height: 1.8;
}

.install-steps li {
    padding-left: 3px;
    margin-bottom: 4px;
}

.launch-btn {
    text-align: center;
}


/* =========================================================
   FINAL SECTION
   ========================================================= */

.final-section {
    padding: 44px clamp(20px, 4vw, 50px) !important;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            var(--surface),
            var(--surface-tint)
        );
}

.final-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 20px;
}


/* =========================================================
   SEARCH OVERLAY
   ========================================================= */

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    padding: 12vh 20px 20px;

    background: rgba(27, 33, 29, 0.38);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.search-overlay[hidden] {
    display: none;
}

.search-panel {
    width: min(620px, 94vw);

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--line);
    border-radius: 20px;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.18);
}

.search-header {
    display: flex;
    align-items: center;

    gap: 8px;

    padding: 12px 14px;

    border-bottom: 1px solid var(--line);

    background: rgba(255, 255, 255, 0.96);
}

#help-search {
    flex: 1;
    min-width: 0;

    height: 40px;

    padding: 0 4px;

    border: none;
    outline: none;

    background: transparent;

    color: var(--ink);

    font-family: var(--font-body);
    font-size: 0.96rem;
}

#help-search::placeholder {
    color: var(--ink-faint);
}

.search-close {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 9px;

    background: transparent;
    color: var(--ink-soft);

    font-size: 1rem;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.search-close:hover {
    background: var(--surface-tint);
    color: var(--ink);
}

.search-results {
    list-style: none;

    max-height: 360px;

    margin: 0;
    padding: 8px;

    overflow-y: auto;
}

.search-results button {
    width: 100%;

    padding: 12px 14px;

    border: none;
    border-radius: 10px;

    background: transparent;
    color: var(--ink);

    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;

    line-height: 1.4;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.search-results button:hover {
    background: var(--surface-tint);
    color: var(--accent-deep);
}

.search-results .result-section {
    margin-top: 2px;

    color: var(--ink-faint);

    font-size: 0.72rem;
}

.search-empty {
    padding: 24px 20px;

    color: var(--ink-soft);

    font-size: 0.88rem;

    text-align: center;
}


/* =========================================================
   TOUR
   ========================================================= */

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(27, 33, 29, 0.43);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.tour-overlay[hidden] {
    display: none;
}

.tour-card {
    width: min(500px, 94vw);

    padding: 28px;

    background: var(--surface);

    border: 1px solid var(--line);
    border-radius: 20px;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.20);
}

.tour-progress {
    margin-bottom: 18px;
}

#tour-step-label {
    color: var(--ink-faint);

    font-size: 0.72rem;
    font-weight: 600;

    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tour-progress-track {
    height: 5px;

    margin-top: 8px;

    overflow: hidden;

    background: var(--line);

    border-radius: 999px;
}

.tour-progress-fill {
    width: 14%;
    height: 100%;

    background: var(--accent-deep);

    border-radius: inherit;

    transition:
        width 0.25s ease;
}

.tour-card h3 {
    margin: 0 0 8px;

    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;

    letter-spacing: -0.015em;
}

.tour-card p {
    margin: 0 0 20px;

    color: var(--ink-soft);

    font-size: 0.92rem;
    line-height: 1.65;
}

.tour-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 8px;
}


/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

.mobile-nav-toggle {
    display: none;

    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 150;

    width: 52px;
    height: 52px;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 5px;

    border: none;
    border-radius: 50%;

    background: var(--ink);
    color: var(--bg);

    cursor: pointer;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.18);

    transition:
        transform 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.mobile-nav-toggle:hover {
    background: var(--accent-deep);

    transform: translateY(-2px);

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.20);
}

.mobile-nav-toggle:active {
    transform: translateY(0);
}

.mobile-nav-toggle span {
    display: block;

    width: 18px;
    height: 2px;

    background: currentColor;

    border-radius: 999px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {
    .help-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .help-main {
        padding-left: 24px;
        padding-right: 24px;
    }

    .docs-stack {
        max-width: 100%;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 720px) {

    /* Top bar */

    .help-topbar {
        padding: 10px 14px;

        gap: 10px;
    }

    .help-brand-logo {
        height: 25px;
    }

    .help-topbar-actions {
        gap: 6px;
    }

    .help-topbar-actions .tour-btn,
    .help-topbar-actions .primary-btn {
        min-height: 34px;

        padding: 7px 11px;

        font-size: 0.76rem;
    }

    .home-link,
    .exploring-label {
        display: none;
    }


    /* Page shell */

    .help-shell {
        display: block;

        width: 100%;
        max-width: 100%;
    }


    /* Slide-out navigation */

    .help-nav {
        position: fixed;

        top: 49px;
        bottom: 0;
        left: 0;

        width: min(290px, 82vw);

        z-index: 140;

        padding: 22px 14px 90px;

        transform: translateX(-100%);

        box-shadow:
            8px 0 30px rgba(0, 0, 0, 0.13);

        transition:
            transform 0.25s ease;
    }

    .help-nav.open {
        transform: translateX(0);
    }


    /* Main content */

    .help-main {
        width: 100%;

        padding:
            18px
            12px
            90px;
    }


    /* Documentation stack */

    .docs-stack {
        width: 100%;

        gap: 14px;
    }


    /* Documentation sections */

    .doc-section {
        width: 100%;

        padding:
            24px
            18px;

        border-radius: 16px;

        scroll-margin-top: 64px;
    }

    .doc-section:hover {
        transform: none;
    }

    .section-marker {
        top: 18px;
        bottom: 18px;
    }


    /* Typography */

    .doc-section h1 {
        font-size: 1.48rem;
    }

    .doc-section h2 {
        font-size: 1.2rem;
    }

    .doc-section p,
    .feature-list {
        font-size: 0.91rem;
        line-height: 1.66;
    }


    /* Flow diagrams */

    .flow-diagram {
        padding: 14px;

        gap: 7px;
    }

    .flow-arrow {
        display: none;
    }

    .flow-step {
        flex: 1 1 120px;

        padding: 8px 11px;

        font-size: 0.78rem;
    }


    /* Gesture buttons */

    .gesture-actions {
        flex-direction: column;
    }

    .gesture-actions .communication-button {
        width: 100%;

        flex: none;
    }


    /* Mobile menu */

    .mobile-nav-toggle {
        display: flex;
    }


    /* Search */

    .search-overlay {
        padding:
            7vh
            10px
            20px;
    }

    .search-panel {
        width: 100%;

        border-radius: 17px;
    }


    /* Tour */

    .tour-overlay {
        padding: 14px;
    }

    .tour-card {
        width: 100%;

        padding: 23px;

        border-radius: 17px;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 420px) {

    .help-topbar {
        padding: 9px 10px;
    }

    .help-main {
        padding-left: 8px;
        padding-right: 8px;
    }

    .doc-section {
        padding: 21px 15px;
    }

    .final-section {
        padding:
            30px
            15px !important;
    }

    .tour-card {
        padding: 19px;
    }

    .tour-actions {
        justify-content: stretch;
    }

    .tour-actions > * {
        flex: 1 1 auto;
    }

    .mobile-nav-toggle {
        right: 14px;
        bottom: 14px;

        width: 49px;
        height: 49px;
    }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.nav-link:focus-visible,
.tour-btn:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.reset-demo-btn:focus-visible,
.search-trigger:focus-visible,
.search-close:focus-visible,
.mobile-nav-toggle:focus-visible,
.search-results button:focus-visible,
.home-link:focus-visible {
    outline: 2px solid var(--accent-deep);
    outline-offset: 3px;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .doc-section,
    .tour-progress-fill,
    .help-nav,
    .tour-btn,
    .primary-btn,
    .secondary-btn,
    .nav-link,
    .search-trigger,
    .search-close,
    .mobile-nav-toggle,
    .help-brand-logo {
        transition: none !important;
    }

    .nav-link:hover,
    .mobile-nav-toggle:hover,
    .help-brand-logo:hover {
        transform: none;
    }
}

