/* =============================================================================
   ECOSYSTEM.CSS — Full-Width Architecture Diagram + Layered Content
   =============================================================================
   Layout:
   1. .eco-hero            — Hero (uses home.css classes)
   2. .eco-diagram-section — Full-width canvas with tabs above it
   3. .eco-layers-section  — 4 layer cards full-width below the diagram
   4. .data-flow-section   — How the system operates
   5. .why-arch-section    — Problem / Solution / Result cards
   ============================================================================= */

/* Ambient glow removed */
.interactive-ambient-glow { display: none; }

/* =========================
   1. HERO
   ========================= */

.eco-hero {
    /* spacing via .page-hero in layout.css */
}

/* Always-visible hero title — does NOT use home-title to avoid scroll-JS visibility gate */
.eco-page-title {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    color: var(--text-primary);
}

@media (max-width: 1024px) { .eco-page-title { font-size: 3.8rem; } }
@media (max-width: 768px)  { .eco-page-title { font-size: 2.8rem; letter-spacing: -0.03em; } }

/* =========================
   2. DIAGRAM SECTION
   ========================= */

.eco-diagram-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 80px;
}

/* ── Step Tabs ── */
.eco-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--surface-1);
}

.eco-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    color: var(--text-muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.eco-tab:last-child { border-right: none; }

.eco-tab.active {
    background: var(--accent-subtle);
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
}

.eco-tab:hover:not(.active) {
    background: var(--bg-card);
    color: var(--text-secondary);
}

.eco-tab-index {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    color: var(--accent-primary);
    letter-spacing: 0.15em;
    opacity: 0.7;
}

.eco-tab.active .eco-tab-index { opacity: 1; }

.eco-tab-label {
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Canvas Wrapper ── */
.eco-canvas-wrapper {
    width: 100%;
}

.hero-diagram-container {
    width: 100%;
    max-width: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s ease;
    border: 1px solid var(--accent-border);
}

.diagram-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* =========================
   3. LAYER CARDS GRID
   ========================= */

.eco-layers-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 80px;
}

.eco-layers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 0;
}

.eco-layer-card {
    padding: 32px 28px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-top: 3px solid transparent;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease,
                border-left-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.eco-layer-card:hover {
    border-color: var(--border-strong);
    border-top-color: var(--accent-primary);
    transform: translateY(-3px);
    background: var(--bg-card);
}

.eco-layer-card.eco-layer-active {
    border-color: var(--accent-border);
    border-top-color: var(--accent-primary);
    background: var(--accent-subtle);
}

.eco-layer-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eco-layer-index {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--accent-primary);
    letter-spacing: 0.18em;
    opacity: 0.8;
}

.eco-layer-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.eco-layer-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

.eco-layer-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eco-layer-points li {
    font-size: 0.92rem;
    color: var(--text-muted);
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
    cursor: default;
    transition: color 0.15s ease;
}

.eco-layer-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.6;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.eco-layer-points li:hover {
    color: var(--text-primary);
}

.eco-layer-points li:hover::before {
    opacity: 1;
    transform: translateY(-50%) scale(1.4);
}

/* =========================
   4. DATA FLOW LAYOUT
   ========================= */

.data-flow-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.data-flow-container {
    padding: 40px 32px;
    border-radius: 16px;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.flow-pipeline-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
}

.flow-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 16px;
}

.flow-node {
    flex: 1;
    padding: 24px 16px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    text-align: center;
    min-width: 140px;
    position: relative;
    z-index: 2;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.flow-node:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.flow-node strong {
    font-size: 1rem;
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.flow-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: block;
}

.flow-arrow {
    font-size: 1.8rem;
    color: var(--accent-primary);
    opacity: 0.5;
    flex-shrink: 0;
}

.flow-node-primary {
    border-color: var(--accent-border);
    background: var(--accent-subtle);
}

.flow-power-injector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.power-arrow {
    font-size: 1.8rem;
    color: var(--accent-primary);
    opacity: 0.5;
}

.flow-node-power {
    border-color: var(--border-subtle);
    background: var(--surface-1);
    width: 280px;
}

/* Flow arrows animation */
@keyframes flowDrift {
    0%   { transform: translateX(-3px); opacity: 0.3; }
    50%  { transform: translateX(3px); opacity: 0.7; }
    100% { transform: translateX(-3px); opacity: 0.3; }
}

.flow-animate-arrow {
    animation: flowDrift 2.5s infinite ease-in-out;
}

/* =========================
   5. WHY THIS ARCHITECTURE
   ========================= */

.why-arch-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
}

.why-card {
    padding: 36px 28px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.why-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.why-card h4 {
    font-size: 1.3rem;
    margin: 0;
}

.why-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1024px) {
    .eco-layers-grid { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    .eco-tabs { flex-wrap: wrap; }
    .eco-tab { flex: 0 0 50%; border-bottom: 1px solid var(--border-subtle); }
}

@media (max-width: 768px) {
    .flow-pipeline { flex-direction: column; gap: 8px; }
    .flow-arrow { transform: rotate(90deg); margin: 4px 0; }
    .flow-animate-arrow { animation: none; }
    .eco-tab { flex: 0 0 50%; }
    .eco-layer-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .eco-tab { flex: 0 0 100%; border-right: none; }
}
