/* ===========================
   Retrospective Page Styles
   Layers on top of styles.css
   =========================== */

/* Layout: sidebar + main content */
.retro-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 0;
    position: relative;
    z-index: 1;
}

/* Desktop Sidebar Navigation */
.section-nav {
    position: sticky;
    top: 90px;
    height: fit-content;
    padding-right: 2rem;
}

.section-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-nav li {
    margin-bottom: 0.25rem;
}

.section-nav-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.section-nav-link:hover {
    color: var(--primary-green);
}

.section-nav-link.active {
    color: var(--primary-green);
    border-left-color: var(--primary-green);
    font-weight: 600;
}

/* Mobile Section Bar (hidden on desktop) */
.section-bar {
    display: none;
}

/* Main Content Area */
.retro-main {
    min-width: 0; /* prevent grid blowout */
}

.retro-section {
    margin-bottom: 3rem;
    scroll-margin-top: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.retro-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.retro-section h2 {
    font-size: 2rem;
    color: var(--dark-text);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Summary Card (hero) */
.summary-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 3rem;
    text-align: center;
}

.summary-card h1 {
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.summary-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-green);
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-tldr {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}

/* Content Cards */
.retro-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

.retro-card p {
    color: #444;
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.retro-card p:last-child {
    margin-bottom: 0;
}

/* Product features list */
.product-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.product-features li {
    padding: 0.6rem 0;
    color: #444;
    line-height: 1.6;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.product-features li:last-child {
    border-bottom: none;
}

.product-features strong {
    color: var(--dark-text);
}

/* Callout Boxes */
.callout-box {
    border-left: 4px solid var(--primary-green);
    background: rgba(37, 96, 41, 0.04);
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    border-radius: 0 0.25rem 0.25rem 0;
}

.callout-box p {
    margin-bottom: 0;
    font-style: italic;
    color: #333;
}

/* Architecture Flow Diagram */
.architecture-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 2rem 0;
    flex-wrap: nowrap;
}

.flow-step {
    background: var(--light-bg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    flex: 1;
    max-width: 200px;
    position: relative;
}

.flow-icon {
    background: var(--primary-green);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin: 0 auto 0.75rem;
}

.flow-step h3 {
    font-size: 1rem;
    color: var(--dark-text);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.flow-step p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.flow-tech {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--primary-green);
    background: rgba(37, 96, 41, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-weight: 500;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--primary-green);
    padding: 0 0.75rem;
    font-weight: 700;
}

.arrow-vertical {
    display: none;
}

/* Tech Stack Chips */
.tech-stack-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.chip {
    display: inline-block;
    background: rgba(37, 96, 41, 0.08);
    color: var(--primary-green);
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Interactive Timeline */
.interactive-timeline {
    position: relative;
    padding-left: 40px;
}

.interactive-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-green);
    border-radius: 2px;
}

.timeline-node {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    top: 0.75rem;
    width: 33px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.marker-date {
    background: var(--primary-green);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.35rem 0.4rem;
    border-radius: 1rem;
    min-width: 33px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

.timeline-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1.5rem;
    transition: box-shadow 0.3s ease;
}

.timeline-node.expanded .timeline-content {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.timeline-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
    font-family: inherit;
}

.timeline-trigger h3 {
    font-size: 1.15rem;
    color: var(--dark-text);
    font-weight: 600;
    margin: 0;
}

.timeline-toggle {
    font-size: 1.5rem;
    color: #888;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.timeline-node.expanded .timeline-toggle {
    transform: rotate(90deg);
}

.timeline-preview {
    font-size: 0.95rem;
    color: #666;
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

.timeline-detail {
    display: none;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 1rem;
}

.timeline-node.expanded .timeline-detail {
    display: block;
}

.timeline-detail p {
    color: #444;
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.timeline-detail ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.timeline-detail li {
    color: #444;
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.timeline-detail li strong {
    color: var(--dark-text);
}

.timeline-detail code {
    background: rgba(37, 96, 41, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.9em;
}

.timeline-tools {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
}

/* Decision Tags (timeline key decisions) */
.decision-tag {
    background: rgba(37, 96, 41, 0.06);
    border-left: 4px solid var(--primary-green);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
    border-radius: 0 0.25rem 0.25rem 0;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
}

.decision-tag strong {
    color: var(--primary-green);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.25rem;
}

/* Accordion (Go-to-Market) */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.accordion-item {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 1.25rem 1.5rem;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark-text);
    text-align: left;
    transition: color 0.2s ease;
}

.accordion-trigger:hover {
    color: var(--primary-green);
}

.accordion-toggle {
    font-size: 1.5rem;
    color: #888;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.accordion-item.open .accordion-toggle {
    transform: rotate(90deg);
}

.accordion-content {
    display: none;
    padding: 0 1.5rem 1.5rem;
}

.accordion-item.open .accordion-content {
    display: block;
}

.accordion-content p {
    color: #444;
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

/* Pitfall Cards */
.pitfall-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.pitfall-card {
    display: flex;
    flex-direction: column;
}

.pitfall-card h3 {
    font-size: 1.2rem;
    color: var(--dark-text);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.pitfall-card > p {
    flex: 1;
}

.lesson-callout {
    background: rgba(37, 96, 41, 0.04);
    border-left: 3px solid var(--primary-green);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    border-radius: 0 0.25rem 0.25rem 0;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
}

.lesson-callout strong {
    color: var(--primary-green);
}

/* Shutdown Reasons */
.shutdown-reasons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.reason-card {
    background: var(--light-bg);
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.reason-card h3 {
    font-size: 1.05rem;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.reason-card p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0;
}

.shutdown-closing {
    margin-top: 1rem;
    font-style: italic;
    color: #555;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.skill-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.skill-card h3 {
    font-size: 1.1rem;
    color: var(--dark-text);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Pullquote */
.pullquote {
    border-left: 4px solid var(--primary-green);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-size: 1.15rem;
    font-style: italic;
    color: #333;
    line-height: 1.7;
    background: rgba(37, 96, 41, 0.03);
}

.takeaway-card p {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .retro-section {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .timeline-toggle,
    .accordion-toggle {
        transition: none;
    }

    .timeline-content {
        transition: none;
    }
}

/* ===========================
   Responsive: Tablet
   =========================== */
@media (max-width: 900px) {
    .retro-layout {
        grid-template-columns: 180px 1fr;
    }

    .pitfall-cards {
        grid-template-columns: 1fr;
    }

    .shutdown-reasons {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 2rem;
    }

    .summary-card h1 {
        font-size: 2rem;
    }
}

/* ===========================
   Responsive: Mobile
   =========================== */
@media (max-width: 768px) {
    .retro-layout {
        grid-template-columns: 1fr;
        padding: 1rem 1rem 0;
    }

    /* Hide desktop sidebar */
    .section-nav {
        display: none;
    }

    /* Show mobile section bar */
    .section-bar {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        padding: 0.5rem 1rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        position: sticky;
        top: 0;
        z-index: 10;
        scrollbar-width: none;
    }

    .section-bar::-webkit-scrollbar {
        display: none;
    }

    .section-bar-link {
        flex: 0 0 auto;
        padding: 0.5rem 0.75rem;
        text-decoration: none;
        color: #666;
        font-size: 0.85rem;
        font-weight: 500;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
        transition: color 0.2s ease, border-color 0.2s ease;
    }

    .section-bar-link.active {
        color: var(--primary-green);
        border-bottom-color: var(--primary-green);
        font-weight: 600;
    }

    /* Adjust section scroll offset for mobile bar */
    .retro-section {
        scroll-margin-top: 60px;
    }

    .summary-card {
        padding: 1.5rem;
    }

    .summary-card h1 {
        font-size: 1.75rem;
    }

    .summary-subtitle {
        font-size: 1rem;
    }

    .summary-stats {
        gap: 1rem;
    }

    .stat-item {
        min-width: 120px;
    }

    .retro-section h2 {
        font-size: 1.5rem;
    }

    .retro-card {
        padding: 1.5rem;
    }

    /* Architecture: vertical on mobile */
    .architecture-flow {
        flex-direction: column;
        gap: 0;
    }

    .flow-step {
        max-width: 100%;
    }

    .flow-arrow {
        padding: 0.5rem 0;
    }

    .arrow-horizontal {
        display: none;
    }

    .arrow-vertical {
        display: inline;
    }

    /* Timeline adjustments */
    .interactive-timeline {
        padding-left: 35px;
    }

    .interactive-timeline::before {
        left: 12px;
    }

    .timeline-marker {
        left: -35px;
    }

    .marker-date {
        width: 28px;
        height: 28px;
        font-size: 0.6rem;
    }

    .timeline-content {
        padding: 1rem 1.25rem;
    }

    .timeline-trigger h3 {
        font-size: 1rem;
    }

    /* Skills grid */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Pullquote */
    .pullquote {
        font-size: 1.05rem;
    }
}