:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #999999;
    --accent: #e00b1c;
    --accent-light: #ff1a2e;
    --accent-glow: rgba(224, 11, 28, 0.08);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #e00b1c;
    --border: #e0e0e0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.brand-icon {
    color: var(--accent);
    font-size: 1.4rem;
}

.brand-highlight {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-glow);
}

.nav-link.active {
    color: var(--accent-light);
    background: var(--accent-glow);
}

/* PAGES */
.page {
    display: none;
    min-height: 100vh;
    padding-top: 5rem;
}

.page.active {
    display: block;
}

/* HERO */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 5rem);
    padding: 2rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent-light);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #e00b1c 0%, #ff4444 50%, #cc0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 4rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-light);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-flow {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.flow-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.flow-icon {
    font-size: 1.5rem;
}

.flow-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.flow-arrow {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: bold;
}

/* CONTENT PAGES */
.content-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.problem-solution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.problem-card h3 { color: var(--danger); }
.solution-card h3 { color: var(--success); }

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-left: 1.5rem;
    position: relative;
}

.card li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ARCHITECTURE OVERVIEW */
.architecture-overview {
    margin-top: 2rem;
}

.architecture-overview h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.arch-diagram {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.arch-layer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    width: 100%;
    text-align: center;
}

.arch-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.arch-items {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.arch-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
}

.arch-badge.domain { background: rgba(224,11,28,0.08); color: #c50a18; }
.arch-badge.xp { background: rgba(245,158,11,0.08); color: #b37209; }
.arch-badge.bff { background: rgba(16,185,129,0.08); color: #059669; }
.arch-badge.ui { background: rgba(139,92,246,0.08); color: #7c3aed; }
.arch-badge.ai { background: rgba(224,11,28,0.08); color: #c50a18; }
.arch-badge.data { background: rgba(6,150,180,0.08); color: #0e7490; }

.arch-arrow {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.arch-arrow.clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.arch-arrow.clickable:hover {
    color: var(--accent);
}

.skills-tree {
    display: none;
    width: 100%;
    text-align: left;
}

.skills-tree.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.skills-tree pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-secondary);
    overflow-x: auto;
}

/* STEPS */
.steps-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1rem;
}

.step-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.step-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.step-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
}

.step-content .step {
    display: none;
}

.step-content .step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
}

.step-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.step-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.step-body > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.step-example {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.example-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-light);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.code-block {
    background: #f8f8f8;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
}

.code-block pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--accent-glow);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* TRIGGER FLOW */
.trigger-flow {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.trigger-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.trigger-icon {
    font-size: 1.2rem;
}

/* AI ACTIONS */
.ai-actions {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-actions li {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* PM ACTIONS */
.pm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.pm-action {
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.pm-action span {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.pm-action p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pm-action.approve { background: rgba(16,185,129,0.1); }
.pm-action.reject { background: rgba(245,158,11,0.1); }
.pm-action.question { background: rgba(99,102,241,0.1); }

/* OUTPUT CHECKLIST */
.output-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.check-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
}

/* FILE TREE */
.file-tree {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.file-item {
    padding: 0.3rem 0;
    color: var(--text-secondary);
}

.file-item.folder {
    color: var(--accent-light);
    font-weight: 500;
}

/* RESOURCE LIST */
.resource-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.resource-list code {
    background: var(--bg-primary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-light);
}

/* REVIEW OUTCOMES */
.review-outcomes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.outcome {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.outcome.good { background: rgba(16,185,129,0.1); }
.outcome.fix { background: rgba(245,158,11,0.1); }

.outcome-icon {
    font-size: 1.5rem;
}

.outcome strong {
    display: block;
    margin-bottom: 0.25rem;
}

.outcome p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* TECH GRID */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tech-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.tech-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tech-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.tech-table {
    width: 100%;
    border-collapse: collapse;
}

.tech-table td {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.tech-table td:first-child {
    color: var(--text-secondary);
}

.tech-table td:last-child {
    text-align: right;
    color: var(--text-primary);
    font-weight: 500;
}

/* FLOW DIAGRAM */
.tech-architecture {
    margin-bottom: 3rem;
}

.tech-architecture h3 {
    margin-bottom: 1rem;
}

.flow-diagram {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
}

.ascii-art {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    color: var(--text-secondary);
    white-space: pre;
}

/* COST TABLE */
.cost-section h3 {
    margin-bottom: 1rem;
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.cost-table th,
.cost-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.cost-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cost {
    text-align: right !important;
    color: var(--success);
    font-family: 'JetBrains Mono', monospace;
}

.total-row {
    background: var(--accent-glow);
}

.cost-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* TIMELINE */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-marker {
    position: absolute;
    left: -3rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #ffffff;
}

.timeline-marker.phase1 { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.timeline-marker.phase2 { background: #ff4444; }
.timeline-marker.phase3 { background: #cc0000; }
.timeline-marker.phase4 { background: #990000; }
.timeline-marker.phase5 { background: #660000; }

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.phase-badge {
    background: var(--accent-glow);
    color: var(--accent-light);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.phase-duration {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.timeline-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.timeline-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.timeline-content li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 1.2rem;
    position: relative;
}

.timeline-content li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.timeline-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* END PAGE */
.end-page {
    padding-top: 3rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.summary-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.summary-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.next-steps {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 3rem;
}

.next-steps h3 {
    margin-bottom: 1.5rem;
}

.next-list {
    list-style: none;
    counter-reset: next;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.next-list li {
    counter-increment: next;
    padding-left: 2.5rem;
    position: relative;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.next-list li::before {
    content: counter(next);
    position: absolute;
    left: 0;
    width: 28px;
    height: 28px;
    background: var(--accent-glow);
    color: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.closing {
    text-align: center;
    padding: 3rem 0;
}

.closing-quote {
    font-size: 1.5rem;
    font-weight: 600;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.closing-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* BUTTONS */
.view-prompt-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.view-prompt-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--accent-light);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
    .hero-flow { flex-wrap: wrap; }
    .problem-solution { grid-template-columns: 1fr; }
    .tech-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .pm-actions { grid-template-columns: 1fr; }
    .review-outcomes { grid-template-columns: 1fr; }
}
