/* CSS & Design Mastery — Shared Stylesheet */

:root {
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border: #e6e8ef;
    --text-primary: #1a1a2e;
    --text-secondary: #5b6577;
    --text-muted: #94a3b8;
    --accent: #0a66c2;
    --accent-glow: rgba(10, 102, 194, 0.10);
    --accent-secondary: #4f9fe0;
    --accent-secondary-glow: rgba(79, 159, 224, 0.10);
    --gradient-tiktok: linear-gradient(135deg, #0a66c2, #4f9fe0);
    --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px rgba(16,24,40,.05);
    --shadow-hover: 0 12px 34px rgba(16,24,40,.10), 0 3px 10px rgba(16,24,40,.05);
    --radius: 12px;
}

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

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
}

/* ===== Navigation ===== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-logo span {
    background: var(--gradient-tiktok);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.nav-back:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* ===== Chapter Header ===== */
.chapter-header {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px 40px;
    border-bottom: 1px solid var(--border);
}

.chapter-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.chapter-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient-tiktok);
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.chapter-phase {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.phase-foundation { background: #eef2ff; color: #4f46e5; }
.phase-growth { background: #ecfdf5; color: #059669; }
.phase-mastery { background: #fef2f2; color: #e11d48; }

.chapter-header h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
}

.chapter-header .subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== Table of Contents ===== */
.toc {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}

.toc-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.toc-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.toc-list a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.toc-list a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border);
}

/* ===== Content ===== */
.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 24px 100px;
}

.content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 56px 0 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    scroll-margin-top: 80px;
}

.content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 36px 0 14px;
    color: var(--accent-secondary);
}

.content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 12px;
}

.content p {
    margin-bottom: 18px;
    font-size: 16.5px;
    line-height: 1.9;
    color: var(--text-primary);
}

.content ul, .content ol {
    margin: 0 24px 20px 0;
    padding: 0;
}

.content li {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.content li strong {
    color: var(--text-primary);
}

.content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.content em {
    color: var(--accent-secondary);
    font-style: normal;
}

/* ===== Callout Boxes ===== */
.tip, .example, .warning, .stat-box {
    padding: 20px 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    font-size: 15px;
}

.tip {
    background: rgba(79, 159, 224, 0.08);
    border: 1px solid rgba(79, 159, 224, 0.2);
    border-right: 4px solid var(--accent-secondary);
}

.example {
    background: rgba(10, 102, 194, 0.08);
    border: 1px solid rgba(10, 102, 194, 0.12);
    border-right: 4px solid #0a66c2;
}

.warning {
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.2);
    border-right: 4px solid #facc15;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-align: center;
}

.stat-box .big-number {
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient-tiktok);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

/* ===== Tables ===== */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.content th {
    background: var(--bg-card);
    padding: 12px 16px;
    text-align: right;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.content tr:hover td {
    background: var(--bg-card);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

/* ===== Step Boxes (Ch2) ===== */
.step-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 20px 0;
}

.step-box .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gradient-tiktok);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-left: 12px;
}

.step-box h4 {
    display: inline;
    margin: 0;
}

.step-box p {
    margin-top: 12px;
}

/* ===== Checklist ===== */
.checklist {
    list-style: none;
    margin: 16px 0;
    padding: 0;
}

.checklist li {
    padding: 8px 0;
    padding-right: 28px;
    position: relative;
}

.checklist li::before {
    content: "[ ]";
    position: absolute;
    right: 0;
    color: var(--accent-secondary);
    font-family: monospace;
}

/* ===== Chapter Navigation ===== */
.chapter-nav {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--border);
}

.chapter-nav a {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
    max-width: 45%;
}

.chapter-nav a:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.chapter-nav .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.chapter-nav .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 24px;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 14px;
}

.footer a { color: var(--accent); text-decoration: none; }

/* ===== Hero (Landing Page) ===== */
.hero {
    position: relative;
    padding: 100px 24px 80px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, var(--accent-glow), transparent 50%),
                radial-gradient(circle at 70% 50%, var(--accent-secondary-glow), transparent 50%);
    animation: pulse 8s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero h1 {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 24px;
    background: var(--gradient-tiktok);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat .number {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-tiktok);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat .label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Chapters Grid (Landing Page) ===== */
.chapters-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.phase-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 32px;
}

.phase-label.phase-foundation { background: #eef2ff; color: #4f46e5; border: 1px solid rgba(79, 70, 229, 0.25); }
.phase-label.phase-growth { background: #ecfdf5; color: #059669; border: 1px solid rgba(5, 150, 105, 0.25); }
.phase-label.phase-mastery { background: #fef2f2; color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.25); }

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 64px;
}

.chapter-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
}

.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-tiktok);
    opacity: 0;
    transition: opacity 0.3s;
}

.chapter-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(10, 102, 194, 0.3);
    transform: translateY(-2px);
}

.chapter-card:hover::before {
    opacity: 1;
}

.chapter-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-tiktok);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.chapter-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.chapter-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.chapter-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero { padding: 60px 20px 50px; }
    .hero-stats { gap: 24px; }
    .chapters-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .chapter-header { padding: 40px 20px 30px; }
    .content { padding: 20px 20px 60px; }
    .content h2 { font-size: 24px; }
    .chapter-nav { flex-direction: column; }
    .chapter-nav a { max-width: 100%; }
}

/* === GS v2.0 Block Styles === */
.deliverables { background: #f0f9ff; border-right: 4px solid #0ea5e9; padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; }
.deliverables h2, .deliverables h3 { margin-top: 0; color: #0c4a6e; }
.glossary { background: #fefce8; border: 1px solid #fde047; padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; }
.glossary dt { font-weight: 700; color: #713f12; margin-top: 0.75rem; }
.glossary dd { margin: 0.25rem 0 0 1rem; color: #422006; }
.do-now { background: #ecfdf5; border-right: 4px solid #10b981; padding: 1rem 1.25rem; margin: 1.25rem 0; border-radius: 6px; }
.do-now h3, .do-now h4 { margin-top: 0; color: #065f46; }
.check-yourself { background: #eff6ff; border: 2px solid #3b82f6; padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; }
.check-yourself h3 { margin-top: 0; color: #1e3a8a; }
.framework { background: #faf5ff; border-right: 4px solid #a855f7; padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; }
.framework h3 { margin-top: 0; color: #581c87; }
.work-routine { background: #fff7ed; border-right: 4px solid #f97316; padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; }
.work-routine h2, .work-routine h3 { margin-top: 0; color: #7c2d12; }
.warning { background: #fef2f2; border-right: 4px solid #ef4444; padding: 1rem 1.25rem; margin: 1.25rem 0; border-radius: 6px; }
.warning h3, .warning h4 { margin-top: 0; color: #7f1d1d; }
.just-one-thing { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); border: 2px solid #f59e0b; padding: 1.5rem; margin: 2rem 0; border-radius: 12px; text-align: center; }
.just-one-thing h3 { margin-top: 0; color: #78350f; font-size: 1.5rem; }
.chapter-summary { background: #f8fafc; border-top: 4px solid #475569; padding: 1.5rem; margin: 2rem 0; border-radius: 8px; }
.chapter-summary h2 { margin-top: 0; color: #0f172a; }
.chapter-summary ol { padding-right: 1.5rem; }
.chapter-summary li { margin: 0.75rem 0; }
.project-thread { background: #f0fdf4; border: 2px dashed #22c55e; padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; }
.project-thread h3 { margin-top: 0; color: #14532d; }
.chapter-footer-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 2rem; padding: 1.5rem; background: #f1f5f9; border-radius: 8px; }
.chapter-footer-nav a { padding: 0.75rem 1.25rem; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 6px; text-decoration: none; color: #1e293b; font-weight: 500; transition: all 0.2s; }
.chapter-footer-nav a:hover { background: #0a66c2; color: white; border-color: #0a66c2; }
.common-mistakes { background: #fef2f2; padding: 1.5rem; margin: 2rem 0; border-radius: 8px; border: 1px solid #fecaca; }
.common-mistakes h2 { margin-top: 0; color: #7f1d1d; }
.section-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.section-tags span { background: #e0e7ff; color: #3730a3; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.85rem; }

/* ===== Section Tabs + Chapter List (curriculum nav) ===== */
.curriculum{max-width:920px;margin:0 auto;padding:8px 24px 96px}
.chapter-tabs{display:flex;gap:6px;flex-wrap:wrap;background:var(--bg-card);border:1px solid var(--border);box-shadow:var(--shadow);border-radius:12px;padding:6px;margin-bottom:28px;position:sticky;top:64px;z-index:40}
.chapter-tab{appearance:none;border:none;background:transparent;font-family:inherit;cursor:pointer;padding:9px 18px;border-radius:8px;font-size:14px;font-weight:600;color:var(--text-secondary);transition:all .2s;white-space:nowrap;display:inline-flex;align-items:center;gap:7px}
.chapter-tab:hover{color:var(--text-primary);background:var(--bg-card-hover)}
.chapter-tab.active{background:var(--accent);color:#fff}
.chapter-tab .tab-count{font-size:11px;font-weight:700;opacity:.65}
.chapter-tab.active .tab-count{opacity:.9}
.chapter-panel{display:none}
.chapter-panel.active{display:block;animation:panelFade .25s ease}
@keyframes panelFade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.chapter-list{display:flex;flex-direction:column;gap:10px}
.chapter-row{display:flex;align-items:center;gap:16px;padding:16px 20px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);text-decoration:none;color:inherit;transition:all .2s}
.chapter-row:hover{border-color:var(--accent);box-shadow:var(--shadow-hover);transform:translateX(-3px)}
.chapter-row .num{flex-shrink:0;width:38px;height:38px;display:flex;align-items:center;justify-content:center;background:var(--gradient-tiktok);color:#fff;border-radius:10px;font-size:15px;font-weight:800}
.chapter-row .row-body{flex:1;min-width:0}
.chapter-row .row-title{font-size:16px;font-weight:700;color:var(--text-primary);line-height:1.4}
.chapter-row .row-desc{font-size:13.5px;color:var(--text-secondary);line-height:1.6;margin-top:3px}
.chapter-row .row-meta{font-size:12px;color:var(--text-muted);margin-top:5px;display:flex;gap:14px}
.chapter-row .go{flex-shrink:0;color:var(--accent);font-size:18px;opacity:.6;transition:opacity .2s}
.chapter-row:hover .go{opacity:1}
@media(max-width:768px){.chapter-tabs{top:58px;overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch}.chapter-row{padding:14px 16px;gap:12px}}
