/* ═══════════════════════════════════════════════
   DOCS — Documentation page styles
   Sidebar layout + content sections
   ═══════════════════════════════════════════════ */

/* ═══ HERO ═══ */
.docs-hero {
    padding: 160px 56px 80px;
    text-align: center;
    background: linear-gradient(180deg, #FAFAF8 0%, #FFFFFF 60%, var(--warm) 100%);
    position: relative;
    overflow: hidden;
}
.docs-hero-ambient {
    position: absolute; top: -100px; left: 50%;
    transform: translateX(-50%);
    width: 900px; height: 900px;
    background: radial-gradient(circle, rgba(0,191,179,0.05) 0%, transparent 60%);
    pointer-events: none;
}
.docs-hero .sec-title { font-size: 52px; }
.docs-hero .sec-text { max-width: 560px; }


/* ═══════════════════════════════════════════════
   SIDEBAR + CONTENT LAYOUT
   ═══════════════════════════════════════════════ */
.docs-layout {
    position: relative;
}

/* ── Sidebar (fixed, not grid) ── */
.docs-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 240px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 32px 0 48px 24px;
    border-right: 1px solid var(--border);
    background: var(--white);
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    transition: opacity 0.3s var(--ease);
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.docs-sidebar-group {
    margin-bottom: 24px;
}
.docs-sidebar-heading {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-4);
    padding: 0 16px;
    margin-bottom: 6px;
}
.docs-sidebar-link {
    display: block;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    border-radius: 8px;
    margin-right: 16px;
    transition: color 0.15s, background 0.15s;
}
.docs-sidebar-link:hover {
    color: var(--ink);
    background: rgba(0,0,0,0.03);
}
.docs-sidebar-link.active {
    color: var(--teal-text);
    background: var(--teal-soft);
    font-weight: 600;
}

/* ── Mobile sidebar toggle ── */
.docs-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 60;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease);
}
.docs-sidebar-toggle svg { width: 20px; height: 20px; }
.docs-sidebar-toggle:hover { transform: scale(1.08); }

/* ── Content area ── */
.docs-content {
    margin-left: 240px;
    min-width: 0;
}


/* ═══════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════ */
.docs-section {
    padding: 80px 56px;
    border-bottom: 1px solid var(--border);
}
.docs-section--alt {
    background: var(--warm);
}
.docs-section:last-child { border-bottom: none; }

.docs-section-title {
    font-family: var(--serif);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin-bottom: 12px;
}
.docs-section-title em {
    font-style: italic;
    color: var(--ink-3);
    font-weight: 500;
}
.docs-section-subtitle {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-3);
    max-width: 560px;
    margin-bottom: 48px;
}
.docs-section-lead {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-3);
    max-width: 640px;
    margin-bottom: 36px;
}


/* ═══════════════════════════════════════════════
   STRATEGY CARDS
   ═══════════════════════════════════════════════ */
.docs-strat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 48px;
}

.docs-card {
    padding: 28px 24px;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}
.docs-section--alt .docs-card { background: var(--white); }
.docs-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--green));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease);
}
.docs-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0,191,179,0.12);
}
.docs-card:hover::before { transform: scaleX(1); }

.docs-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.docs-card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.docs-card-icon svg { width: 20px; height: 20px; }
.docs-card-icon--passive { background: var(--green-soft); color: var(--green); }
.docs-card-icon--active { background: var(--blue-soft); color: var(--blue); }
.docs-card-icon--technical { background: var(--amber-soft); color: var(--amber); }

.docs-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 2px;
}
.docs-card-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.docs-card-badge--passive { background: var(--green-soft); color: var(--green); }
.docs-card-badge--active { background: var(--blue-soft); color: var(--blue); }
.docs-card-badge--technical { background: var(--amber-soft); color: var(--amber); }

.docs-card-text {
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.65;
    margin-bottom: 16px;
}

.docs-card-detail {
    padding: 8px 0;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}
.docs-card-detail-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-4);
    flex-shrink: 0;
    min-width: 80px;
    padding-top: 1px;
}
.docs-card-detail-value {
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.55;
}
.docs-formula {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--navy);
    font-weight: 600;
    background: var(--warm);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}


/* ═══════════════════════════════════════════════
   TAB EXPLANATION BLOCKS
   (Consistent template for Results, Robustness,
    Benchmarking, Efficiency, Verdict, Trades)
   ═══════════════════════════════════════════════ */
.docs-tab-explain,
.docs-tab-elements,
.docs-tab-interpret,
.docs-tab-score {
    margin-bottom: 28px;
}

.docs-tab-question {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--teal-text);
    margin-bottom: 10px;
}

.docs-tab-explain p,
.docs-tab-interpret p {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.7;
    max-width: 680px;
}

/* ── Element list (sub-elements of a tab) ── */
.docs-element-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.docs-element {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    align-items: baseline;
}
.docs-element:first-child { border-top: 1px solid var(--border); }

.docs-element-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.docs-element-weight {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--teal-soft);
    color: var(--teal-text);
}
.docs-element-desc {
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.6;
}
.docs-element-desc a {
    color: var(--teal-text);
    text-decoration: none;
    font-weight: 500;
}
.docs-element-desc a:hover { text-decoration: underline; }

.docs-formula-inline {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--navy);
    background: var(--warm);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ── Colored dots for efficiency frontier ── */
.docs-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.docs-dot--user { background: var(--teal); }
.docs-dot--optimal { background: var(--gold); }
.docs-dot--minvol { background: var(--blue); }


/* ── Score bar (shared across Robustness, Benchmarking, Efficiency) ── */
.docs-tab-score { margin-top: 8px; }
.docs-score-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}
.docs-score-range {
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
}
.docs-score-range span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
    margin-top: 2px;
}
.docs-score-range--low { background: #DC2626; }
.docs-score-range--mid { background: #D97706; }
.docs-score-range--good { background: #059669; }
.docs-score-range--great { background: #00BFB3; }

.docs-score-note {
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.6;
}


/* ═══════════════════════════════════════════════
   METRICS GLOSSARY
   ═══════════════════════════════════════════════ */
.docs-glossary {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 48px;
}

.docs-glossary-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}
.docs-glossary-item:first-child {
    border-top: 1px solid var(--border);
}

.docs-glossary-header {
    margin-bottom: 6px;
}
.docs-glossary-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
    display: inline;
}
.docs-glossary-aka {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-4);
    margin-left: 6px;
}

.docs-glossary-desc {
    font-size: 14px;
    color: var(--ink-3);
    line-height: 1.65;
    margin-bottom: 10px;
    max-width: 680px;
}

.docs-glossary-formula {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    background: var(--warm);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    display: inline-block;
}
.docs-section--alt .docs-glossary-formula {
    background: var(--white);
}

.docs-glossary-ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.docs-interpret-good,
.docs-interpret-neutral,
.docs-interpret-bad {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.docs-interpret-good { background: var(--green-soft); color: var(--green); }
.docs-interpret-neutral { background: var(--amber-soft); color: var(--amber); }
.docs-interpret-bad { background: var(--red-soft); color: var(--red); }


/* ═══════════════════════════════════════════════
   METHODOLOGY STEPS
   ═══════════════════════════════════════════════ */
.docs-method-steps {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.docs-method-step {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.docs-method-step:last-child { border-bottom: none; }

.docs-method-step-num {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.docs-method-step-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}
.docs-method-step-content p {
    font-size: 14px;
    color: var(--ink-3);
    line-height: 1.7;
}

.docs-method-note {
    margin-top: 28px;
    padding: 18px 22px;
    background: var(--amber-soft);
    border-radius: 12px;
    border: 1px solid rgba(217, 119, 6, 0.15);
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.65;
}
.docs-method-note strong { color: var(--amber); }



/* ═══════════════════════════════════════════════
   CTA
   ═══════════════════════════════════════════════ */
.docs-cta {
    padding: 80px 56px;
    background: linear-gradient(170deg, #041828 0%, var(--navy) 50%, #0d3a5c 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.docs-cta::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(0,191,179,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.docs-cta-inner { position: relative; z-index: 1; }
.docs-cta-title {
    font-family: var(--serif);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 12px;
}
.docs-cta-text {
    font-size: 15px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 28px;
}
.docs-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--teal), #059669);
    color: #fff;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    box-shadow: 0 4px 16px rgba(0,191,179,0.3);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.docs-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,191,179,0.4);
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .docs-hero { padding: 140px 32px 60px; }
    .docs-hero .sec-title { font-size: 40px; }

    .docs-sidebar {
        display: none;
        width: 280px;
        z-index: 80;
        box-shadow: var(--shadow-xl);
        padding: 24px 0 48px 16px;
    }
    .docs-sidebar.open { display: block; }
    .docs-content { margin-left: 0; }
    .docs-sidebar-toggle { display: flex; }

    /* Overlay behind sidebar */
    .docs-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 79;
    }
    .docs-sidebar-overlay.open { display: block; }

    .docs-section { padding: 64px 32px; }
    .docs-section-title { font-size: 30px; }
    .docs-strat-grid { grid-template-columns: repeat(2, 1fr); }

    .docs-element { grid-template-columns: 180px 1fr; }

    .docs-cta { padding: 64px 32px; }
    .docs-cta-title { font-size: 30px; }
}

@media (max-width: 640px) {
    .docs-hero { padding: 120px 20px 48px; }
    .docs-hero .sec-title { font-size: 32px; }

    .docs-sidebar { width: 260px; padding: 20px 0 40px 12px; }

    .docs-section { padding: 48px 20px; }
    .docs-section-title { font-size: 26px; }
    .docs-strat-grid { grid-template-columns: 1fr; }

    .docs-element {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .docs-score-bar { grid-template-columns: repeat(2, 1fr); }

    .docs-method-step { flex-direction: column; gap: 10px; }
    .docs-method-step-num { width: 36px; height: 36px; font-size: 14px; }

    .docs-cta { padding: 48px 20px; }
    .docs-cta-title { font-size: 26px; }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
    .rv { transition: none; animation: none; opacity: 1; transform: none; }
    .docs-card, .docs-cta-btn, .docs-sidebar-link, .docs-sidebar-toggle { transition: none; }
}
