/* ============================================================
   Resume Builder Live Demo - page-specific styles
   Inherits design tokens, fonts, .btn / .tag / .gradient-text,
   floatOrb/pulseDot/blinkCursor keyframes, .skip-nav from ../styles.css
   ============================================================ */

/* ----- Body / global ----- */
.demo-body {
    background: var(--bg-0);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ----- Demo nav (compact) ----- */
.demo-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 18px 0;
    background: rgba(6, 6, 15, 0.78);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--border);
}

.demo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-1);
    padding: 7px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    transition: var(--t);
}

.demo-back-link:hover {
    color: var(--cyan);
    border-color: var(--border-a);
    background: rgba(34, 211, 238, 0.06);
}

/* ----- Main + ambient background ----- */
.demo-main {
    position: relative;
    min-height: calc(100vh - 60px);
    padding: 56px 0 80px;
}

.demo-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.demo-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, rgba(0,0,0,.85) 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, rgba(0,0,0,.85) 0%, transparent 100%);
}

.demo-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.13;
    pointer-events: none;
}

.demo-glow-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, var(--cyan), transparent 70%);
    top: -180px;
    right: -100px;
    animation: floatOrb 11s ease-in-out infinite;
}

.demo-glow-2 {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, var(--violet), transparent 70%);
    bottom: -160px;
    left: -120px;
    animation: floatOrb 14s ease-in-out infinite reverse;
}

.demo-container {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   Hero panel
   ============================================================ */
.demo-hero {
    text-align: center;
    margin-bottom: 40px;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.demo-hero .section-label {
    margin-bottom: 16px;
}

.demo-title {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    letter-spacing: -0.03em;
    margin-bottom: 18px;
    font-family: var(--ff-display);
    line-height: 1.05;
}

.demo-subhead {
    color: var(--text-1);
    font-size: 1.0rem;
    line-height: 1.78;
    max-width: 660px;
    margin: 0 auto 28px;
}

.demo-goal {
    display: inline-flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 22px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg,
        rgba(34, 211, 238, 0.06) 0%,
        rgba(167, 139, 250, 0.06) 100%);
    border: 1px solid rgba(34, 211, 238, 0.18);
    text-align: left;
    max-width: 720px;
    margin-bottom: 22px;
    backdrop-filter: blur(8px);
}

.demo-goal-label {
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background: rgba(34, 211, 238, 0.10);
    border: 1px solid rgba(34, 211, 238, 0.28);
    padding: 4px 10px;
    border-radius: 100px;
    flex-shrink: 0;
    margin-top: 2px;
}

.demo-goal-text {
    font-size: 0.92rem;
    color: var(--text-0);
    line-height: 1.65;
    margin: 0;
    font-family: var(--ff-sans);
}

.demo-goal-text strong {
    color: var(--cyan);
    font-weight: 600;
}

.demo-goal-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.goal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-1);
    font-size: 0.82rem;
    font-family: var(--ff-mono);
    font-weight: 500;
    transition: var(--t);
    cursor: pointer;
}

.goal-btn i {
    font-size: 0.78rem;
    color: var(--text-2);
    transition: var(--t);
}

.goal-btn:hover {
    color: var(--text-0);
    border-color: var(--border-a);
    background: var(--bg-card-h);
}

.goal-btn:hover i {
    color: var(--cyan);
}

.goal-btn.active {
    color: var(--cyan);
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.10);
}

.goal-btn.active i {
    color: var(--cyan);
}

/* ============================================================
   Health score bar
   ============================================================ */
.health-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 22px;
    background: linear-gradient(135deg,
        rgba(34, 211, 238, 0.04) 0%,
        rgba(167, 139, 250, 0.04) 100%);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.health-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: var(--gradient);
    opacity: 0.6;
}

.health-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.health-eyebrow {
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    color: var(--cyan);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.health-state {
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    transition: color var(--t), border-color var(--t), background var(--t);
}

.health-state.is-draft     { color: var(--text-2); }
.health-state.is-scoring   { color: var(--cyan); border-color: rgba(34, 211, 238, 0.32); background: rgba(34, 211, 238, 0.07); }
.health-state.is-coaching  { color: #f59e0b; border-color: rgba(245, 158, 11, 0.32); background: rgba(245, 158, 11, 0.07); }
.health-state.is-rewriting { color: var(--violet); border-color: rgba(167, 139, 250, 0.32); background: rgba(167, 139, 250, 0.07); }
.health-state.is-ready     { color: #4ade80; border-color: rgba(74, 222, 128, 0.32); background: rgba(74, 222, 128, 0.10); }

.health-track {
    position: relative;
    flex: 1;
    height: 10px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    overflow: hidden;
}

.health-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--gradient);
    border-radius: 100px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.4);
}

.health-fill.is-ready {
    background: linear-gradient(90deg, #22d3ee 0%, #4ade80 100%);
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.45);
}

.health-marker {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--bg-0);
    border: 2px solid var(--cyan);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
    transition: left 0.45s cubic-bezier(0.4, 0, 0.2, 1), border-color var(--t);
}

.health-marker.is-ready {
    border-color: #4ade80;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.7);
}

.health-value {
    flex-shrink: 0;
    font-family: var(--ff-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-0);
    letter-spacing: -0.02em;
    min-width: 78px;
    text-align: right;
}

.health-denom {
    color: var(--text-2);
    font-weight: 500;
    font-size: 0.92rem;
    margin-left: 1px;
}

/* ============================================================
   Stage grid - editor + preview side by side
   ============================================================ */
.stage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 22px;
    margin-bottom: 32px;
    position: relative;
}

.editor-pane,
.preview-pane {
    background: rgba(8, 8, 18, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px 24px 26px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.editor-pane::before,
.preview-pane::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: var(--gradient);
    opacity: 0.5;
}

.pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.pane-eyebrow {
    font-family: var(--ff-mono);
    font-size: 0.74rem;
    color: var(--cyan);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pane-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    color: var(--text-1);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-2);
    flex-shrink: 0;
    transition: background var(--t), box-shadow var(--t);
}

.dot-idle    { background: var(--text-2); }
.dot-running { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulseDot 1.4s ease-in-out infinite; }
.dot-done    { background: #4ade80; box-shadow: 0 0 8px #4ade80; }

/* ----- Editor sections ----- */
.editor-section {
    margin-bottom: 20px;
}

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

.editor-label {
    font-family: var(--ff-mono);
    font-size: 0.7rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    margin-bottom: 8px;
}

.editor-line {
    font-family: var(--ff-sans);
    font-size: 0.96rem;
    color: var(--text-0);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    min-height: 1.6em;
    line-height: 1.5;
}

.caret {
    display: inline-block;
    width: 7px;
    height: 1em;
    background: var(--cyan);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: blinkCursor 0.85s step-end infinite;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.7);
    opacity: 0;
}

.caret.is-active {
    opacity: 1;
}

/* ----- Bullet list ----- */
.bullet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    transition: background var(--t), border-color var(--t), box-shadow var(--t);
    position: relative;
}

.bullet-item.is-active {
    background: rgba(34, 211, 238, 0.05);
    border-color: rgba(34, 211, 238, 0.32);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.10), 0 6px 20px rgba(34, 211, 238, 0.10);
}

.bullet-item.is-weak {
    border-color: rgba(239, 68, 68, 0.30);
    background: rgba(239, 68, 68, 0.04);
}

.bullet-item.is-medium {
    border-color: rgba(245, 158, 11, 0.30);
    background: rgba(245, 158, 11, 0.04);
}

.bullet-item.is-strong {
    border-color: rgba(74, 222, 128, 0.30);
    background: rgba(74, 222, 128, 0.04);
}

.bullet-num {
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    color: var(--text-2);
    min-width: 22px;
    padding-top: 2px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.bullet-content {
    flex: 1;
    min-width: 0;
}

.bullet-text {
    font-family: var(--ff-sans);
    font-size: 0.92rem;
    color: var(--text-0);
    line-height: 1.5;
    min-height: 1.5em;
    word-wrap: break-word;
    transition: color var(--t);
}

.bullet-item.is-active .bullet-text::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 0.95em;
    background: var(--cyan);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blinkCursor 0.85s step-end infinite;
    box-shadow: 0 0 5px rgba(34, 211, 238, 0.6);
}

.bullet-item.is-erasing .bullet-text {
    color: var(--text-2);
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.55);
    text-decoration-thickness: 1.5px;
}

.bullet-chip {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 0;
    transition: opacity var(--t);
}

.bullet-chip:empty {
    margin-top: 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    line-height: 1.4;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    transform: scale(0.85);
    opacity: 0;
    animation: chipPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.chip-ok    { color: #4ade80; border-color: rgba(74, 222, 128, 0.32); background: rgba(74, 222, 128, 0.08); }
.chip-warn  { color: #f59e0b; border-color: rgba(245, 158, 11, 0.32); background: rgba(245, 158, 11, 0.08); }
.chip-bad   { color: #ef4444; border-color: rgba(239, 68, 68, 0.32); background: rgba(239, 68, 68, 0.08); }

.chip i {
    font-size: 0.66rem;
}

@keyframes chipPop {
    0%   { opacity: 0; transform: scale(0.85); }
    70%  { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

/* ----- Coaching tooltip ----- */
.coach-tip {
    margin-top: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg,
        rgba(245, 158, 11, 0.10) 0%,
        rgba(167, 139, 250, 0.08) 100%);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: var(--text-0);
    font-family: var(--ff-sans);
    font-size: 0.86rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--t), transform var(--t);
}

.coach-tip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.coach-tip i {
    color: #f59e0b;
    margin-top: 3px;
    flex-shrink: 0;
}

.coach-text {
    flex: 1;
}

.coach-text strong {
    color: #f59e0b;
    font-weight: 600;
}

/* ============================================================
   Preview pane - resume document (light surface for contrast)
   ============================================================ */
.resume-doc {
    background: #f8fafc;
    color: #0f172a;
    border-radius: var(--r-md);
    padding: 28px 30px 24px;
    font-family: 'Inter', sans-serif;
    line-height: 1.55;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
    transition: box-shadow var(--t);
    min-height: 360px;
}

.resume-doc.is-ready {
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4),
                0 0 0 2px rgba(74, 222, 128, 0.5),
                0 0 30px rgba(74, 222, 128, 0.25);
}

.doc-head {
    margin-bottom: 14px;
}

.doc-name {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.doc-title {
    font-size: 0.95rem;
    color: #475569;
    margin: 0 0 6px;
    font-weight: 500;
}

.doc-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
}

.doc-rule {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, #22d3ee 0%, #a78bfa 100%);
    opacity: 0.55;
    margin: 12px 0 16px;
}

.doc-section-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 0 0 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.doc-job-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 0.92rem;
}

.doc-job-head strong {
    color: #0f172a;
    font-weight: 600;
}

.doc-job-head span {
    color: #64748b;
    font-size: 0.82rem;
    font-family: 'JetBrains Mono', monospace;
}

.doc-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-bullet {
    position: relative;
    padding-left: 16px;
    font-size: 0.86rem;
    color: #1e293b;
    line-height: 1.55;
    transition: color var(--t), opacity var(--t);
}

.doc-bullet::before {
    content: '';
    position: absolute;
    left: 0; top: 0.6em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #94a3b8;
    transition: background var(--t);
}

.doc-bullet.is-strong::before {
    background: #22d3ee;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.5);
}

.doc-bullet:empty {
    display: none;
}

/* ============================================================
   Timeline pipeline
   ============================================================ */
.demo-timeline-section {
    margin-bottom: 26px;
}

.demo-timeline-section .stage-eyebrow {
    display: block;
    margin-bottom: 14px;
    font-family: var(--ff-mono);
    font-size: 0.74rem;
    color: var(--cyan);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.demo-timeline {
    list-style: none;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.timeline-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 12px;
    font-family: var(--ff-mono);
    font-size: 0.74rem;
    color: var(--text-2);
    border-right: 1px solid var(--border);
    transition: color var(--t), background var(--t);
    text-align: center;
    line-height: 1.3;
    position: relative;
}

.timeline-step:last-child {
    border-right: none;
}

.ts-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-2);
    font-size: 0.72rem;
    transition: color var(--t);
}

.timeline-step.active {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.06);
}

.timeline-step.active .ts-marker {
    color: var(--cyan);
}

.timeline-step.active .ts-marker i {
    animation: spin 1.6s linear infinite;
}

.timeline-step.completed {
    color: #4ade80;
}

.timeline-step.completed .ts-marker {
    color: #4ade80;
}

.timeline-step.completed .ts-marker i {
    animation: none;
}

.timeline-step .ts-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Output pane
   ============================================================ */
.output-pane {
    background: rgba(4, 4, 12, 0.75);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.output-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.output-tabs {
    display: flex;
    gap: 6px;
}

.output-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.55;
}

.output-dot-r { background: #ef4444; }
.output-dot-y { background: #f59e0b; }
.output-dot-g { background: #4ade80; }

.output-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--ff-mono);
    font-size: 0.74rem;
    color: var(--text-1);
}

.output-agent {
    color: var(--cyan);
    font-weight: 500;
    text-transform: lowercase;
}

.output-sep {
    color: var(--text-2);
    opacity: 0.6;
}

.output-action {
    color: var(--text-2);
}

.output-body {
    margin: 0;
    padding: 22px 22px 24px;
    font-family: var(--ff-mono);
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--text-0);
    min-height: 220px;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
}

.output-body code {
    font-family: inherit;
    color: inherit;
    background: none;
    padding: 0;
}

.output-caret {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--cyan);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: blinkCursor 0.85s step-end infinite;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.7);
}

.output-body::-webkit-scrollbar { width: 8px; }
.output-body::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
.output-body::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, 0.18); border-radius: 4px; }
.output-body::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.28); }

.output-body .ok    { color: #4ade80; }
.output-body .warn  { color: #f59e0b; }
.output-body .bad   { color: #ef4444; }
.output-body .key   { color: var(--cyan); }
.output-body .acc   { color: var(--violet); }
.output-body .dim   { color: var(--text-2); }

/* ============================================================
   Controls bar
   ============================================================ */
.demo-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.ctl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-0);
    font-size: 0.84rem;
    font-family: var(--ff-mono);
    font-weight: 500;
    transition: var(--t);
    cursor: pointer;
}

.ctl-btn i {
    font-size: 0.78rem;
    color: var(--text-1);
    transition: color var(--t);
}

.ctl-btn:hover {
    border-color: var(--border-a);
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.05);
}

.ctl-btn:hover i {
    color: var(--cyan);
}

.ctl-btn:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.ctl-primary {
    background: var(--gradient);
    border-color: transparent;
    color: #05050d;
}

/* Subtle pulse hint while we wait for the demo to scroll into view */
.ctl-primary.is-pulse-hint {
    animation: ctlPulseHint 2.2s ease-in-out infinite;
}

@keyframes ctlPulseHint {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.0); }
    50%      { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0.18); }
}

.ctl-primary i {
    color: #05050d;
}

.ctl-primary:hover {
    color: #05050d;
    background: var(--gradient);
    filter: brightness(1.07);
    box-shadow: 0 6px 20px rgba(34, 211, 238, 0.28);
}

.ctl-primary:hover i {
    color: #05050d;
}

.ctl-spacer {
    flex: 1;
    min-width: 8px;
}

.ctl-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ff-mono);
    font-size: 0.74rem;
    color: var(--text-2);
    line-height: 1.5;
}

.ctl-hint i {
    color: var(--cyan);
    opacity: 0.7;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
    .stage-grid {
        grid-template-columns: 1fr;
    }
    .demo-timeline {
        flex-wrap: wrap;
    }
    .timeline-step {
        flex: 1 1 33%;
        border-bottom: 1px solid var(--border);
    }
    .timeline-step:nth-child(3n) {
        border-right: none;
    }
}

@media (max-width: 640px) {
    .demo-main { padding: 32px 0 56px; }
    .demo-hero { margin-bottom: 28px; }
    .demo-goal {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .health-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    .health-meta { order: 1; }
    .health-value { order: 2; margin-left: auto; }
    .health-track { order: 3; flex-basis: 100%; }
    .editor-pane,
    .preview-pane { padding: 18px 18px 22px; }
    .resume-doc { padding: 22px 22px 20px; }
    .timeline-step {
        flex: 1 1 50%;
    }
    .timeline-step:nth-child(3n) { border-right: 1px solid var(--border); }
    .timeline-step:nth-child(2n) { border-right: none; }
    .demo-controls {
        gap: 8px;
    }
    .ctl-hint {
        flex-basis: 100%;
        order: 10;
        margin-top: 6px;
    }
    .output-body {
        font-size: 0.78rem;
        padding: 18px 16px 20px;
        max-height: 280px;
    }
    .demo-back-link span { display: none; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .demo-glow,
    .timeline-step.active .ts-marker i,
    .dot-running,
    .output-caret,
    .caret,
    .bullet-item.is-active .bullet-text::after,
    .health-fill,
    .health-marker,
    .ctl-primary.is-pulse-hint {
        animation: none !important;
        transition: none !important;
    }

    .chip { opacity: 1; transform: none; animation: none; }

    .timeline-step { color: var(--text-1); }

    /* Reduced-motion users still get Reset (so they can switch scenarios
       cleanly) and Speed is just a label — only hide Play, which is
       meaningless when nothing animates. */
    #btn-play { display: none; }
}
