:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --background: #ffffff;
  --surface: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --accent: #3b82f6;
}

/* Base Styles */
body {
    background-color: var(--background);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    font-size: 20px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 2rem;
}

h2 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

p {
    margin: 1.75rem 0;
    color: var(--text);
    font-size: 1.125rem;
    line-height: 1.9;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
main {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding-top: 0;
}

section {
    position: relative;
    z-index: 2;
    background: var(--background);
    margin-bottom: 2rem;
}

.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Navigation */
header {
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

/* Hero Section */
#hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 8rem 2rem 6rem;
    margin: 0;
    position: relative;
    overflow: hidden;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.1;
}

#hero h1 {
    color: white;
    font-size: 4rem;
    max-width: 900px;
    margin: 0 auto 2rem;
    position: relative;
}

#hero .lead {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

/* Overview Section */
#overview {
    background: var(--background);
    position: relative;
    z-index: 2;
    padding-top: 4rem;
    margin-top: -4rem;
    border-radius: 2rem 2rem 0 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.feature-card h3 {
    margin-top: 0;
    color: var(--primary);
}

.feature-card p {
    margin: 1rem 0 0;
    color: var(--text-secondary);
}

/* Chapters Grid */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.chapter-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.chapter-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-list li {
    margin-bottom: 1rem;
}

.chapter-list a {
    display: block;
    padding: 1rem;
    background: var(--background);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.chapter-list a:hover {
    background: var(--surface);
    transform: translateX(5px);
}

/* Demo Section */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.demo-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.demo-link {
    display: inline-flex;
    align-items: center;
    margin-top: 1.5rem;
    color: var(--primary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-radius: 0.5rem;
    border: 1px solid var(--primary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.demo-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Chapter Content Styles */
.chapter-content {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 8rem;
}

.chapter-content article {
    background: var(--background);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.chapter-content h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.chapter-content h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.chapter-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.chapter-content p {
    margin: 1.5rem 0;
    line-height: 1.8;
}

.chapter-content ul, .chapter-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.chapter-content li {
    margin: 0.5rem 0;
}

.chapter-nav {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.chapter-nav .nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.chapter-nav a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    flex: 1;
}

.chapter-nav a.prev {
    text-align: left;
}

.chapter-nav a.next {
    text-align: right;
}

.chapter-nav .nav-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.chapter-nav .nav-title {
    font-weight: 500;
    color: var(--primary);
}

.chapter-nav a:hover {
    background: var(--surface);
}

.chapter-nav a:hover .nav-title {
    color: var(--primary-dark);
}

/* Footer */
footer {
    background: var(--surface);
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .content {
        padding: 3rem 1.5rem;
    }
    
    #hero {
        min-height: 30vh;
        padding: 6rem 1.5rem 4rem;
    }
    
    #hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .feature-card,
    .demo-card,
    .chapter-card {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .chapter-content {
        padding-top: 6rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .chapter-nav .nav-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .chapter-nav a {
        width: 100%;
    }
}
