/* ============================================================================
   tutorial.css — layout for the public getting-started / help page.
   Layers on top of arndly-tokens.css + console.css (brand primitives reused:
   .panel, .note, .chip, .btn-arndly, .wizard-rail idiom). Tutorial-only.
   ============================================================================ */

.tutorial-body {
    background: var(--bg);
    color: var(--fg1);
    font-family: var(--font-body);
    margin: 0;
    min-height: 100vh;
}

/* Anchor jumps clear the sticky top bar */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

/* ---------- Slim brand top bar (NOT the console nav) ---------- */
.tut-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 60px;
    padding: 0 28px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.tut-brand { display: inline-flex; align-items: center; text-decoration: none; }
.tut-brand img { height: 30px; width: auto; display: block; }
.tut-topbar-right { display: flex; align-items: center; }

/* ---------- Page shell: sticky TOC + content ---------- */
.tut-main { max-width: 1160px; margin: 0 auto; padding: 28px 28px 96px; }

.tut-shell {
    display: grid;
    grid-template-columns: 232px 1fr;
    gap: 34px;
    align-items: start;
}

/* ---------- Sticky table of contents ---------- */
.tut-toc {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.tut-toc .toc-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg3);
    padding: 4px 12px 8px;
}

.tut-toc a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg2);
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.tut-toc a i { width: 16px; height: 16px; flex: none; color: var(--fg3); }
.tut-toc a:hover { background: var(--neutral-100); color: var(--fg1); }
.tut-toc a.active {
    background: var(--green-50);
    border-left-color: var(--orange-500);
    color: var(--fg1);
}
.tut-toc a.active i { color: var(--orange-600); }

/* ---------- Content column ---------- */
.tut-content { min-width: 0; }

/* ---------- Hero ---------- */
.tut-hero {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 88% -10%, var(--orange-100), transparent 46%),
        radial-gradient(circle at 0% 120%, var(--green-100), transparent 42%),
        var(--bg-elev);
    box-shadow: var(--shadow-sm);
    padding: 34px 34px 30px;
    margin-bottom: 28px;
}

.tut-hero .overline {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--orange-700);
    margin-bottom: 10px;
}

.tut-hero h1 {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 12px;
    color: var(--fg1);
}

.tut-hero .lead {
    font-size: 17px;
    line-height: 1.6;
    color: var(--fg2);
    max-width: 66ch;
    margin: 0;
}

/* Concept flow (Avatar -> Knowledge -> Live -> Sessions) */
.tut-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    margin-top: 22px;
}

.tut-flow .flow-step {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elev);
}

.tut-flow .flow-step i { width: 20px; height: 20px; color: var(--green-600); }
.tut-flow .flow-step .fs-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--fg1); }
.tut-flow .flow-step .fs-sub { font-size: 12.5px; color: var(--fg2); line-height: 1.4; }
.tut-flow .flow-arrow { display: flex; align-items: center; color: var(--fg3); }
.tut-flow .flow-arrow i { width: 18px; height: 18px; }

/* ---------- Sections ---------- */
.tut-section { margin-bottom: 24px; scroll-margin-top: 84px; }
.tut-section .panel-body > *:first-child { margin-top: 0; }
.tut-section .panel-body > *:last-child { margin-bottom: 0; }

.tut-section .panel-title { display: inline-flex; align-items: center; gap: 9px; }
.tut-section .panel-title i { width: 18px; height: 18px; color: var(--green-600); }

/* Prose */
.tut-prose { font-size: 14.5px; line-height: 1.65; color: var(--fg1); }
.tut-prose h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--fg1);
    margin: 20px 0 8px;
}
.tut-prose p { margin: 0 0 12px; }
.tut-prose ul, .tut-prose ol { margin: 0 0 12px; padding-left: 22px; }
.tut-prose li { margin-bottom: 6px; }
.tut-prose strong { font-weight: 700; }
.tut-prose code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--neutral-100);
    padding: 1px 5px;
    border-radius: 5px;
}
.tut-prose a { color: var(--green-700); text-decoration: underline; }
.tut-prose .note { margin: 14px 0; }

/* Step list (numbered walkthrough) */
.tut-steps { list-style: none; counter-reset: tut; padding: 0; margin: 4px 0 14px; }
.tut-steps > li {
    position: relative;
    counter-increment: tut;
    padding: 2px 0 2px 40px;
    margin-bottom: 12px;
    min-height: 28px;
}
.tut-steps > li::before {
    content: counter(tut);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--green-600);
    color: #f4faf6;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Figure / screenshot placeholder ---------- */
.tut-figure {
    margin: 16px 0 6px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background:
        repeating-linear-gradient(45deg, var(--neutral-50), var(--neutral-50) 12px, var(--neutral-100) 12px, var(--neutral-100) 24px);
    overflow: hidden;
    /* reserved height for screenshots not captured yet */
    min-height: 220px;
}

.tut-figure img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    background: var(--bg-elev);
}

.tut-figure figcaption {
    font-size: 12.5px;
    color: var(--fg2);
    padding: 8px 14px;
    border-top: 1px dashed var(--border);
    background: var(--bg-elev);
    display: flex;
    align-items: center;
    gap: 7px;
}
.tut-figure figcaption i { width: 14px; height: 14px; color: var(--fg3); flex: none; }

/* Back-to-top link at the end of each section */
.tut-top-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg3);
    text-decoration: none;
    margin-top: 4px;
}
.tut-top-link:hover { color: var(--green-700); }
.tut-top-link i { width: 14px; height: 14px; }

/* ---------- Responsive: collapse TOC ---------- */
@media (max-width: 860px) {
    .tut-shell { grid-template-columns: 1fr; gap: 18px; }
    .tut-toc {
        position: static;
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--bg-elev);
    }
    .tut-toc .toc-title { width: 100%; padding: 0 4px 4px; }
    .tut-toc a { border-left: none; padding: 7px 10px; }
    .tut-toc a.active { border-left: none; }
    .tut-main { padding: 18px 16px 72px; }
    .tut-topbar { padding: 0 16px; }
    .tut-hero { padding: 24px 20px; }
    .tut-hero h1 { font-size: 27px; }
}
