/* ─── Guides page additions ─────────────────────────────
   Loaded after stylesdocs.css. Only contains styles that
   are specific to the long-form guide and the interactive
   "Try a Spec" demo. Inherits all colour variables and
   typography from stylesdocs.css. */

/* ─── Colored sidebar section titles ─────────────────────
   Each top-level group in the left nav gets its own accent so the
   sidebar reads as a labelled map rather than a uniform list. */
.sidebar-section { position: relative; }

.sidebar-section .sidebar-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 8px;
    border-left: 3px solid var(--border);
    border-radius: 0;
    transition: var(--transition);
}

.sidebar-section[data-accent="orange"] .sidebar-title { color: var(--brand);     border-left-color: var(--brand); }
.sidebar-section[data-accent="blue"]   .sidebar-title { color: #60a5fa;          border-left-color: #60a5fa; }
.sidebar-section[data-accent="purple"] .sidebar-title { color: #c084fc;          border-left-color: #c084fc; }
.sidebar-section[data-accent="green"]  .sidebar-title { color: #34d399;          border-left-color: #34d399; }
.sidebar-section[data-accent="pink"]   .sidebar-title { color: #f472b6;          border-left-color: #f472b6; }

/* Tint the active link in each section to match the section's accent
   so the user gets a continuous color signal as they scroll. */
.sidebar-section[data-accent="orange"] .sidebar-nav li a.active { color: var(--brand); border-left-color: var(--brand); background: rgba(255, 93, 1, 0.08); }
.sidebar-section[data-accent="blue"]   .sidebar-nav li a.active { color: #60a5fa;       border-left-color: #60a5fa;       background: rgba(96, 165, 250, 0.08); }
.sidebar-section[data-accent="purple"] .sidebar-nav li a.active { color: #c084fc;       border-left-color: #c084fc;       background: rgba(192, 132, 252, 0.08); }
.sidebar-section[data-accent="green"]  .sidebar-nav li a.active { color: #34d399;       border-left-color: #34d399;       background: rgba(52, 211, 153, 0.08); }
.sidebar-section[data-accent="pink"]   .sidebar-nav li a.active { color: #f472b6;       border-left-color: #f472b6;       background: rgba(244, 114, 182, 0.08); }

/* Lead paragraph in the hero */
.content-wrapper .lead {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text);
    max-width: 760px;
}

/* ─── Hero "day 1 with vs without" split ─────────────── */
.hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0 24px 0;
}

@media (max-width: 800px) {
    .hero-split { grid-template-columns: 1fr; }
}

.hero-col {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    background: var(--card-bg);
}

.hero-col-bad { opacity: 0.85; }

.hero-col-good {
    border-color: var(--brand);
    background: var(--active-bg);
}

.hero-col-title {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 16px;
}

.hero-col-good .hero-col-title {
    color: var(--brand);
}

.hero-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.hero-list li {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.hero-list .x {
    display: inline-block;
    width: 18px;
    color: #ef4444;
    font-weight: 700;
}

.hero-list .check {
    display: inline-block;
    width: 18px;
    color: #10b981;
    font-weight: 700;
}

.hero-col-stat {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}

/* ─── Pipeline SVG ───────────────────────────────────── */
.pipeline-svg-wrap {
    margin: 32px 0;
    padding: 24px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.pipeline-svg {
    width: 100%;
    height: auto;
    min-width: 700px;
    display: block;
}

.pipeline-stage rect {
    fill: var(--panel);
    stroke: var(--border);
    stroke-width: 1;
    transition: var(--transition);
}

.pipeline-stage:hover rect {
    fill: var(--active-bg);
    stroke: var(--brand);
}

.stage-num {
    fill: var(--brand);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
}

.stage-name {
    fill: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.stage-legend {
    fill: var(--muted);
    font-size: 11px;
    font-family: 'Inter', sans-serif;
}

.stage-legend-sub {
    fill: var(--muted);
    opacity: 0.7;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.pipeline-line {
    stroke: var(--border);
    stroke-width: 2;
    stroke-dasharray: 4 4;
}

.pipeline-pulse {
    fill: var(--brand);
    filter: drop-shadow(0 0 6px var(--brand));
}

/* ─── Interactive Demo ───────────────────────────────── */

/* Stacked layout: spec on top → tour bar → tree | preview below.
   Fits cleanly in the 800px content column. Spec stays visible so
   the live cause-and-effect ("change spec → see code update") is
   preserved. Bottom auto-cycles through curated files. */
.demo-stack {
    margin: 32px 0 8px 0;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--code-bg);
}

.demo-stack .demo-pane {
    border: none;
    border-radius: 0;
    background: var(--code-bg);
}

/* Spec pane: short and wide */
.demo-pane-spec {
    min-height: 200px;
    max-height: 240px;
    border-bottom: 1px solid var(--border) !important;
}

#demo-spec {
    flex: 1;
    width: 100%;
    background: transparent;
    color: var(--text);
    border: none;
    padding: 14px 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

/* UML Class Diagram pane — sits between spec and tour bar.
   Visualizes what the Visualizer agent produces from the spec.
   Collapsible so it doesn't dominate vertical space. */
.demo-uml {
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.04), transparent);
}

.demo-uml-header {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(96, 165, 250, 0.04);
}

.demo-uml-icon {
    color: #60a5fa;
    margin-right: 4px;
}

.demo-uml-byline {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    margin-left: 6px;
}

.demo-uml-byline strong {
    color: #60a5fa;
    font-weight: 600;
}

.demo-uml-toggle {
    transition: transform 0.2s ease;
    color: var(--muted);
}

.demo-uml.collapsed .demo-uml-toggle {
    transform: rotate(-90deg);
}

.demo-uml.collapsed .demo-uml-body {
    height: 0;
    overflow: hidden;
    padding: 0;
}

.demo-uml-body {
    height: 260px;
    overflow: auto;
    padding: 14px 18px;
    background: var(--code-bg);
    transition: height 0.25s ease;
}

.demo-uml-render {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
}

.demo-uml-render svg {
    max-width: 100%;
    height: auto;
    /* Mermaid's default font sizing is a bit tight at our resolution */
    font-size: 12px !important;
}

.demo-uml-loading {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    opacity: 0.7;
}

/* When Mermaid renders nodes, override its default colours to match the page theme */
.demo-uml-render .classGroup rect,
.demo-uml-render .node rect {
    fill: var(--panel) !important;
    stroke: rgba(96, 165, 250, 0.5) !important;
    stroke-width: 1px !important;
}

.demo-uml-render .classGroup .title,
.demo-uml-render .classGroup .label {
    fill: var(--text) !important;
}

.demo-uml-render .relation,
.demo-uml-render .composition,
.demo-uml-render .aggregation,
.demo-uml-render .dependency {
    stroke: var(--muted) !important;
}

/* On very narrow screens, the UML pane gets a bit shorter */
@media (max-width: 640px) {
    .demo-uml-body { height: 200px; }
}

/* Tour bar: thin strip with prev/play/next + current file display */
.demo-tour-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 93, 1, 0.04);
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.demo-tour-btn {
    width: 28px;
    height: 28px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.demo-tour-btn:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--active-bg);
}

.demo-tour-btn.demo-tour-play {
    color: var(--brand);
    border-color: rgba(255, 93, 1, 0.3);
}

.demo-tour-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.demo-tour-mode {
    padding: 2px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand);
    background: var(--active-bg);
    border: 1px solid rgba(255, 93, 1, 0.3);
    border-radius: 4px;
    flex-shrink: 0;
}

.demo-tour-mode.manual {
    color: var(--muted);
    background: transparent;
    border-color: var(--border);
}

.demo-tour-path {
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    font-size: 12px;
}

.demo-tour-progress {
    color: var(--muted);
    font-size: 11px;
    flex-shrink: 0;
}

/* Bottom split: tree + preview.
   Both panes are HEIGHT-LOCKED so the tree never balloons to fit all
   63 files. Internal scrolling takes over once content exceeds 460px. */
.demo-bottom {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 460px;
    background: var(--code-bg);
}

.demo-pane-tree {
    border-right: 1px solid var(--border) !important;
    display: flex;
    flex-direction: column;
    height: 460px;
    min-height: 0;
    overflow: hidden;          /* let .demo-tree scroll internally */
}

.demo-pane-code {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 460px;
    overflow: hidden;          /* let <pre> scroll internally */
}

/* The fade-in animation applied each time the preview switches files */
.demo-pane-code pre {
    animation: previewFade 0.35s ease-out;
}

@keyframes previewFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* On very narrow screens, stack tree above preview */
@media (max-width: 640px) {
    .demo-bottom {
        grid-template-columns: 1fr;
        height: auto;
    }
    .demo-pane-tree {
        border-right: none !important;
        border-bottom: 1px solid var(--border) !important;
        height: 260px;
    }
    .demo-pane-code { height: 380px; }
    .demo-tour-bar { flex-wrap: wrap; }
    .demo-tour-path { font-size: 11px; }
}

/* Tiny meta tag that fades — used to whisper "click any file" hint */
.demo-pane-meta-faint {
    opacity: 0.6;
    font-size: 10px;
}

.demo-pane {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 480px;
}

.demo-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(128, 128, 128, 0.05);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.demo-pane-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

.demo-pane-meta {
    font-size: 11px;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
}

.demo-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.demo-btn:hover {
    color: var(--brand);
    border-color: var(--brand);
}

#demo-spec {
    flex: 1;
    width: 100%;
    background: transparent;
    color: var(--text);
    border: none;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.demo-tree {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    /* Scrollbar styling matches the rest of the doc site */
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}

.demo-tree::-webkit-scrollbar { width: 6px; }
.demo-tree::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.25); border-radius: 6px; }
.demo-tree::-webkit-scrollbar-thumb:hover { background: var(--brand); }

.demo-tree-folder,
.demo-tree-file {
    padding: 1px 12px;
    color: var(--muted);
    cursor: default;
    user-select: none;
    white-space: nowrap;
    line-height: 1.55;          /* ~22px row height, matches IDE */
}

.demo-tree-file {
    cursor: pointer;
    transition: background 0.1s ease;
}

.demo-tree-file:hover {
    background: var(--active-bg);
    color: var(--text);
}

.demo-tree-file.active {
    background: var(--active-bg);
    color: var(--brand);
    font-weight: 500;
}

.demo-tree-icon {
    display: inline-block;
    width: 18px;
    color: var(--muted);
}

.demo-tree-folder {
    color: var(--text);
    font-weight: 500;
    padding-top: 2px;            /* was 8px — too gappy */
}

.demo-tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.demo-tree-file {
    display: flex;
    align-items: center;
    gap: 6px;
    border-left: 2px solid transparent; /* will be tinted per-tier */
    margin-left: -2px;
}

/* Compact 1-letter tier chip — replaces verbose ENTITY/PLATFORM/INFRA labels */
.demo-tree-tier {
    margin-left: auto;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    border-radius: 3px;
    border: 1px solid var(--border);
    color: var(--muted);
    opacity: 0.85;
    flex-shrink: 0;
}

.demo-tree-file:hover .demo-tree-tier { opacity: 1; }

/* Per-tier accents: thin colored left-edge bar + same color on the chip */
.demo-tree-file.tier-entity   { border-left-color: var(--brand); }
.demo-tree-file.tier-platform { border-left-color: #60a5fa; }
.demo-tree-file.tier-infra    { border-left-color: #c084fc; }
.demo-tree-file.tier-config   { border-left-color: #9daab6; }

.tier-pill-entity {
    color: var(--brand);
    background: rgba(255, 93, 1, 0.10);
    border-color: rgba(255, 93, 1, 0.30);
}
.tier-pill-platform {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.10);
    border-color: rgba(96, 165, 250, 0.30);
}
.tier-pill-infra {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.10);
    border-color: rgba(192, 132, 252, 0.30);
}
.tier-pill-config {
    color: #9daab6;
    background: rgba(157, 170, 182, 0.08);
    border-color: rgba(157, 170, 182, 0.25);
}

/* Header summary — total chip + per-tier mini-chips. Wraps gracefully. */
.demo-pane-meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    max-width: 100%;
}

.demo-summary-chip {
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.5;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Compact pane header so the chips don't collide with the title on tight panes */
.demo-pane-header {
    flex-wrap: wrap;
    gap: 6px;
}

.demo-pane-code pre {
    flex: 1;
    margin: 0;
    padding: 16px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.6;
}

.demo-pane-code code {
    color: var(--text);
}

/* tiny syntax tint */
.demo-pane-code .kw { color: #c084fc; }
.demo-pane-code .ty { color: #60a5fa; }
.demo-pane-code .st { color: #34d399; }
.demo-pane-code .cm { color: var(--muted); font-style: italic; }
.demo-pane-code .dc { color: #fbbf24; }

/* ─── Workflow list (SDLC steps) ────────────────────────── */
.workflow-list {
    list-style: none;
    padding: 0;
    margin: 32px 0;
    counter-reset: workflow-step;
}

.workflow-list li {
    counter-increment: workflow-step;
    margin-bottom: 12px;
}

.workflow-step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 16px;
    padding: 18px 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.workflow-step:hover {
    border-color: rgba(255, 93, 1, 0.3);
    background: var(--active-bg);
}

.workflow-step-highlight {
    border-color: var(--brand);
    background: var(--active-bg);
}

.workflow-step-highlight .workflow-num {
    color: var(--brand);
}

.workflow-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1;
}

.workflow-step strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    margin-bottom: 4px;
}

.workflow-step p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 14px;
}

/* ─── Agent cards grid ──────────────────────────────────── */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.agent-card {
    padding: 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.agent-card:hover {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(96, 165, 250, 0.04);
}

.agent-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.agent-name {
    font-weight: 700;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 8px;
}

.agent-alias {
    font-weight: 400;
    color: var(--muted);
    font-size: 13px;
}

.agent-role {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 14px 0;
}

.agent-phase {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
    background: var(--active-bg);
    border: 1px solid rgba(255, 93, 1, 0.25);
    border-radius: 4px;
    margin-bottom: 14px;
}

.agent-tools {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.7;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    word-break: break-word;
}

.agent-tools code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: #60a5fa;
}

.agent-state {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    opacity: 0.85;
}

.agent-state code {
    background: var(--code-bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--brand);
    font-size: 10px;
}

/* Per-persona accent — phase tag color shifts so the 5 cards read as
   distinct stages in a pipeline, not as 5 of the same thing. */
.agent-card[data-persona="analyst"]      .agent-phase { color: #60a5fa; background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.3); }
.agent-card[data-persona="architect"]    .agent-phase { color: #c084fc; background: rgba(192, 132, 252, 0.08); border-color: rgba(192, 132, 252, 0.3); }
.agent-card[data-persona="techlead"]     .agent-phase { color: var(--brand); background: rgba(255, 93, 1, 0.08); border-color: rgba(255, 93, 1, 0.3); }
.agent-card[data-persona="orchestrator"] .agent-phase { color: #34d399; background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.3); }
.agent-card[data-persona="developer"]    .agent-phase { color: #f472b6; background: rgba(244, 114, 182, 0.08); border-color: rgba(244, 114, 182, 0.3); }

/* ─── MCP grid (4 points) ───────────────────────────────── */
.mcp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

@media (max-width: 720px) {
    .mcp-grid { grid-template-columns: 1fr; }
}

.mcp-point {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 18px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mcp-num {
    color: var(--brand);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.mcp-point strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    margin-bottom: 6px;
}

.mcp-point p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 13.5px;
}

/* ─── Try-It step list ─────────────────────────────────── */
.try-steps {
    list-style: none;
    padding: 0;
    margin: 20px 0 24px 0;
    display: grid;
    gap: 8px;
    counter-reset: try-step;
}

.try-steps li {
    counter-increment: try-step;
    padding: 10px 14px 10px 44px;
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.try-steps li::before {
    content: counter(try-step);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--active-bg);
    color: var(--brand);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 93, 1, 0.3);
}

/* ─── Demo legend (under the 3-pane demo) ─────────────── */
.demo-legend {
    margin-top: 16px;
    padding: 14px 18px;
    background: var(--panel);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
}

.demo-legend strong { color: var(--text); }

.demo-legend .legend-chip {
    display: inline-block;
    padding: 1px 7px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 0 2px 0 6px;
    line-height: 1.5;
    vertical-align: middle;
}

/* ─── Cost / fast / quality grid cards ───────────────── */
.cost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

@media (max-width: 800px) {
    .cost-grid { grid-template-columns: 1fr; }
}

.cost-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
}

.cost-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.cost-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.cost-card-row:last-child {
    border-bottom: none;
}

.cost-good {
    color: #10b981;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.cost-bad {
    color: #ef4444;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

/* ─── "Worked example" file list ────────────────────── */
.worked-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

@media (max-width: 800px) {
    .worked-list { grid-template-columns: 1fr; }
}

.worked-list li {
    padding: 6px 0 6px 24px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
}

.worked-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--brand);
    font-weight: 700;
}

/* ─── Freedom (not-locked-in) list ────────────────────── */
.freedom-list {
    margin: 32px 0;
}

.freedom-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.freedom-row:last-child {
    border-bottom: none;
}

.freedom-row-num {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--active-bg);
    color: var(--brand);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.freedom-row strong {
    color: var(--text);
    font-size: 16px;
}

.freedom-row p {
    margin: 8px 0 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ─── Comparison table ──────────────────────────────── */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.compare-table th,
.compare-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.compare-table thead th {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
    font-weight: 600;
}

.compare-table thead th:nth-child(2) {
    color: var(--brand);
}

.compare-table .row-label {
    color: var(--muted);
    font-weight: 500;
    width: 220px;
}

.compare-table .good { color: #10b981; }
.compare-table .bad { color: #ef4444; }
.compare-table tbody tr:hover {
    background: var(--active-bg);
}

/* ─── Quickstart: client badges + numbered steps ───────── */
.clients-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 16px 18px;
    margin: 24px 0 32px 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}

.clients-label {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 6px;
}

.client-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text);
    transition: var(--transition);
}

.client-badge:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.client-badge small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.client-badge.muted {
    color: var(--muted);
    border-style: dashed;
}

.client-badge.muted:hover {
    color: var(--brand);
    border-color: var(--brand);
}

/* Numbered quickstart steps */
.qstep {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 20px;
    padding: 22px 24px;
    margin-bottom: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.qstep:hover {
    border-color: rgba(255, 93, 1, 0.3);
}

.qstep-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--active-bg);
    color: var(--brand);
    border: 1px solid rgba(255, 93, 1, 0.3);
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.qstep-body h3 {
    margin: 0 0 8px 0;
    font-size: 17px;
    color: var(--text);
    border: none;
    padding: 0;
}

.qstep-body p {
    margin: 0 0 12px 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 14px;
}

.qstep-body p:last-child { margin-bottom: 0; }

.qstep-body .code-block { margin: 8px 0 0 0; }

/* The final "→ open your agent" step gets the brand-orange treatment */
.qstep-final {
    border-color: var(--brand);
    background: linear-gradient(135deg, rgba(255, 93, 1, 0.06), rgba(255, 93, 1, 0.02));
}

.qstep-final .qstep-num {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-size: 22px;
}

.qstep-quote {
    margin: 14px 0;
    padding: 14px 18px;
    background: var(--code-bg);
    border-left: 3px solid var(--brand);
    border-radius: 0 8px 8px 0;
    color: var(--text);
    font-style: italic;
    font-size: 14px;
    line-height: 1.65;
    quotes: none;
}

@media (max-width: 600px) {
    .qstep { grid-template-columns: 1fr; padding: 18px; }
    .qstep-num { margin-bottom: 8px; }
    .clients-strip { padding: 14px; }
}

/* ─── FAQ ───────────────────────────────────────────── */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--card-bg);
    transition: var(--transition);
}

.faq-item[open] {
    border-color: var(--brand);
    background: var(--active-bg);
}

.faq-item summary {
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 24px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    color: var(--brand);
    font-size: 20px;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    margin: 12px 0 0 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 14px;
}

.faq-item code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL — port of index.html reveal pattern
   ═══════════════════════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.52s ease, transform 0.52s ease;
}
.reveal.visible {
    opacity: 1;
    transform: none;
}
/* stagger helpers */
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }

/* ═══════════════════════════════════════════════════════════
   PIPELINE INTERACTIVE — clickable stage detail
   ═══════════════════════════════════════════════════════════ */
.pipeline-stage-active rect {
    fill: var(--active-bg) !important;
    stroke: var(--brand) !important;
}
#pipeline-detail {
    display: none;
    margin-top: 16px;
    animation: previewFade 0.28s ease-out;
}
.pipeline-detail-inner {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--muted);
}
.pipeline-detail-inner strong {
    color: var(--brand);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════
   #JOURNEY — animated build section
   ═══════════════════════════════════════════════════════════ */
#journey-wrap {
    margin: 32px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--code-bg);
}

/* ── Progress dots ── */
.jny-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px 0;
}
.jny-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: background 0.25s, transform 0.2s;
    border: 1px solid transparent;
}
.jny-dot.active {
    background: var(--brand);
    transform: scale(1.25);
    border-color: var(--brand);
}
.jny-dot:hover:not(.active) {
    background: var(--muted);
}
.jny-phase-labels {
    display: flex;
    gap: 0;
    padding: 4px 24px 0;
    flex-wrap: wrap;
}
.jny-phase-label {
    font-size: 10px;
    color: var(--muted);
    flex: 1;
    min-width: 60px;
    text-align: center;
    opacity: 0.55;
}

/* ── Split stage ── */
.jny-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 420px;
}

.jny-left, .jny-right {
    padding: 20px;
}
.jny-left {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}
.jny-right {
    background: var(--panel);
}

.jny-pane-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 2px;
}

/* ── Controls bar ── */
.jny-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--panel);
}
.jny-btn {
    padding: 7px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.jny-btn:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--active-bg);
}
.jny-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.jny-btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.jny-btn-primary:hover:not(:disabled) {
    background: var(--brand-light);
    border-color: var(--brand-light);
    color: #fff;
}
.jny-step-label {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ── Agent card (right panel) ── */
.jny-agent-phase {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 12px;
}
.jny-agent-icon {
    font-size: 32px;
    margin-bottom: 10px;
    line-height: 1;
}
.jny-agent-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.jny-agent-role {
    font-size: 13px;
    line-height: 1.65;
    color: var(--muted);
    margin: 0 0 20px;
}
.jny-agent-output {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.jny-output-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
}
.jny-output-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--brand);
    background: var(--active-bg);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-block;
    word-break: break-all;
}

/* ── Shared inner panel chrome ── */
.jny-pane-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.jny-file-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--panel);
}
.jny-badge-blue {
    border-color: #60a5fa40;
    color: #60a5fa;
    background: #60a5fa08;
}
.jny-badge-ok {
    border-color: #10b98140;
    color: #10b981;
    background: #10b98108;
}
.jny-typing-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--brand);
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.8;
}
.jny-typing-done {
    color: #10b981 !important;
}

/* ── Step 0: Spec / Typewriter ── */
.jny-spec-wrap {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.jny-spec-pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text);
    background: transparent;
    margin: 0;
    white-space: pre;
    overflow: hidden;
    flex: 1;
}
.jny-spec-dimmed {
    opacity: 0.65;
}
.jny-cursor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--brand);
    animation: cursorBlink 0.9s steps(1) infinite;
    position: absolute;
    bottom: 0;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
mark.jny-entity-mark {
    background: rgba(255, 93, 1, 0.15);
    color: var(--brand);
    border-radius: 3px;
    padding: 0 2px;
    font-style: normal;
}

/* ── Step 1: Analyst ── */
.jny-analyst-wrap { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.jny-domain-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.jny-domain-chip {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid;
    background: transparent;
}

/* ── Step 2: Architect ── */
.jny-arch-wrap { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.jny-domains-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.jny-domain-box {
    border: 1px solid;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.jny-domain-title {
    font-size: 12px;
    font-weight: 700;
    min-width: 80px;
}
.jny-domain-entities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.jny-entity-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid;
    color: var(--text);
    background: rgba(255,255,255,0.03);
}
.jny-approval-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.jny-check {
    color: var(--brand);
    font-size: 14px;
}
.jny-check-ok {
    color: #10b981;
    font-size: 14px;
    font-weight: 700;
}

/* ── Step 3: Tech Lead ── */
.jny-shards-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.jny-shard-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-size: 12px;
}
.jny-shard-icon { font-size: 13px; flex-shrink: 0; }
.jny-shard-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text);
    flex: 1;
}
.jny-shard-meta { font-size: 11px; color: var(--muted); }
.jny-shard-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.jny-compile-done {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ── Step 4: Orchestrator ── */
.jny-orchestrator-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.jny-compile-stages {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.jny-compile-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 12px;
    color: var(--muted);
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.jny-compile-row.active {
    background: var(--active-bg);
    border-color: var(--brand);
    color: var(--text);
}
.jny-stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: border-color 0.25s, background 0.25s;
}
.jny-compile-row.active .jny-stage-dot {
    border-color: var(--brand);
    background: var(--brand);
}
.jny-stage-label { flex: 1; }
.jny-stage-ok {
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    transition: opacity 0.3s;
}
.jny-prog-wrap {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}
.jny-prog-bar {
    height: 100%;
    background: var(--brand);
    border-radius: 2px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.jny-prog-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
}

/* ── Step 5: Developer / Files ── */
.jny-files-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    min-height: 0;
}
.jny-file-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--brand);
    margin-left: auto;
}
.jny-file-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
    max-height: 300px;
}
.jny-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    transition: background 0.15s;
}
.jny-file-row:hover { background: var(--active-bg); }
.jny-file-ext {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    min-width: 36px;
    font-weight: 700;
}
.jny-file-path { color: var(--text); line-height: 1.4; }
.jny-file-dir { color: var(--muted); }
.jny-final-note {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    padding: 10px 0 4px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateY(4px);
}

/* ── Responsive ── */
@media (max-width: 720px) {
    .jny-stage {
        grid-template-columns: 1fr;
    }
    .jny-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 280px;
    }
    .jny-right {
        max-height: 240px;
        overflow-y: auto;
    }
}

