@import url('../../branding/variables.css');

/* =========================================
   Reset & Base
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Webkit */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #030303;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #A4F63D;
}

body {
    background-color: #030303;
    /* Match prototype bg */
    color: var(--brand-color-text-primary, #ededed);
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
    /* Relaxed editorial line-height */
    font-size: 18px;
    /* Slightly larger for reading comfort */
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* =========================================
   Typography
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', sans-serif;
    color: var(--brand-color-text-primary, #ededed);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 4rem;
    letter-spacing: -0.04em;
}

h2 {
    font-size: 2.5rem;
    letter-spacing: -0.03em;
    margin-top: 3rem;
}

h3 {
    font-size: 1.75rem;
    color: #A4F63D;
    /* Snap2Flow Lime */
    margin-top: 2rem;
}

p {
    margin-bottom: 1.5rem;
    color: #CCCCCC;
    /* Slightly softer than pure white for reading */
}

a {
    color: #A4F63D;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

a:hover {
    border-bottom-color: #A4F63D;
}

blockquote.editorial {
    font-size: 2rem;
    line-height: 1.4;
    font-weight: 300;
    font-style: italic;
    color: #ededed;
    border-left: 4px solid #A4F63D;
    padding-left: 2rem;
    margin: 3rem 0;
}

/* =========================================
   Layout Structure
   ========================================= */


/* Nav Integration */
.simple-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 5%;
    background: rgba(3, 3, 3, 0.9);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: padding 0.3s ease, background 0.3s ease;
}

.simple-nav.scrolled {
    padding: 1rem 5%;
    background: rgba(3, 3, 3, 0.95);
    /* Slightly more opaque */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.report-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    /* Sidebar | Content */
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    gap: 4rem;
    padding-top: 8rem;
    /* Offset for fixed nav */
}

/* Full Width Hero */
.report-hero-section {
    height: 55vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10%;
    padding-top: 6rem;
    background: radial-gradient(circle at 70% 30%, #1a1a1a 0%, #000000 70%);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-meta {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #A4F63D;
    margin-bottom: 1.5rem;
    display: block;
}

.hero-title {
    font-size: 5rem;
    max-width: 900px;
    background: linear-gradient(180deg, #FFFFFF 0%, #888888 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #888888;
    margin-top: 1.5rem;
    max-width: 600px;
}

/* Sticky Navigation (Table of Contents) */
.sticky-toc {
    position: sticky;
    top: 8rem;
    /* below main nav */
    height: calc(100vh - 8rem);
    padding-left: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: start;
    overflow-y: auto;
    /* Allow scrolling if TOC is long */
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #888888;
    margin-bottom: 2rem;
    opacity: 0.6;
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 1rem;
}

.toc-link {
    display: inline-block;
    color: #888888;
    font-size: 0.95rem;
    padding-left: 1rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.toc-link:hover,
.toc-link.active {
    color: #A4F63D;
    border-left-color: #A4F63D;
    padding-left: 1.5rem;
}

/* Nested TOC Styles */
.toc-sublist {
    list-style: none;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    margin-left: 1rem;
    display: none;
    /* Hidden by default for accordion */
}

.toc-sublist li {
    margin-bottom: 0.5rem;
}

.toc-sublist .toc-link {
    font-size: 0.85rem;
    padding-left: 1rem;
    border-left: none;
    /* Sublinks don't need the heavy border */
    color: #666;
}

.toc-sublist .toc-link:hover,
.toc-sublist .toc-link.active {
    color: #A4F63D;
    padding-left: 1rem;
    /* Don't shift sublinks */
}


/* Main Content Area */
.content-area {
    padding-top: 2rem;
    padding-bottom: 8rem;
    padding-right: 10%;
    /* Breathing room on right */
}

.article-section {
    margin-bottom: 6rem;
    scroll-margin-top: 150px;
    /* Offset for anchor links + nav */
}

/* Text is narrow for readability */
.article-section p,
.article-section ul,
.article-section ol {
    max-width: 700px;
}

/* "Breakout" visual elements that span wider */
.visual-breakout {
    width: 100%;
    margin: 3rem 0;
    padding: 2rem;
    background: #141414;
    border: 1px solid rgba(164, 246, 61, 0.1);
    /* Subtle green border */
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.visual-breakout::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #A4F63D, transparent);
    opacity: 0.5;
}

/* Data Viz Placeholder Support */
.chart-container {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(26, 26, 26, 0.8), #000);
    border-radius: 8px;
    color: #888888;
    font-family: monospace;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Pricing Grid (Fig 5 Replacement) */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: #A4F63D;
}

.pricing-title {
    color: #ededed;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.pricing-amount {
    font-size: 2.5rem;
    color: #A4F63D;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.pricing-sub {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.pricing-desc {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* Timeline Viz (Fig 8 Refinement) */
.timeline-viz {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0;
    width: 100%;
}

.timeline-row {
    position: relative;
    padding-left: 15px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.timeline-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
}

.timeline-time {
    color: #ededed;
    font-weight: 700;
}

.timeline-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.t-step {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: #ccc;
    position: relative;
    border: 1px solid transparent;
}

/* Connectors */
.t-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    color: #444;
    font-size: 10px;
}

/* Friction Steps (Red) */
.t-step.friction {
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

/* Smoothed Steps (Green) */
.t-step.smooth {
    border-color: rgba(164, 246, 61, 0.3);
    color: #A4F63D;
    background: rgba(164, 246, 61, 0.05);
}

.timeline-row.after {
    border-left-color: #A4F63D;
}


/* Impact Statistic (Fig 7 Replacement) */
.impact-stat {
    text-align: center;
    padding: 3rem 1rem;
    background: radial-gradient(circle at center, rgba(164, 246, 61, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
}

.impact-label {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.impact-number {
    font-size: 5rem;
    font-weight: 800;
    color: #A4F63D;
    line-height: 1;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(164, 246, 61, 0.2);
}

.impact-sub {
    font-size: 1.1rem;
    color: #ededed;
    max-width: 400px;
    margin: 0 auto;
}

.impact-context {
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .impact-number {
        font-size: 3.5rem;
    }

    /* Fixed Timeline Mobile Stacking */
    .timeline-steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .t-step {
        width: 100%;
        text-align: center;
    }

    .t-step:not(:last-child)::after {
        content: '↓';
        /* Down arrow for vertical stack */
        right: 50%;
        top: 100%;
        transform: translateX(50%);
        margin-top: 2px;
    }

    /* Comparison Grid (Fig 3) */
    .comparison-grid {
        grid-template-columns: 1fr !important;
        /* Force stack */
        gap: 2rem;
    }

    .comparison-col-left {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 0 !important;
        padding-bottom: 2rem;
    }

    .comparison-col-right {
        padding-left: 0 !important;
    }
}

/* References Section */
.references-section ul {
    font-size: 0.8em;
    /* 20% smaller than body */
    color: rgba(237, 237, 237, 0.6);
    /* Dimmed text */
    line-height: 1.6;
}

.references-section a {
    color: rgba(164, 246, 61, 0.7);
    /* Dimmed link color */
    text-decoration: none;
    transition: color 0.2s ease;
}

.references-section a:hover {
    color: #A4F63D;
    /* Brighten on hover */
}

/* Value Recovery Viz (Fig 7 Refinement) */
.recovery-viz {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem;
    width: 100%;
}

.recovery-row {
    width: 100%;
}

.recovery-labels {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.recovery-title {
    color: #ededed;
    font-weight: 600;
    font-size: 1rem;
}

.recovery-value {
    color: #888;
    font-family: monospace;
    font-size: 1.1rem;
}

.recovery-value.highlight {
    color: #A4F63D;
    font-weight: 700;
}

.recovery-track {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    /* Hatched background to represent "Giveaway/Waste" potential */
    background-image: repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 10px,
            rgba(255, 255, 255, 0.1) 10px,
            rgba(255, 255, 255, 0.1) 20px);
}

.recovery-bar {
    height: 100%;
    background: #A4F63D;
    width: 0%;
    transition: width 1s ease-out;
    box-shadow: 0 0 20px rgba(164, 246, 61, 0.3);
}

.recovery-bar.full {
    width: 100%;
}

.recovery-annotation {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: right;
}


/* =========================================
   Responsive Design (Mobile & Tablet)
   ========================================= */

/* Mobile TOC Toggle Button (Hidden on Desktop) */
.mobile-toc-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1001;
    /* Above nav if needed, or just high */
    background: #A4F63D;
    color: #000;
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(164, 246, 61, 0.3);
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.mobile-toc-toggle:hover {
    transform: scale(1.05);
}

.mobile-toc-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

@media (max-width: 1024px) {

    /* 1. Layout Stacking */
    .report-container {
        grid-template-columns: 1fr;
        /* Single column */
        gap: 2rem;
        padding-top: 6rem;
    }

    .content-area {
        padding-right: 0;
        padding-bottom: 4rem;
        padding: 0 5%;
        /* Add side padding for content */
    }

    /* 2. TOC as Off-Canvas Drawer */
    .sticky-toc {
        position: fixed;
        top: 0;
        left: -100%;
        /* Hidden off-screen */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #0a0a0a;
        z-index: 1002;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 6rem;
        /* Space for items */
        transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sticky-toc.open {
        left: 0;
    }

    /* Overlay when TOC is open */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(2px);
        z-index: 1001;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    body.toc-open {
        overflow: hidden;
        /* Prevent scrolling body */
    }

    body.toc-open::after {
        opacity: 1;
        pointer-events: auto;
    }

    /* Show Mobile Toggle */
    .mobile-toc-toggle {
        display: flex;
    }

    .hero-meta {
        font-size: 0.8rem;
        white-space: normal;
        /* Allow wrapping */
        line-height: 1.4;
    }

    /* 3. Typography Scaling */
    h1.hero-title {
        font-size: 3rem;
    }

    h2 {
        font-size: 2rem;
    }

    .article-section p,
    .article-section ul,
    .article-section ol {
        max-width: 100%;
        /* Use full available width */
    }

    .nav-right {
        display: none;
        /* Hide standard nav items on mobile - assuming hamburger takes over (handled in generic nav, but checking here) */
    }

    /* Note: The base style.css likely handles the main nav responsiveness. 
       We strictly ensure report elements scale. */

    .report-hero-section {
        height: auto;
        min-height: 60vh;
        padding: 6rem 5% 4rem 5%;
    }
}