@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

/* ─── Design Tokens (same as index.html) ─── */
:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a28;
    --text: #e0e0e8;
    --text-muted: #8888a0;
    --accent: #6c63ff;
    --accent-glow: rgba(108, 99, 255, 0.3);
    --accent2: #00d4aa;
    --accent3: #ff6b6b;
    --border: #2a2a3a;
    --gradient-1: linear-gradient(135deg, #6c63ff 0%, #00d4aa 100%);
    --gradient-2: linear-gradient(135deg, #ff6b6b 0%, #6c63ff 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    padding: 0;
    overflow-x: hidden;
}

/* ─── Animated Background (from index.html) ─── */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(108, 99, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 170, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255, 107, 107, 0.03) 0%, transparent 50%);
}

.bg-grid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(108, 99, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 99, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ─── Document Navigation (glassmorphic, like index.html nav) ─── */
.doc-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.nav-back, .nav-pdf {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-back:hover, .nav-pdf:hover {
    color: var(--text);
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

/* ─── Content Container ─── */
.doc-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 80px 32px 60px;
}

/* ─── Legacy wrappers (for existing HTML files) ─── */
.wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 80px 32px 60px;
}

/* ─── Legacy back-nav ─── */
.back-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
}

.back-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-nav a:hover { color: var(--text); }

.back-nav .brand {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Title Block ─── */
#title-block-header {
    max-width: 860px;
    margin: 0 auto;
    padding: 100px 32px 0;
}

#title-block-header .title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px;
    border: none;
}

#title-block-header .subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ─── Headings ─── */
h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 64px 0 16px;
    color: #fff;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 52px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    position: relative;
}

h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin: 36px 0 12px;
}

h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #c0c0d0;
    margin: 28px 0 8px;
}

/* ─── Text ─── */
p {
    margin-bottom: 16px;
    color: #c8c8d8;
    font-size: 1.02rem;
}

strong { color: #fff; font-weight: 700; }
em { color: #b0b0c8; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: var(--accent2); }

/* ─── Lists ─── */
ul, ol {
    margin: 14px 0 14px 28px;
    color: #c8c8d8;
}

li {
    margin-bottom: 8px;
    line-height: 1.65;
}

/* ─── Blockquotes ─── */
blockquote {
    margin: 28px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--accent);
    background: rgba(108, 99, 255, 0.06);
    border-radius: 0 14px 14px 0;
    font-style: italic;
    color: #d0d0e0;
}

blockquote p { margin-bottom: 6px; color: #d0d0e0; }
blockquote strong { font-style: normal; }

/* ─── Tables ─── */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.9rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

thead tr {
    background: var(--bg-card);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    border-bottom: 2px solid var(--accent);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
    color: #c8c8d8;
    vertical-align: top;
}

tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
tbody tr:hover { background: rgba(108, 99, 255, 0.06); }

/* ─── Code ─── */
code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: rgba(108, 99, 255, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    color: #a09cff;
}

pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    color: #c8c8d8;
}

/* ─── Horizontal rules ─── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* ─── PDF Banner ─── */
.pdf-banner {
    margin: 60px 0 0;
    padding: 28px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    transition: border-color 0.3s;
}

.pdf-banner:hover {
    border-color: var(--accent);
}

.pdf-banner p {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.pdf-banner a {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient-1);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.pdf-banner a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
    color: #fff;
}

/* ─── Back to Top ─── */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 50;
    opacity: 0.7;
}

.back-to-top:hover {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ─── Smooth scroll ─── */
html {
    scroll-behavior: smooth;
}

/* ─── Selection ─── */
::selection {
    background: rgba(108, 99, 255, 0.3);
    color: #fff;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .doc-content,
    .wrapper {
        padding: 70px 16px 40px;
    }

    #title-block-header {
        padding: 80px 16px 0;
    }

    table { font-size: 0.8rem; }
    th, td { padding: 8px 10px; }

    .nav-inner {
        padding: 12px 16px;
    }

    .back-nav {
        padding: 12px 16px;
    }
}
