/* =============================================================
   global.css - Single source of truth for all design system CSS
   Extracted from system-design-old inline <style> blocks.
   This file is imported once in BaseLayout.astro.
   ============================================================= */

:root {
    color-scheme: light;
    /* Light theme - coffee shop morning */
    --bg-page: #f5efe6;
    --bg-card: #ebe0d1;
    --text-main: #2b1d14;
    --text-muted: #6b4f3a;
    --accent: #8b4513;
    --highlight: #c97b3c;
    --border: #d4c4b0;
    --shadow: rgba(43, 29, 20, 0.08);
    --shadow-strong: rgba(43, 29, 20, 0.15);
    --grain-opacity: 0.04;
    --content-max-width: 920px;
    --reading-max-width: 920px;
    /* Semantic: cache outcome colors */
    --cache-yes-bg: #d4edda;
    --cache-yes-border: #6abf7b;
    --cache-no-bg: #f8d7da;
    --cache-no-border: #e07a82;
}

[data-theme="dark"] {
    color-scheme: dark;
    /* Dark theme - late night coffee */
    --bg-page: #3B3030;
    --bg-card: #664343;
    --text-main: #FFF0D1;
    --text-muted: #d4b896;
    --accent: #FFF0D1;
    --highlight: #e89b5c;
    --border: #795757;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-strong: rgba(0, 0, 0, 0.5);
    --grain-opacity: 0.06;
    /* Semantic: cache outcome colors */
    --cache-yes-bg: #1a3a22;
    --cache-yes-border: #4a9b5e;
    --cache-no-bg: #3a1a1e;
    --cache-no-border: #c05060;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 110%; /* 1rem = 18px; scales all rem-based sizing up for readability */
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Hind Siliguri', sans-serif;
    line-height: 1.55;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Subtle coffee grain texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 20% 30%, var(--text-muted) 0%, transparent 1px),
    radial-gradient(circle at 80% 70%, var(--text-muted) 0%, transparent 1px),
    radial-gradient(circle at 45% 50%, var(--text-muted) 0%, transparent 1px);
    background-size: 80px 80px, 120px 120px, 60px 60px;
    opacity: var(--grain-opacity);
    z-index: 1;
}

.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

/* Logo page: fill the viewport so the footer sits at the bottom */
.container-fill {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 118px);
}

.container-fill footer {
    margin-top: auto;
    border-top: 1px dashed var(--border);
}

/* ===== NAV ===== */
nav {
    position: sticky;
    top: 0;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 24px;
    min-height: 38px;
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.theme-toggle-track {
    position: relative;
    box-sizing: border-box;
    width: 60px;
    height: 30px;
    border-radius: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7px;
    transition: border-color 0.3s ease;
}

.theme-toggle-track svg {
    width: 15px;
    height: 15px;
    position: relative;
    z-index: 1;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.theme-toggle-thumb {
    position: absolute;
    top: 50%;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--highlight);
    transform: translateY(-50%);
    transition: transform 0.3s ease, background 0.3s ease;
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateY(-50%) translateX(30px);
}

/* The icon sitting under the thumb contrasts with it; the inactive icon stays muted */
.theme-toggle .icon-sun {
    color: var(--bg-card);
}

.theme-toggle .icon-moon {
    color: var(--text-muted);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    color: var(--text-muted);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    color: var(--bg-card);
}

.theme-toggle:hover .theme-toggle-track {
    border-color: var(--highlight);
}

.logo {
    font-family: 'Tiro Bangla', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--highlight);
}

/* ===== STICKY SESSION META ===== */
.session-meta {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--bg-page);
    border-bottom: 1px dashed var(--border);
    padding: 10px 0;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.session-meta-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.session-meta-spacer {
    height: 52px;
}

.breadcrumb {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.session-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 500;
    line-height: 1.2;
    flex-shrink: 0;
}

[data-theme="dark"] .session-tag {
    border-color: var(--text-main);
}

/* ===== HERO (home page) ===== */
.hero {
    padding: 24px 0 32px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 24px;
    position: relative;
}

.hero h1 {
    font-family: 'Tiro Bangla', serif;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    line-height: 1.15;
    font-weight: 400;
    margin-bottom: 14px;
    letter-spacing: -1px;
}

.hero h1 .accent-word {
    color: var(--accent);
    font-style: italic;
    position: relative;
    display: inline-block;
}

.hero h1 .accent-word::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--highlight);
    opacity: 0.3;
    z-index: -1;
    animation: draw-underline 0.8s ease 0.6s backwards;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 0;
}

.hero-banner {
    width: 80%;
    margin: 28px auto 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 8px 24px var(--shadow);
    position: relative;
    aspect-ratio: 16 / 9;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--shadow-strong);
}

.hero-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    user-select: none;
    object-position: top;
}

.hero-banner-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 20px 12px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
    color: #FFF0D1;
    font-family: 'Tiro Bangla', serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ===== SECTIONS (home page) ===== */
section {
    padding: 24px 0;
    position: relative;
    max-width: var(--reading-max-width);
}

section.hero {
    padding: 24px 0 16px;
}

.section-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--highlight);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: dash-grow 0.6s ease backwards;
}

.section-label::before {
    content: '';
    width: 32px;
    height: 1.5px;
    background: var(--highlight);
    animation: dash-grow 0.6s ease backwards;
}

/* ===== WHAT IS GRID (home) ===== */
.what-is-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.what-is-text p {
    margin-bottom: 14px;
}

.quote-card {
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    padding: 20px 22px;
    border-radius: 0 12px 12px 0;
    font-family: 'Tiro Bangla', serif;
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.5;
    color: var(--text-main);
    position: relative;
    box-shadow: 0 4px 12px var(--shadow);
}

.quote-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 5rem;
    color: var(--highlight);
    opacity: 0.4;
    font-family: serif;
    line-height: 1;
}

.quote-author {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: normal;
}

/* ===== PILLARS (home) ===== */
.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.pillar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 18px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pillar::before {
    content: attr(data-num);
    position: absolute;
    top: -10px;
    right: 8px;
    font-family: 'Tiro Bangla', serif;
    font-size: 4rem;
    color: var(--highlight);
    opacity: 0.15;
    line-height: 1;
}

.pillar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--highlight), transparent);
    transition: left 0.6s ease;
}

.pillar:hover::after {
    left: 100%;
}

.pillar:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-strong);
    border-color: var(--accent);
}

.pillar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    color: var(--highlight);
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pillar-icon svg {
    width: 20px;
    height: 20px;
}

.pillar:hover .pillar-icon {
    color: var(--accent);
    border-color: var(--highlight);
    transform: rotate(-4deg);
}

.pillar h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--accent);
}

.pillar p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== ARTICLE HEADER (session/stage pages) ===== */
.article-header {
    padding: 24px 0 16px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 20px;
}

h1 {
    font-family: 'Tiro Bangla', serif;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    line-height: 1.2;
    font-weight: 500;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
    animation: fadeUp 0.6s ease 0.15s backwards;
}

.goal-box {
    background: var(--bg-card);
    border-left: 4px solid var(--highlight);
    padding: 14px 18px;
    border-radius: 0 12px 12px 0;
    margin-top: 16px;
    font-size: 0.96rem;
    animation: fadeUp 0.6s ease 0.3s backwards, border-pulse 3.5s ease-in-out 1s infinite;
}

.goal-box strong {
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
    font-family: 'Tiro Bangla', serif;
    font-size: 1.05rem;
}

.article-banner {
    width: 80%;
    margin: 20px auto 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    line-height: 0;
    box-shadow: 0 8px 24px var(--shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.article-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--shadow-strong);
}

.article-banner img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

/* ===== CONTENT ===== */
article,
.article-header {
    max-width: var(--reading-max-width);
}

article {
    padding-bottom: 0;
}

h2 {
    font-family: 'Tiro Bangla', serif;
    font-size: clamp(1.35rem, 2.8vw, 1.7rem);
    font-weight: 500;
    margin: 36px 0 12px;
    letter-spacing: -0.3px;
    color: var(--text-main);
    line-height: 1.3;
}

h2 .section-num-inline {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 0.95em;
    font-weight: 700;
    color: var(--highlight);
    letter-spacing: 0;
    margin-right: 14px;
    position: relative;
    white-space: nowrap;
}

h2 .section-num-inline::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--highlight);
    margin-left: 10px;
    margin-bottom: 3px;
    vertical-align: middle;
    animation: pulse-dot 1.8s ease-in-out infinite;
}

h2:first-of-type {
    margin-top: 0;
}

h3 {
    font-family: 'Tiro Bangla', serif;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 18px 0 8px;
    color: var(--accent);
}

h4 {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 12px 0 4px;
    color: var(--text-main);
}

p {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 0.98rem;
}

strong {
    color: var(--accent);
    font-weight: 600;
}

ul, ol {
    margin: 0 0 12px 24px;
    color: var(--text-main);
    padding-left: 8px;
}

li {
    margin-bottom: 4px;
    font-size: 0.98rem;
    padding-left: 6px;
}

ul li::marker {
    color: var(--highlight);
}

ol li::marker {
    color: var(--highlight);
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 700;
}

/* ===== STORY / QUOTE BOX ===== */
.story-box {
    background: var(--bg-card);
    padding: 14px 18px;
    border-radius: 10px;
    margin: 14px 0;
    font-family: 'Tiro Bangla', serif;
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.5;
    border-left: 4px solid var(--accent);
    position: relative;
    animation: story-shimmer 4s ease-in-out infinite;
}

.callout {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 14px 0;
    position: relative;
}

.callout-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: 'Tiro Bangla', serif;
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.4;
}

.callout-title::before {
    content: '';
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    background-color: var(--highlight);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2 L13.5 10 L22 12 L13.5 14 L12 22 L10.5 14 L2 12 L10.5 10 Z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2 L13.5 10 L22 12 L13.5 14 L12 22 L10.5 14 L2 12 L10.5 10 Z'/></svg>");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    display: inline-block;
    align-self: center;
    animation: heartbeat 3.2s ease-in-out infinite;
    transform-origin: left center;
}

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

/* ===== FLOW DIAGRAM ===== */
.flow {
    margin: 18px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.flow-step {
    display: flex;
    gap: 16px;
    align-items: stretch;
    position: relative;
}

.flow-step + .flow-step {
    margin-top: 6px;
}

.flow-step-standalone {
    gap: 0;
}

.flow-step-num {
    flex-shrink: 0;
    width: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.flow-num-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--highlight);
    color: var(--accent);
    font-family: 'Tiro Bangla', serif;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.flow-step:hover .flow-num-circle {
    background: var(--highlight);
    color: var(--bg-page);
    transform: scale(1.08);
}

.flow-connector {
    flex: 1;
    width: 2px;
    background: var(--border);
    min-height: 16px;
    position: relative;
}

.flow-connector::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--border);
}

.flow-step:last-child .flow-connector {
    display: none;
}

.flow-step-content {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.flow-step:hover .flow-step-content {
    border-color: var(--highlight);
    transform: translateX(2px);
}

.flow-step-title {
    font-family: 'Tiro Bangla', serif;
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.flow-step-body {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-main);
    font-family: 'Hind Siliguri', sans-serif;
}

.flow-box {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
}

.flow-arrow {
    color: var(--highlight);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.flow-step-note {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== SIDE-BY-SIDE FLOW COMPARISON ===== */
.flow-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0;
}

.flow-compare-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flow-compare-bad {
    border-color: rgba(180, 80, 60, 0.4);
}

.flow-compare-good {
    border-color: rgba(76, 145, 80, 0.5);
}

.flow-compare-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.flow-compare-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Hind Siliguri', sans-serif;
    line-height: 1.5;
}

.compare-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.flow-compare-badge.bad {
    background: rgba(180, 80, 60, 0.18);
    color: #b8503c;
    border: 1px solid rgba(180, 80, 60, 0.4);
}

[data-theme="dark"] .flow-compare-badge.bad {
    background: rgba(220, 120, 100, 0.2);
    color: #e8a090;
}

.flow-compare-badge.good {
    background: rgba(76, 145, 80, 0.18);
    color: #4c9150;
    border: 1px solid rgba(76, 145, 80, 0.5);
}

[data-theme="dark"] .flow-compare-badge.good {
    background: rgba(120, 180, 130, 0.2);
    color: #8fc090;
    border-color: rgba(120, 180, 130, 0.5);
}

.flow-compare-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: 'Hind Siliguri', sans-serif;
}

.flow-compare-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.flow-compare-box {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.88rem;
    text-align: center;
    color: var(--text-main);
    font-family: 'Hind Siliguri', sans-serif;
    min-width: 60%;
}

.flow-compare-box.highlight {
    background: var(--bg-card);
    border-color: var(--highlight);
    color: var(--accent);
    font-weight: 600;
}

.flow-compare-arrow {
    color: var(--highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.flow-compare-arrow svg {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.flow-compare-note {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* ===== ARCHITECTURE DIAGRAM (SVG) ===== */
.arch-diagram {
    margin: 22px 0 24px;
    padding: 18px 16px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 14px var(--shadow);
}

.arch-diagram svg {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    font-family: 'Hind Siliguri', sans-serif;
}

.arch-caption {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
}

/* ── Decision flowchart (dc-*) ── */
.dc-start-box rect {
    fill: var(--accent);
}

.dc-start-box text {
    fill: var(--bg-page);
}

.dc-question-box rect {
    fill: var(--bg-page);
    stroke: var(--border);
    stroke-width: 1.5;
}

.dc-question-box text {
    fill: var(--text-main);
}

.dc-nocache-box rect {
    fill: var(--cache-no-bg);
    stroke: var(--cache-no-border);
    stroke-width: 1.5;
}

.dc-nocache-box text {
    fill: var(--text-muted);
}

.dc-cachehard-box rect {
    fill: var(--cache-yes-bg);
    stroke: var(--cache-yes-border);
    stroke-width: 1.5;
}

.dc-cachehard-box text {
    fill: var(--text-main);
}

.dc-cacheshort-box rect {
    fill: var(--cache-yes-bg);
    stroke: var(--cache-yes-border);
    stroke-width: 1.5;
}

.dc-cacheshort-box text {
    fill: var(--text-main);
}

.dc-reconsider-box rect {
    fill: var(--cache-no-bg);
    stroke: var(--cache-no-border);
    stroke-width: 1.5;
}

.dc-reconsider-box text {
    fill: var(--text-muted);
}

.dc-hidden-box rect {
    fill: var(--bg-card);
    stroke: var(--highlight);
    stroke-width: 1.5;
    stroke-dasharray: 6 3;
}

.dc-hidden-box text {
    fill: var(--text-main);
}

.dc-connector {
    stroke: var(--text-muted);
    stroke-width: 1.5;
    fill: none;
    color: var(--text-muted);
}

.dc-separator {
    stroke: var(--border);
    stroke-width: 1;
}

.dc-branch-label {
    fill: var(--text-muted);
    font-size: 13px;
}

.dc-box-title, .dc-q-title, .dc-result-title, .dc-hidden-title {
    font-size: 14px;
    font-weight: 600;
}

.dc-box-sub, .dc-q-sub, .dc-result-sub, .dc-hidden-sub {
    font-size: 12px;
}

.arch-band {
    fill: var(--bg-page);
    opacity: 0.55;
}

[data-theme="dark"] .arch-band {
    fill: var(--bg-page);
    opacity: 0.35;
}

.arch-band-label {
    fill: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.arch-user circle, .arch-user path {
    fill: var(--text-muted);
    stroke: none;
}

.arch-user-label {
    fill: var(--text-muted);
    font-size: 13px;
    text-anchor: middle;
}

.arch-node rect {
    fill: var(--bg-card);
    stroke: var(--border);
    stroke-width: 1.5;
}

.arch-node-title {
    fill: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    text-anchor: middle;
    font-family: 'Tiro Bangla', serif;
}

.arch-node-sub {
    fill: var(--text-muted);
    font-size: 12px;
    text-anchor: middle;
}

.arch-node-sub-strong {
    fill: var(--accent);
    font-weight: 600;
    font-size: 13px;
}

.arch-node-hint {
    fill: var(--text-muted);
    font-size: 11px;
    text-anchor: middle;
    font-style: italic;
}

.arch-node-lb rect {
    fill: var(--bg-page);
    stroke: var(--highlight);
    stroke-width: 1.8;
}

.arch-node-passive rect {
    stroke-dasharray: 4 3;
    opacity: 0.78;
}

.arch-node-web rect {
    fill: var(--bg-page);
    stroke: var(--accent);
    stroke-width: 1.8;
}

.arch-node-db ellipse, .arch-node-db path {
    fill: var(--bg-page);
    stroke: var(--accent);
    stroke-width: 1.8;
}

.arch-node-db .arch-db-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1;
    opacity: 0.6;
}

.arch-node-cache rect {
    fill: var(--bg-page);
    stroke: var(--highlight);
    stroke-width: 1.8;
}

.arch-arrow {
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
    opacity: 0.85;
}

.arch-arrow-standby {
    stroke-dasharray: 3 4;
    opacity: 0.35;
}

.arch-arrow-session {
    stroke: var(--highlight);
    opacity: 0.75;
    stroke-width: 2;
}

.arch-arrowhead {
    fill: var(--text-muted);
    opacity: 0.9;
}

.arch-arrowhead-session {
    fill: var(--highlight);
    opacity: 0.8;
}

.arch-replication {
    stroke: var(--highlight);
    stroke-width: 1.8;
    stroke-dasharray: 5 4;
    fill: none;
    opacity: 0.7;
}

.arch-arrow-dashed {
    stroke-dasharray: 4 4;
}

.arch-heartbeat {
    stroke: var(--highlight);
    stroke-width: 1.6;
    stroke-dasharray: 3 3;
    fill: none;
    opacity: 0.8;
}

.arch-hint {
    fill: var(--text-muted);
    font-size: 11px;
    font-style: italic;
}

.arch-badge text {
    font-size: 13px;
    font-weight: 700;
    font-family: 'Hind Siliguri', sans-serif;
    letter-spacing: 0.3px;
}

.arch-badge-good rect {
    fill: rgba(76, 145, 80, 0.25);
    stroke: #4c9150;
    stroke-width: 1.8;
}

.arch-badge-good text {
    fill: #357a3a;
    font-weight: 700;
    letter-spacing: 1px;
}

[data-theme="dark"] .arch-badge-good rect {
    fill: rgba(120, 180, 130, 0.3);
    stroke: #8fc090;
}

[data-theme="dark"] .arch-badge-good text {
    fill: #a8d4a8;
}

.arch-badge-bad rect {
    fill: rgba(201, 123, 60, 0.18);
    stroke: var(--highlight);
    stroke-width: 1.8;
}

.arch-badge-bad text {
    fill: var(--accent);
    font-weight: 700;
    letter-spacing: 1px;
}

[data-theme="dark"] .arch-badge-bad rect {
    fill: rgba(232, 155, 92, 0.18);
    stroke: var(--highlight);
}

[data-theme="dark"] .arch-badge-bad text {
    fill: var(--highlight);
}

.arch-mini svg {
    max-width: 600px;
    margin: 0 auto;
}

.arch-combo-box {
    fill: var(--bg-page);
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 6 4;
}

.arch-combo-label {
    fill: var(--text-muted);
    font-size: 11px;
    text-anchor: middle;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.arch-inner-box {
    fill: var(--bg-card);
    stroke: var(--border);
    stroke-width: 1;
}

.arch-inner-web {
    stroke: var(--accent);
}

.arch-inner-db {
    stroke: var(--accent);
}

.arch-mini-db-top {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1;
    opacity: 0.5;
}

.arch-node-mystery rect {
    fill: var(--bg-page);
    stroke: var(--highlight);
    stroke-width: 2;
    stroke-dasharray: 5 4;
}

.arch-mystery-text {
    font-size: 22px;
    font-weight: 700;
    fill: var(--highlight);
    letter-spacing: 4px;
}

/* ===== QUESTION CHAIN BLOCK ===== */
.question-chain {
    margin: 22px 0 28px;
    padding: 18px 18px 14px;
    background: var(--bg-card);
    border-left: 3px solid var(--highlight);
    border-radius: 0 10px 10px 0;
    box-shadow: 0 2px 8px var(--shadow);
}

.question-chain .qc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.question-chain .qc-item {
    position: relative;
    padding: 6px 10px 6px 38px;
    line-height: 1.55;
    color: var(--text-main);
    font-size: 0.92rem;
}

.question-chain .qc-num {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-page);
    border: 1.3px solid var(--highlight);
    color: var(--highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    z-index: 2;
}

.question-chain .qc-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 11.35px;
    top: calc(50% + 12px);
    width: 1.3px;
    height: calc(50% - 12px + 6px);
    background: var(--highlight);
    opacity: 0.4;
    z-index: 1;
}

/* ===== GROWTH STAGES ===== */
.growth-stages {
    margin: 22px 0 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.growth-stage {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 6px var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.growth-stage:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.growth-stage-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--highlight);
    color: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Tiro Bangla', serif;
    font-size: 1.05rem;
    font-weight: 700;
}

[data-theme="dark"] .growth-stage-num {
    color: #2b1d14;
}

.growth-stage-content {
    flex: 1;
    min-width: 0;
}

.growth-stage-title {
    font-family: 'Tiro Bangla', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.growth-stage-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.growth-stage-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.growth-stage-flow .flow-box {
    background: var(--bg-page);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text-main);
}

.growth-stage-flow .flow-arrow {
    display: inline-flex;
    align-items: center;
    color: var(--highlight);
    opacity: 0.7;
}

.growth-stage-flow .flow-arrow svg {
    width: 14px;
    height: 14px;
}

/* ===== SESSION BANNER IMAGES ===== */
.session-banner {
    margin: 28px auto 26px;
    width: 80%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-card);
}

.session-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top;
}

.session-banner-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 20px 12px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
    color: #FFF0D1;
    font-family: 'Tiro Bangla', serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.session-end-banner {
    margin: 32px 0 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow);
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-card);
}

.session-end-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.session-end-banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 24px 24px;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

.session-end-banner-text {
    color: #FFF0D1;
    font-family: 'Tiro Bangla', serif;
    font-style: italic;
    font-size: 1.1rem;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    max-width: 560px;
    line-height: 1.4;
}

/* ===== STATUS BOXES ===== */
.status-box {
    margin: 18px 0;
    padding: 14px 18px 8px;
    border-radius: 10px;
    border: 1.5px dashed;
}

.status-box-title {
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 1.5px dashed;
    font-family: 'Tiro Bangla', serif;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.status-box ul {
    margin: 0;
    padding-left: 8px;
}

.status-box ul li {
    color: var(--text-main);
}

.status-box-done {
    background: rgba(76, 145, 80, 0.06);
    border-color: rgba(76, 145, 80, 0.55);
}

.status-box-done .status-box-title {
    color: #4c9150;
    border-bottom-color: rgba(76, 145, 80, 0.4);
}

.status-box-done ul li::marker {
    color: #4c9150;
}

[data-theme="dark"] .status-box-done {
    background: rgba(120, 180, 130, 0.08);
    border-color: rgba(120, 180, 130, 0.55);
}

[data-theme="dark"] .status-box-done .status-box-title {
    color: #8fc090;
    border-bottom-color: rgba(120, 180, 130, 0.4);
}

[data-theme="dark"] .status-box-done ul li::marker {
    color: #8fc090;
}

.status-box-broken {
    background: rgba(201, 123, 60, 0.08);
    border-color: var(--highlight);
}

.status-box-broken .status-box-title {
    color: var(--accent);
    border-bottom-color: rgba(201, 123, 60, 0.45);
}

.status-box-broken ul li::marker {
    color: var(--highlight);
}

[data-theme="dark"] .status-box-broken {
    background: rgba(232, 155, 92, 0.1);
    border-color: var(--highlight);
}

[data-theme="dark"] .status-box-broken .status-box-title {
    color: var(--highlight);
    border-bottom-color: rgba(232, 155, 92, 0.45);
}

[data-theme="dark"] .status-box-broken ul li::marker {
    color: var(--highlight);
}

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
    margin: 14px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    overflow: hidden;
}

thead {
    background: var(--accent);
}

thead th {
    color: var(--bg-page);
    text-align: left;
    padding: 14px 18px;
    font-family: 'Tiro Bangla', serif;
    font-weight: 500;
    font-size: 0.98rem;
}

[data-theme="dark"] thead {
    background: var(--bg-page);
}

[data-theme="dark"] thead th {
    color: var(--highlight);
    border-bottom: 1px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease, transform 0.2s ease;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: top;
}

tbody tr:nth-child(even) {
    background: var(--bg-page);
}

tbody tr:hover,
tbody tr:nth-child(even):hover {
    background: rgba(201, 123, 60, 0.18) !important;
    transform: translateX(4px);
}

[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] tbody tr:nth-child(even):hover {
    background: rgba(232, 155, 92, 0.18) !important;
}

/* ===== STAGE SESSION TABLE ===== */
.stage-sessions {
    margin: 18px 0 6px;
    border: none;
    box-shadow: none;
    overflow: visible;
    border-radius: 0;
}

.stage-sessions table {
    background: transparent;
    border-collapse: separate;
    border-spacing: 0;
}

.stage-sessions thead {
    background: transparent;
}

.stage-sessions thead th {
    color: var(--text-muted);
    background: transparent;
    border-bottom: 2px dotted var(--border);
    padding: 10px 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 0.78rem;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 600;
}

[data-theme="dark"] .stage-sessions thead th {
    color: var(--text-muted);
    border-bottom: 2px dotted var(--border);
}

.stage-sessions tbody tr {
    background: transparent;
    border-bottom: 1px dotted var(--border);
    transition: background 0.2s ease;
}

.stage-sessions tbody tr:nth-child(even) {
    background: transparent;
}

.stage-sessions tbody tr:hover {
    background: rgba(201, 123, 60, 0.08) !important;
    transform: none;
}

.stage-sessions tbody td {
    padding: 14px 14px;
    vertical-align: top;
    border-right: 1px dotted var(--border);
    line-height: 1.55;
}

.stage-sessions tbody td:last-child {
    border-right: none;
}

.stage-sessions .col-num {
    width: 70px;
    color: var(--highlight);
    font-family: 'Tiro Bangla', serif;
    font-size: 1.05rem;
    font-weight: 500;
    white-space: nowrap;
}

.stage-sessions .col-title {
    width: 32%;
}

.stage-sessions .session-title-link {
    color: var(--accent);
    font-family: 'Tiro Bangla', serif;
    font-size: 1.05rem;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted transparent;
    transition: border-color 0.2s ease;
}

.stage-sessions .session-title-link:hover {
    border-bottom-color: var(--accent);
}

.stage-sessions .session-title-text {
    color: var(--text-main);
    font-family: 'Tiro Bangla', serif;
    font-size: 1.05rem;
    font-weight: 500;
    opacity: 0.7;
}

.stage-sessions .col-goal {
    color: var(--text-main);
    font-size: 0.95rem;
}

.stage-sessions .status-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 600;
    margin-left: 6px;
    line-height: 1.5;
    vertical-align: middle;
}

.stage-sessions .status-done {
    background: rgba(76, 145, 80, 0.18);
    color: #4c9150;
    border: 1px solid rgba(76, 145, 80, 0.5);
}

[data-theme="dark"] .stage-sessions .status-done {
    background: rgba(120, 180, 130, 0.2);
    color: #8fc090;
    border-color: rgba(120, 180, 130, 0.5);
}

.stage-sessions .status-next {
    background: rgba(201, 123, 60, 0.18);
    color: var(--accent);
    border: 1px solid var(--highlight);
}

[data-theme="dark"] .stage-sessions .status-next {
    color: var(--highlight);
}

.stage-sessions .status-soon {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

/* ===== STAGE INTRO ===== */
.stage-intro {
    margin: 18px 0 30px;
    padding: 18px 22px;
    background: var(--bg-card);
    border-left: 4px solid var(--highlight);
    border-radius: 0 10px 10px 0;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-main);
}

.stage-intro p {
    margin-bottom: 10px;
}

.stage-intro p:last-child {
    margin-bottom: 0;
}

.stage-intro .stage-tagline {
    font-family: 'Tiro Bangla', serif;
    font-style: italic;
    font-size: 1.08rem;
    color: var(--accent);
}

/* ===== CODE BLOCK ===== */
.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 14px 0;
    font-family: 'JetBrains Mono', 'Hind Siliguri', monospace;
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}

.code-block::after {
    content: '▍';
    color: var(--highlight);
    animation: cursor-blink 1s steps(1) infinite;
    margin-left: 4px;
}

/* Inline token highlight inside a .code-block */
.code-hl {
    background: var(--highlight);
    color: var(--bg-page);
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

/* ===== Q&A BLOCKS ===== */
.qa-block {
    margin: 18px 0;
    padding: 16px 18px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.qa-question {
    font-family: 'Tiro Bangla', serif;
    font-size: 1.08rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 10px;
    padding-left: 30px;
    position: relative;
}

.qa-question::before {
    content: 'প্র';
    position: absolute;
    left: 0;
    top: 2px;
    width: 22px;
    height: 22px;
    background: var(--highlight);
    color: var(--bg-page);
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 600;
}

.qa-block:hover .qa-question::before {
    animation: question-bounce 0.6s ease;
}

/* ===== COLLAPSIBLE ANSWER ===== */
.answer-toggle {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-page);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.answer-toggle[open] {
    border-color: var(--accent);
}

.answer-toggle summary {
    padding: 10px 16px;
    cursor: pointer;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 500;
    color: var(--accent);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    transition: background 0.2s ease;
}

.answer-toggle summary::-webkit-details-marker {
    display: none;
}

.answer-toggle summary:hover {
    background: var(--bg-card);
}

.answer-toggle summary::before {
    content: '▶';
    color: var(--highlight);
    font-size: 0.7rem;
    transition: transform 0.25s ease, color 0.3s ease;
    display: inline-block;
}

.answer-toggle[open] summary::before {
    transform: rotate(90deg);
}

.answer-toggle:not([open]) summary:hover::before {
    color: var(--accent);
    transform: translateX(2px);
}

.answer-toggle summary .toggle-hint {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.answer-toggle .answer-body {
    padding: 8px 16px 14px;
    border-top: 1px dashed var(--border);
    animation: slide-down 0.35s ease;
}

.answer-toggle .answer-body p:last-child,
.answer-toggle .answer-body ul:last-child,
.answer-toggle .answer-body ol:last-child {
    margin-bottom: 0;
}

.answer-toggle .answer-body h4 {
    color: var(--highlight);
    font-weight: 600;
    border-left: 2.5px solid var(--highlight);
    border-radius: 0 6px 6px 0;
    background: linear-gradient(90deg, rgba(201, 123, 60, 0.12) 0%, transparent 80%);
    padding: 6px 10px;
    margin: 18px 0 10px;
    font-size: 0.98rem;
}

[data-theme="dark"] .answer-toggle .answer-body h4 {
    background: linear-gradient(90deg, rgba(232, 155, 92, 0.1) 0%, transparent 80%);
}

.answer-toggle .answer-body h4:first-child {
    margin-top: 4px;
}

.qa-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    display: block;
}

/* ===== SUMMARY BOX ===== */
.summary-box {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-page));
    border: 2px solid var(--highlight);
    border-radius: 14px;
    padding: 20px 22px;
    margin: 18px 0;
    animation: summary-border 4s ease-in-out infinite;
}

.summary-box h3 {
    margin-top: 0;
    color: var(--accent);
}

.summary-box ol {
    margin-bottom: 0;
}

/* ===== NAVIGATION FOOTER ===== */
.session-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.nav-card {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

.nav-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--highlight), transparent);
    transition: left 0.6s ease;
}

.nav-card:hover::after {
    left: 100%;
}

.nav-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--accent);
}

.nav-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-card-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0;
}

.nav-card-title {
    font-family: 'Tiro Bangla', serif;
    font-size: 0.92rem;
    color: var(--accent);
    line-height: 1.2;
}

.nav-card.next {
    text-align: right;
}

.inline-arrow {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
    opacity: 0.85;
}

.nav-card .inline-arrow {
    width: 13px;
    height: 13px;
    vertical-align: -2px;
}

.flow-arrow .inline-arrow {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* ===== FOOTER ===== */
footer {
    margin-top: 8px;
    padding: 20px 0 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer .footer-quote {
    font-family: 'Tiro Bangla', serif;
    font-style: italic;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 6px;
    animation: quote-shimmer 4s ease-in-out infinite;
}

footer .footer-links {
    margin-top: 10px;
}

footer .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
}

footer .footer-links a:hover {
    color: var(--highlight);
    border-color: var(--highlight);
}

/* ===== LOGO EXPLANATION PAGE ===== */
.logo-hero {
    margin: 24px auto 8px;
    padding: 36px 24px 28px;
    max-width: 360px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px var(--shadow);
}

.logo-hero-mark {
    width: 140px;
    height: 140px;
    color: var(--highlight);
}

.logo-hero-caption {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== LOGO NODE PULSE (header + hero) ===== */
.logo-icon circle,
.logo-hero-mark circle {
    transform-box: fill-box;
    transform-origin: center;
    animation: node-pulse 2.4s ease-in-out infinite;
}

.logo-icon circle:nth-of-type(2),
.logo-hero-mark circle:nth-of-type(2) {
    animation-delay: 0.3s;
}

.logo-icon circle:nth-of-type(3),
.logo-hero-mark circle:nth-of-type(3) {
    animation-delay: 0.6s;
}

@keyframes node-pulse {
    0%, 55%, 100% {
        transform: scale(1);
    }
    28% {
        transform: scale(1.4);
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-icon circle,
    .logo-hero-mark circle {
        animation: none;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--highlight);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
        box-shadow: 0 0 0 6px transparent;
    }
}

.session-tag::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--highlight);
    animation: pulse-dot 1.8s ease-in-out infinite;
    flex-shrink: 0;
}

.hero h1, .hero-sub {
    animation: fadeUp 0.6s ease backwards;
}

.hero h1 {
    animation-delay: 0.1s;
}

.hero-sub {
    animation-delay: 0.2s;
}

@keyframes draw-underline {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes dash-grow {
    from {
        width: 0;
    }
    to {
        width: 32px;
    }
}

@keyframes border-pulse {
    0%, 100% {
        border-left-color: var(--highlight);
        box-shadow: -4px 0 0 0 transparent;
    }
    50% {
        border-left-color: var(--accent);
        box-shadow: -4px 0 8px 0 var(--highlight);
    }
}

@keyframes story-shimmer {
    0%, 100% {
        border-left-color: var(--accent);
    }
    50% {
        border-left-color: var(--highlight);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.25);
    }
    30% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.2);
    }
    60% {
        transform: scale(1);
    }
}

@keyframes quote-shimmer {
    0%, 100% {
        opacity: 0.85;
    }
    50% {
        opacity: 1;
    }
}

@keyframes summary-border {
    0%, 100% {
        border-color: var(--highlight);
        box-shadow: 0 0 0 0 var(--highlight);
    }
    50% {
        border-color: var(--accent);
        box-shadow: 0 0 20px -5px var(--highlight);
    }
}

@keyframes cursor-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes question-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .what-is-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    section.hero {
        padding: 18px 0 14px;
    }

    .session-meta {
        top: 64px;
    }

    .session-meta-inner {
        padding: 0 16px;
    }

    .session-nav {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .article-header {
        padding: 18px 0 16px;
    }

    .hero-banner {
        width: 100%;
        margin-top: 18px;
    }

    .hero-banner-caption {
        font-size: 0.82rem;
        padding: 10px 14px 10px;
    }

    .session-banner {
        width: 100%;
        margin-top: 18px;
    }

    .session-banner-caption, .session-end-banner-text {
        font-size: 0.82rem;
        padding: 10px 14px 10px;
    }

    .qa-block {
        padding: 18px 16px;
    }

    .qa-question {
        padding-left: 28px;
    }

    .summary-box {
        padding: 24px 20px;
    }

    .code-block {
        font-size: 0.82rem;
        padding: 16px;
    }

    .flow-step {
        gap: 10px;
    }

    .flow-step-num {
        width: 36px;
    }

    .flow-num-circle {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .flow-step-content {
        padding: 10px 12px;
    }

    .flow-step-title {
        font-size: 0.95rem;
    }

    .flow-step-body {
        font-size: 0.82rem;
    }

    .flow-box {
        font-size: 0.78rem;
        padding: 2px 8px;
    }

    .flow-compare {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .flow-compare-col {
        padding: 12px 14px;
    }

    .flow-compare-box {
        font-size: 0.82rem;
        padding: 6px 12px;
    }

    .arch-diagram {
        padding: 12px 8px 10px;
    }

    .arch-caption {
        font-size: 0.78rem;
    }

    .question-chain {
        padding: 14px 12px 12px;
    }

    .question-chain .qc-item {
        padding-left: 32px;
        padding-right: 4px;
        font-size: 0.86rem;
    }

    .question-chain .qc-num {
        width: 20px;
        height: 20px;
        font-size: 0.72rem;
    }

    .question-chain .qc-item:not(:last-child)::after {
        left: 9.35px;
        top: calc(50% + 10px);
        height: calc(50% - 10px + 6px);
    }

    .growth-stage {
        padding: 12px 14px;
        gap: 12px;
    }

    .growth-stage-num {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .growth-stage-flow .flow-box {
        font-size: 0.76rem;
        padding: 3px 8px;
    }
}

@media (max-width: 700px) {
    .stage-sessions .col-num {
        width: auto;
    }

    .stage-sessions .col-title {
        width: auto;
    }

    .stage-sessions tbody td {
        display: block;
        width: 100%;
        border-right: none;
        border-bottom: 1px dotted var(--border);
        padding: 8px 0;
    }

    .stage-sessions tbody td:last-child {
        border-bottom: none;
        padding-bottom: 14px;
    }

    .stage-sessions tbody tr {
        border-bottom: 2px dotted var(--border);
    }

    .stage-sessions thead {
        display: none;
    }
}

/* Respect users who don't want motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
