/* ==========================================================================
   LlamaMagic — Shared Design System
   Single source of truth for all public pages. Link with:
     <link rel="stylesheet" href="/css/main.css">

   Contents:
     1.  Design tokens (:root)
     2.  Base / reset
     3.  Layout (.container + width modifiers, content grid)
     4.  Site navigation (.site-nav)
     5.  Buttons (.btn + variants)
     6.  Page chrome (.header, .hero, .badge, section titles, footer, breadcrumb)
     7.  Cards & product chrome (.card, .feature-item, .tasks-table, downloads)
     8.  Product / guide grid (.product-grid, .product-card)
     9.  Metrics (.scoreboard / .metric-grid, .metric)
     10. Guide content system (.story-shell, .chapter, .callout, etc.)
     11. Responsive breakpoints (950 / 820 / 560)

   Page-specific one-offs (the selling-runs flowchart, strategybattle finale)
   live in a small inline <style> on those pages, not here.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    --brand-purple: #665280;
    --brand-orange: #f08b36;
    --bg-color: #121212;
    --card-bg: #1e1e24;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --ring-red: #be3144;
    --gold: #f3c969;
    --go-green: #5fbf8f;
}

/* 2. Base / reset --------------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at top, rgba(240, 139, 54, 0.14), transparent 28rem),
        linear-gradient(180deg, #17131b 0%, var(--bg-color) 44%, #0f0f10 100%);
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--brand-orange);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 3. Layout --------------------------------------------------------------- */
.container {
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
    padding: 40px 0 64px;
}

.container.wide { max-width: 1300px; }
.container.narrow { max-width: 1000px; }
.container.reading { max-width: 1160px; }

.content-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 30px;
    align-items: start;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 4. Site navigation ------------------------------------------------------ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    margin-bottom: 30px;
    background-color: rgba(20, 18, 24, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.site-nav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.site-nav .brand:hover { text-decoration: none; }
.site-nav .brand span { color: var(--brand-orange); }

.site-nav .brand img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
}

.site-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.site-nav .nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.site-nav .nav-links a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.site-nav .nav-links a.active { color: var(--brand-orange); }

/* 5. Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background-color: var(--brand-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 139, 54, 0.3);
}

.btn-primary:hover {
    background-color: #d9782b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 139, 54, 0.5);
}

.btn-secondary {
    background-color: var(--brand-purple);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 82, 128, 0.3);
}

.btn-secondary:hover {
    background-color: #55446a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 82, 128, 0.5);
}

.btn-guides {
    background-color: var(--brand-purple);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 82, 128, 0.3);
}

.btn-guides:hover {
    background-color: #574569;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 82, 128, 0.5);
}

.btn-discord {
    background-color: #5865F2;
    color: white;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
    background-color: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

/* Compact buttons inside download rows */
.download-item .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-radius: 6px;
}

/* 6. Page chrome ---------------------------------------------------------- */
/* Centered page header (product pages + guide/article headers) */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header img {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(240, 139, 54, 0.25);
    margin-bottom: 15px;
    object-fit: cover;
}

.header h1 {
    color: var(--text-main);
    margin: 0;
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: 1px;
}

.header h1 span { color: var(--brand-orange); }

/* Boxed intro hero (homepage + guides hub) */
.hero {
    text-align: center;
    margin-bottom: 50px;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 12px;
    border-bottom: 4px solid var(--brand-purple);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero h1 {
    color: white;
    font-size: 2.2rem;
    margin: 0 0 20px;
    letter-spacing: 0.5px;
}

.hero h1 span { color: var(--brand-orange); }

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 850px;
    margin: 0 auto 25px;
}

.hero a.text-link {
    color: var(--brand-orange);
    font-weight: 600;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
}

/* Intro paragraph under a centered .header (guides/articles) */
.intro {
    max-width: 850px;
    margin: 20px auto 0;
    color: var(--text-muted);
    font-size: 1.08rem;
}

.badge {
    display: inline-block;
    background-color: var(--brand-purple);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(102, 82, 128, 0.4);
}

.section-title {
    color: white;
    font-size: 1.8rem;
    margin: 0 0 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.section-subtitle {
    color: var(--text-muted);
    margin: 0 0 28px;
    font-size: 1rem;
}

.footer {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.banner-container {
    text-align: center;
    margin-bottom: 40px;
}

.banner-container img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-orange); }

/* 7. Cards & product chrome ---------------------------------------------- */
.card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.features-card {
    border-left: 5px solid var(--brand-purple);
    padding: 30px 40px;
}

.tasks-card {
    border-left: 5px solid var(--brand-orange);
    padding: 30px 40px;
}

.pricing-card {
    border-top: 5px solid var(--brand-orange);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.botbase-card { border-top: 5px solid var(--brand-purple); }
.plugin-card { border-top: 5px solid var(--brand-orange); }

.card h2 {
    margin-top: 0;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.card p {
    color: var(--text-muted);
    margin: 0 0 16px;
    font-size: 0.98rem;
}

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

.feature-item { margin-bottom: 24px; }
.feature-item:last-child { margin-bottom: 0; }

.feature-item strong {
    display: block;
    color: var(--brand-orange);
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.feature-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tasks-table th,
.tasks-table td {
    padding: 6px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
}

.tasks-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding-bottom: 10px;
}

.tasks-table td:first-child {
    color: var(--text-main);
    font-weight: 600;
    white-space: nowrap;
}

.tasks-table td:last-child { color: var(--text-muted); }

.tasks-table .group-header td {
    color: var(--brand-purple);
    font-weight: 700;
    font-size: 1.05rem;
    padding-top: 5px;
    padding-bottom: 5px;
    border-bottom: 2px solid rgba(102, 82, 128, 0.3);
}

.tasks-table tr:hover:not(.group-header) td {
    background-color: rgba(255, 255, 255, 0.02);
}

.stripe-container {
    width: 100%;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Downloads list */
.download-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.download-item:hover { background-color: rgba(255, 255, 255, 0.06); }

.product-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* 8. Product / guide grid ------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 4px solid var(--brand-purple);
}

.product-card.plugin { border-top-color: var(--brand-orange); }
.product-card.botbase { border-top-color: var(--brand-purple); }

/* Opt-in auto-alternating accent (guides grids) */
.product-grid.alternate .product-card:nth-child(even) {
    border-top-color: var(--brand-orange);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    text-decoration: none;
}

.product-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin-bottom: 18px;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
}

.product-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brand-orange);
    margin-bottom: 8px;
}

.product-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 10px;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* 9. Metrics -------------------------------------------------------------- */
.scoreboard,
.metric-grid {
    display: grid;
    gap: 16px;
    margin: 34px 0;
}

.scoreboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.metric {
    background-color: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.metric strong {
    display: block;
    color: white;
    font-size: 1.35rem;
    line-height: 1.15;
}

.metric span {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

/* 10. Guide content system ----------------------------------------------- */
.story-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.chapter {
    background-color: var(--card-bg);
    border-radius: 12px;
    border-left: 5px solid var(--brand-purple);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.48);
    padding: 30px 36px;
    line-height: 1.7;
}

.chapter:nth-child(even) { border-left-color: var(--brand-orange); }

.chapter h2 {
    color: white;
    font-size: 1.55rem;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter h3 {
    color: var(--brand-orange);
    font-size: 1.1rem;
    margin: 22px 0 8px;
}

.chapter p {
    color: var(--text-muted);
    margin: 0 0 16px;
    font-size: 1rem;
}

.chapter p:last-child { margin-bottom: 0; }
.chapter strong { color: white; }
.chapter em { color: #d8c9ea; }

.chapter code {
    background-color: rgba(255, 255, 255, 0.07);
    color: var(--brand-orange);
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 0.88em;
}

.chapter ul,
.chapter ol {
    color: var(--text-muted);
    margin: 0 0 16px;
    padding-left: 22px;
}

.chapter li { margin-bottom: 10px; }
.chapter li strong { color: var(--brand-orange); }

/* "How it thinks" quote line */
.thinks {
    border-left: 3px solid var(--brand-purple);
    background-color: rgba(102, 82, 128, 0.12);
    padding: 12px 18px;
    border-radius: 6px;
    margin: 0 0 18px;
    color: #d8c9ea;
    font-style: italic;
}

/* "What it is" lead line */
.whatis {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.whatis strong { color: white; }

/* Inline tags (Best for / Risks) */
.tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 10px;
    border-radius: 6px;
    margin-right: 8px;
    vertical-align: middle;
}

.tag-best { background-color: rgba(102, 82, 128, 0.35); color: #d8c9ea; }
.tag-risk { background-color: rgba(190, 49, 68, 0.25); color: #f3a9b3; }

/* Gold spotlight chapter */
.spotlight {
    border-left-color: var(--gold);
    border-top: 5px solid var(--gold);
    background:
        linear-gradient(135deg, rgba(243, 201, 105, 0.10), transparent 42%),
        var(--card-bg);
}

.spotlight h2 { color: var(--gold); }

/* Settings cards (purple, used inside orange chapters) */
.setting {
    border-left: 3px solid var(--brand-purple);
    background-color: rgba(102, 82, 128, 0.10);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.setting:last-child { margin-bottom: 0; }
.setting h3 { margin: 0 0 4px; color: white; }

.setting .meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting .meta b { color: var(--brand-orange); }
.setting p { margin: 0 0 8px; }

/* Numbered step list */
.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}

.steps li {
    position: relative;
    padding-left: 48px;
    margin-bottom: 18px;
    color: var(--text-muted);
}

.steps li:last-child { margin-bottom: 0; }

.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background-color: var(--brand-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(102, 82, 128, 0.45);
}

.steps li strong { color: white; }

/* Worked-example box */
.example {
    border: 1px solid rgba(240, 139, 54, 0.35);
    background-color: rgba(240, 139, 54, 0.06);
    border-radius: 10px;
    padding: 20px 24px;
    margin-top: 8px;
}

.example h3 { margin-top: 0; }
.example ol { margin-bottom: 0; }
.example .result { color: var(--brand-orange); font-weight: 700; }

/* Callouts: base + .info (orange) / .warn (red) modifiers */
.callout {
    margin: 20px 0;
    padding: 18px 22px;
    border-left: 4px solid var(--brand-orange);
    border-radius: 8px;
    background-color: rgba(240, 139, 54, 0.10);
}

.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.callout h3 { color: var(--brand-orange); }
.callout p { color: #f0ddc6; margin: 0 0 10px; }
.callout p:last-child { margin-bottom: 0; }

.callout strong {
    color: var(--brand-orange);
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 0.82rem;
}

.callout.info { border-left-color: var(--brand-orange); background-color: rgba(240, 139, 54, 0.10); }
.callout.info h3 { color: var(--brand-orange); }

.callout.warn { border-left-color: var(--ring-red); background-color: rgba(190, 49, 68, 0.12); }
.callout.warn h3,
.callout.warn strong { color: #f3a9b3; }
.callout.warn p { color: #f0d2d7; }

/* Guide footer nav */
.guide-footer {
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.guide-footer .back-link { font-weight: 700; }

.related {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.related a {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.related a:hover { border-color: var(--brand-orange); text-decoration: none; }

/* 11. Responsive --------------------------------------------------------- */
@media (max-width: 950px) {
    .content-grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    .header h1 { font-size: 2rem; }

    .download-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-group { width: 100%; flex-direction: column; }
    .download-item .btn { text-align: center; }
}

@media (max-width: 820px) {
    .hero h1 { font-size: 2rem; }
    .scoreboard { grid-template-columns: 1fr; }
    .chapter { padding: 24px; }
}

@media (max-width: 560px) {
    .site-nav {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .site-nav .nav-links { justify-content: center; }
}
