/* ═══════════════════════════════════════════════════════════
   SprocOptimizer — /learn shared stylesheet
   Mirrors the homepage design system (tokens, nav, footer, btn)
   and adds article / prose / breadcrumb / FAQ styling for
   the educational hub-and-spoke content pages.
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1420;
    --bg-card: #141a28;
    --bg-card-hover: #1a2236;
    --bg-elevated: #1e2640;
    --text-primary: #e8ecf4;
    --text-secondary: #8892a8;
    --text-muted: #7a8499;
    --accent: #00c2ff;
    --accent-glow: rgba(0, 194, 255, 0.15);
    --accent-bright: #40d4ff;
    --accent-warm: #ff6b35;
    --accent-warm-glow: rgba(255, 107, 53, 0.15);
    --accent-green: #00e88f;
    --accent-green-glow: rgba(0, 232, 143, 0.12);
    --accent-purple: #a78bfa;
    --border: rgba(255,255,255,0.06);
    --border-accent: rgba(0, 194, 255, 0.2);
    --gradient-hero: linear-gradient(135deg, #0a0e17 0%, #0d1526 40%, #111d35 100%);
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-card: 0 4px 24px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 40px rgba(0, 194, 255, 0.08);
    --font-display: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-bright); }
img { max-width: 100%; height: auto; }

body::before {
    content: '';
    position: fixed; inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999;
}

/* ═══ NAV (matches homepage) ═══ */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(10, 14, 23, 0.85);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s;
}
.nav.scrolled { background: rgba(10, 14, 23, 0.95); box-shadow: 0 2px 20px rgba(0,0,0,0.4); }
.nav-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 40px;
    display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 700; font-size: 20px;
    color: var(--text-primary);
}
.nav-logo .bolt {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #0088cc); font-size: 18px;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    letter-spacing: 0.02em; transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--accent); }
/* Keep filled CTA button text white in the nav (override the muted nav-link color) */
.nav-links a.btn-primary, .nav-links a.btn-primary:hover,
.nav-links a.btn-warm, .nav-links a.btn-warm:hover { color: #fff; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: 8px; font-family: var(--font-body);
    font-weight: 600; font-size: 14px; border: none; cursor: pointer;
    transition: all 0.25s ease; text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: #fff; box-shadow: 0 2px 12px rgba(0, 194, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0, 194, 255, 0.35); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border-accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent-bright); }
.btn-warm { background: linear-gradient(135deg, var(--accent-warm), #e05520); color: #fff; box-shadow: 0 2px 12px rgba(255, 107, 53, 0.25); }
.btn-warm:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(255, 107, 53, 0.35); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 10px; }

/* ═══ PAGE SHELL ═══ */
.page-top {
    background: var(--gradient-hero);
    border-bottom: 1px solid var(--border);
    padding: 120px 40px 56px;
    position: relative; overflow: hidden;
}
.page-top::before {
    content: ''; position: absolute; top: -30%; right: -10%;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(0, 194, 255, 0.06) 0%, transparent 60%);
    pointer-events: none;
}
.page-top-inner { max-width: 820px; margin: 0 auto; position: relative; z-index: 1; }

/* Breadcrumb */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb li { display: flex; align-items: center; gap: 8px; }
.breadcrumb li::after { content: '/'; color: var(--text-muted); opacity: 0.5; }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--text-secondary); }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 13px; font-weight: 500;
    color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 16px;
}
.eyebrow::before { content: ''; width: 24px; height: 2px; background: var(--accent); border-radius: 2px; }

.page-top h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4.4vw, 52px); font-weight: 800;
    line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 18px;
}
.page-meta { font-size: 14px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px 18px; }
.page-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ═══ ARTICLE / PROSE ═══ */
.article { max-width: 820px; margin: 0 auto; padding: 56px 40px 40px; }
.lede {
    font-size: 21px; line-height: 1.6; color: var(--text-primary);
    font-weight: 400; margin-bottom: 12px;
}
.article h2 {
    font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px);
    font-weight: 700; line-height: 1.2; letter-spacing: -0.01em;
    margin: 56px 0 18px; scroll-margin-top: 90px;
}
.article h3 {
    font-family: var(--font-display); font-size: 21px; font-weight: 600;
    margin: 36px 0 12px; scroll-margin-top: 90px;
}
.article p { color: var(--text-secondary); margin-bottom: 18px; font-size: 16.5px; }
.article p strong, .article li strong { color: var(--text-primary); font-weight: 600; }
.article ul, .article ol { color: var(--text-secondary); margin: 0 0 20px 0; padding-left: 0; list-style: none; }
.article ul li, .article ol li { position: relative; padding: 6px 0 6px 30px; font-size: 16.5px; }
.article ul li::before {
    content: ''; position: absolute; left: 4px; top: 15px;
    width: 7px; height: 7px; border-radius: 2px; background: var(--accent); opacity: 0.8;
}
.article ol { counter-reset: li; }
.article ol li::before {
    counter-increment: li; content: counter(li);
    position: absolute; left: 0; top: 8px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    color: var(--accent);
    width: 20px; height: 20px; border-radius: 6px;
    background: var(--accent-glow); display: flex; align-items: center; justify-content: center;
}
.article a:not(.btn) { border-bottom: 1px solid var(--border-accent); }
.article a:not(.btn):hover { border-bottom-color: var(--accent); }

/* Inline + block code */
code {
    font-family: var(--font-mono); font-size: 0.88em;
    background: var(--bg-elevated); color: var(--accent-bright);
    padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border);
}
pre {
    background: #0c1018; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 22px; margin: 0 0 22px;
    overflow-x: auto; box-shadow: var(--shadow-card);
}
pre code {
    background: none; border: none; padding: 0; color: var(--text-primary);
    font-size: 13.5px; line-height: 1.7; display: block;
}
.code-label {
    font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px;
}

/* Answer box — the extractable, LLM-liftable opening answer */
.answer-box {
    background: linear-gradient(180deg, rgba(0, 194, 255, 0.05) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-accent); border-left: 3px solid var(--accent);
    border-radius: var(--radius); padding: 24px 26px; margin: 0 0 32px;
}
.answer-box p { color: var(--text-primary); font-size: 17px; margin: 0; }
.answer-box p + p { margin-top: 12px; }

/* Callouts */
.callout {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 22px; margin: 0 0 24px; background: var(--bg-card);
    display: flex; gap: 14px; align-items: flex-start;
}
.callout .ic { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.callout p { margin: 0; font-size: 15.5px; color: var(--text-secondary); }
.callout.info { border-left: 3px solid var(--accent); }
.callout.warn { border-left: 3px solid var(--accent-warm); }
.callout.success { border-left: 3px solid var(--accent-green); }

/* Key takeaways */
.takeaways {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 30px; margin: 32px 0;
}
.takeaways h2 { margin: 0 0 14px; font-size: 19px; }
.takeaways ul { margin: 0; }
.takeaways ul li { color: var(--text-secondary); }

/* Definition chip row */
.deflist { display: grid; gap: 14px; margin: 0 0 24px; }
.defcard {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 22px;
}
.defcard dt { font-family: var(--font-display); font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.defcard dd { color: var(--text-secondary); font-size: 15.5px; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
.stat-strip .stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 18px; text-align: center; }
.stat-strip .num { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--accent-green); }
.stat-strip .lbl { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* Table */
.article table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; }
.article th, .article td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.article th { font-family: var(--font-display); color: var(--text-primary); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.article td { color: var(--text-secondary); }

/* Sources / citations */
.sources { margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--border); }
.sources h2 { font-size: 18px; margin: 0 0 12px; }
.sources ol { font-size: 14.5px; color: var(--text-muted); }
.sources ol li { padding: 4px 0 4px 30px; }
.sources ol li::before { background: var(--bg-elevated); color: var(--text-secondary); }

/* ═══ FAQ (reused from homepage) ═══ */
.faq-block { margin: 48px 0 0; }
.faq-block > h2 { margin-bottom: 8px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-question {
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; width: 100%; background: none; border: none;
    font-family: var(--font-display); font-size: 17px; font-weight: 600;
    color: var(--text-primary); text-align: left; padding: 0;
}
.faq-question:hover { color: var(--accent); }
.faq-arrow { font-size: 20px; color: var(--text-muted); transition: transform 0.3s; flex-shrink: 0; margin-left: 16px; }
.faq-item.open .faq-arrow { transform: rotate(45deg); color: var(--accent); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.3s ease; }
.faq-item.open .faq-answer { max-height: 600px; padding-top: 14px; }
.faq-answer p { font-size: 15.5px; color: var(--text-secondary); margin: 0; }
.faq-answer p + p { margin-top: 10px; }

/* ═══ CTA BAND ═══ */
.cta-band {
    margin: 56px 0 0; background: var(--bg-card);
    border: 1px solid var(--border-accent); border-radius: var(--radius-lg);
    padding: 40px 36px; text-align: center; position: relative; overflow: hidden;
    box-shadow: var(--shadow-glow);
}
.cta-band h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 0 0 10px; }
.cta-band p { color: var(--text-secondary); font-size: 16px; margin: 0 auto 24px; max-width: 520px; }
.cta-band .btn { margin: 0 6px; }

/* ═══ RELATED ═══ */
.related { margin: 48px 0 0; }
.related h2 { font-size: 20px; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.related-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 22px; transition: all 0.25s;
    display: block;
}
.related-card:hover { background: var(--bg-card-hover); border-color: var(--border-accent); transform: translateY(-2px); }
.related-card .rc-kicker { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.related-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--text-primary); margin: 6px 0 4px; }
.related-card p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ═══ HUB-SPECIFIC ═══ */
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 8px; }
.hub-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 26px; transition: all 0.3s;
    display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.hub-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0; transition: opacity 0.3s;
}
.hub-card:hover { background: var(--bg-card-hover); border-color: var(--border-accent); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.hub-card:hover::before { opacity: 1; }
.hub-card .tier { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 10px; }
.hub-card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 10px; line-height: 1.3; }
.hub-card p { font-size: 14.5px; color: var(--text-secondary); line-height: 1.65; flex: 1; }
.hub-card .arrow { margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--accent); }
.hub-section { max-width: 1100px; margin: 0 auto; padding: 56px 40px; }
.hub-section h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.hub-section .sub { color: var(--text-secondary); margin-bottom: 28px; font-size: 16px; }

/* ═══ FOOTER (matches homepage) ═══ */
footer { padding: 64px 40px 40px; border-top: 1px solid var(--border); background: var(--bg-primary); }
.footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.footer-brand .footer-logo { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.footer-brand .footer-logo .bolt { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #0088cc); font-size: 16px; }
.footer-brand p { font-size: 14px; color: var(--text-muted); line-height: 1.7; max-width: 300px; }
.footer-col h5 { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-col a { display: block; color: var(--text-muted); font-size: 14px; padding: 4px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom { max-width: 1280px; margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: 13px; color: var(--text-muted); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .hub-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links a:not(.btn) { display: none; }
    .related-grid { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .page-top { padding: 100px 20px 44px; }
    .article { padding: 40px 20px; }
    .hub-section { padding: 40px 20px; }
    .hub-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .cta-band { padding: 32px 22px; }
}
