:root {
    /* Primary palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);

    /* Secondary colors */
    --violet: #8b5cf6;
    --emerald: #10b981;
    --amber: #f59e0b;
    --rose: #f43f5e;
    --sky: #0ea5e9;

    /* Neutrals */
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-cool: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 40px -10px var(--primary-glow);

    /* Animation */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg-subtle);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.page-bg::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    animation: float 20s ease-in-out infinite;
}

.page-bg::after {
    content: "";
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 60%);
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(5%, 5%) rotate(5deg); }
    50% { transform: translate(0, 10%) rotate(0deg); }
    75% { transform: translate(-5%, 5%) rotate(-5deg); }
}

/* Grid pattern overlay */
.grid-pattern {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(to right, var(--border-light) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-light) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.5;
}

/* Container */
.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
}

/* Header */
.document-header {
    text-align: center;
    padding: 60px 40px;
    margin-bottom: 48px;
    background: var(--gradient-primary);
    border-radius: 24px;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.document-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.brand-logo {
    font-size: 36px;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    margin-bottom: 8px;
    position: relative;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.brand-tagline {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 600;
    position: relative;
}

/* Download Button */
.download-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all var(--transition-base);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 0 50px -10px var(--primary-glow);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn svg {
    width: 18px;
    height: 18px;
}

/* Content Card */
.content-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 56px;
    margin-bottom: 32px;
    position: relative;
}

.content-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 0 0 4px 4px;
}

/* Typography */
h1 {
    font-size: 2.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 16px 0;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 56px 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(var(--bg), var(--bg)) padding-box,
                var(--gradient-primary) border-box;
    border-radius: 0 0 4px 4px;
    position: relative;
}

h2::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

h2:first-of-type { margin-top: 32px; }

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 40px 0 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

h3::before {
    content: "";
    width: 4px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 28px 0 12px 0;
}

p {
    margin: 16px 0;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all var(--transition-fast);
}

a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

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

a:hover::after {
    width: 100%;
}

/* Lists */
ul, ol {
    margin: 24px 0;
    padding-left: 0;
    list-style: none;
}

li {
    margin: 14px 0;
    padding-left: 36px;
    position: relative;
    line-height: 1.7;
    color: var(--text-secondary);
}

ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 10px;
    height: 10px;
    background: var(--gradient-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-glow);
}

ol {
    counter-reset: item;
}

ol li::before {
    content: counter(item);
    counter-increment: item;
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    color: white;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm), 0 0 10px var(--primary-glow);
}

/* Feature List */
.feature-list li {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px 20px 16px 48px;
    margin: 12px 0;
    transition: all var(--transition-base);
}

.feature-list li:hover {
    background: var(--bg);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.feature-list li::before {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 28px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

th, td {
    padding: 18px 24px;
    text-align: left;
}

th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

td {
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

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

tr:hover td {
    background: var(--bg-subtle);
}

/* Alternate row colors */
tbody tr:nth-child(even) td {
    background: var(--bg-subtle);
}

tbody tr:nth-child(even):hover td {
    background: var(--bg-muted);
}

/* Code */
code {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 14px;
    background: var(--bg-muted);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--primary-dark);
}

pre {
    background: var(--gradient-dark);
    color: #e2e8f0;
    padding: 28px;
    border-radius: 16px;
    overflow-x: auto;
    margin: 28px 0;
    font-size: 14px;
    line-height: 1.7;
    box-shadow: var(--shadow-xl);
}

pre code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid transparent;
    border-image: var(--gradient-primary) 1;
    margin: 28px 0;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--bg-subtle) 0%, var(--bg) 100%);
    border-radius: 0 16px 16px 0;
    font-style: italic;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    position: relative;
}

blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 60px;
    font-family: Georgia, serif;
    color: var(--primary-light);
    opacity: 0.3;
}

blockquote p {
    margin: 0;
    position: relative;
}

/* Horizontal Rules */
hr {
    border: none;
    height: 4px;
    background: var(--gradient-primary);
    margin: 56px 0;
    border-radius: 2px;
    opacity: 0.3;
}

/* Strong & Emphasis */
strong {
    font-weight: 700;
    color: var(--text);
}

em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Call to Action Box */
.cta-box {
    background: var(--gradient-primary);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin: 40px 0;
    color: white;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.cta-box h2, .cta-box h3 {
    color: white;
    border: none;
    margin-top: 0;
}

.cta-box h2::before, .cta-box h3::before {
    display: none;
}

.cta-box p {
    color: rgba(255,255,255,0.9);
}

.cta-box a {
    color: white;
    text-decoration: underline;
}

/* Pricing Table */
.pricing-table td:last-child {
    font-weight: 700;
    color: var(--primary);
}

/* Footer */
.document-footer {
    text-align: center;
    padding: 48px 0;
    margin-top: 48px;
    border-top: 1px solid var(--border-light);
}

.footer-brand {
    font-weight: 800;
    font-size: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

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

.document-footer a {
    color: var(--primary);
}

.footer-meta {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-muted);
}

/* Print Styles */
@media print {
    .page-bg, .grid-pattern, .download-btn { display: none !important; }

    body {
        background: white !important;
        font-size: 11pt;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .document-header {
        background: #6366f1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
        border-radius: 0;
        margin-bottom: 24px;
        padding: 40px;
    }

    .content-card {
        background: white !important;
        backdrop-filter: none;
        box-shadow: none;
        border: none;
        padding: 0;
        border-radius: 0;
    }

    .content-card::before { display: none; }

    h1 {
        background: none !important;
        -webkit-text-fill-color: #6366f1 !important;
        color: #6366f1 !important;
    }

    h2 {
        background: none !important;
        border-bottom: 2px solid #6366f1;
    }

    h2::before { background: #6366f1 !important; }
    h3::before { background: #6366f1 !important; }

    ul li::before {
        background: #6366f1 !important;
        box-shadow: none !important;
    }

    ol li::before {
        background: #6366f1 !important;
        box-shadow: none !important;
    }

    th {
        background: #6366f1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    table { box-shadow: none; border: 1px solid #e2e8f0; }

    a { color: #6366f1 !important; }
    a::after { display: none; }

    h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
    table, pre, blockquote, ul, ol { page-break-inside: avoid; }

    .document-footer {
        margin-top: 24px;
        padding-top: 16px;
    }

    .footer-brand {
        background: none !important;
        -webkit-text-fill-color: #6366f1 !important;
        color: #6366f1 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 20px 16px; }

    .document-header {
        padding: 40px 24px;
        border-radius: 20px;
    }

    .brand-logo { font-size: 28px; }
    .brand-tagline { font-size: 12px; letter-spacing: 2px; }

    .content-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }

    table { font-size: 14px; }
    th, td { padding: 14px 16px; }

    .download-btn {
        top: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }

    th, td { padding: 12px; font-size: 13px; }

    .download-btn span { display: none; }
    .download-btn { padding: 12px; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text: #e2e8f0;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --bg: #0f172a;
        --bg-subtle: #1e293b;
        --bg-muted: #334155;
        --border: #334155;
        --border-light: #1e293b;
    }

    body {
        background: var(--bg-subtle);
        color: var(--text);
    }

    .content-card {
        background: rgba(30, 41, 59, 0.9);
        border-color: var(--border);
    }

    .content-card::before {
        opacity: 0.6;
    }

    h1 {
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    h2 {
        color: var(--text);
    }

    h3 {
        color: var(--text);
    }

    p, li {
        color: var(--text-secondary);
    }

    strong {
        color: var(--text);
    }

    code {
        background: var(--bg-muted);
        border-color: var(--border);
        color: var(--primary-light, #818cf8);
    }

    td {
        background: var(--bg);
        border-color: var(--border);
        color: var(--text-secondary);
    }

    .pro-tip {
        background: linear-gradient(135deg, var(--bg-muted) 0%, var(--bg) 100%);
    }

    .document-footer {
        border-color: var(--border);
    }

    .document-footer p {
        color: var(--text-muted);
    }

    .grid-pattern {
        opacity: 0.15;
    }
}
