.hiw_intro {
    margin: 16px 0 0;
    max-width: 56ch;
    color: var(--text_secondary);
    font-family: var(--text_font);
    font-size: 1.05rem;
    line-height: 1.6;
}

.hiw_layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 40px;
    margin-top: 48px;
    align-items: start;
}

/* ---------- Steps ---------- */

.hiw_steps {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #1c1c1c;
}

.hiw_step {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    margin-left: -1px;
    border: 0;
    border-left: 2px solid transparent;
    background: transparent;
    color: var(--text_secondary);
    text-align: left;
    cursor: pointer;
    font-family: var(--text_font);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hiw_step:hover {
    background: var(--background_panel);
    color: var(--text_primary);
}

.hiw_step:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: -1px;
}

.hiw_step.is_active {
    background: var(--background_panel);
    border-left-color: var(--accent);
    color: var(--text_primary);
}

.hiw_step_num {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid #2a2a2a;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    color: var(--text_secondary);
}

.hiw_step.is_active .hiw_step_num {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--background_main);
}

.hiw_step_body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hiw_step_title {
    font-family: var(--header_font);
    font-size: 1.5rem;
    line-height: 1.1;
    color: var(--text_primary);
}

/* Description only shows for the active step */
.hiw_step_desc {
    display: none;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text_secondary);
    max-width: 44ch;
}

.hiw_step.is_active .hiw_step_desc {
    display: block;
}

.hiw_window {
    position: sticky;
    top: 10vh;
    background: #181818;
    border: 1px solid #222;
    box-shadow: 3px 3px 0 -1px rgba(77, 203, 194, 0.18), 6px 6px 0 0 var(--accent);
    min-width: 0;
}

.hiw_window_bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #101010;
    border-bottom: 1px solid #222;
}

.hiw_dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.hiw_dot_red { background: #ff5f56; }
.hiw_dot_yellow { background: #ffbd2e; }
.hiw_dot_green { background: #27c93f; }

.hiw_file {
    margin-left: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    color: var(--text_secondary);
}

.hiw_code {
    margin: 0;
    padding: 24px;
    min-height: 280px;
    overflow-x: auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.7;
    color: #d4d4d4;
    tab-size: 4;
}

/* Only the code swap animates, because it answers a click */
.hiw_window_content .hiw_code {
    animation: hiw_swap 0.18s ease-out;
}

@keyframes hiw_swap {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.tok_kw { color: #c586c0; }
.tok_str { color: #ce9178; }
.tok_num { color: #b5cea8; }
.tok_comment { color: #5c6370; }
.tok_fn { color: var(--accent); }
.tok_prompt { color: var(--accent); margin-right: 8px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .hiw_layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .hiw_window {
        position: static;
        order: -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hiw_window_content .hiw_code { animation: none; }
    .hiw_step { transition: none; }
}