/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════
   DESIGN TOKENS (shared with style.css)
═══════════════════════════════════════ */
:root {
    /* Surfaces */
    --bg-left: #f8f9fb;
    --bg-right: #0d1117;
    --card-bg: #ffffff;
    --card-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);

    /* Text */
    --text-primary: #0d1117;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    /* Accent */
    --accent: #00e676;
    --accent-hover: #00c853;
    --accent-glow: rgba(0, 230, 118, 0.35);
    --accent-soft: rgba(0, 230, 118, 0.10);

    /* Borders */
    --border: #e5e7eb;
    --border-focus: var(--accent);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    /* Transition */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.3s;

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ═══════════════════════════════════════
   BASE
═══════════════════════════════════════ */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-left);
    color: var(--text-secondary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent-soft);
    color: var(--text-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

a:hover {
    color: var(--accent-hover);
}

/* ═══════════════════════════════════════
   NAV
═══════════════════════════════════════ */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

.nav-back:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════
   DOCUMENT
═══════════════════════════════════════ */
.doc {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2.5rem 4rem;
    background: var(--card-bg);
    min-height: calc(100vh - 60px);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* HEADER */
.doc-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--accent-soft);
    text-align: center;
}

.doc-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.doc-meta {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* SECTIONS */
.doc section {
    margin-bottom: 2.5rem;
}

.doc h2 {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1.5px solid var(--accent-soft);
}

.doc h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.25rem 0 0.75rem;
}

.doc p {
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.doc p strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* LISTS */
.doc ol,
.doc ul {
    margin: 0.75rem 0 1.25rem 1.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.doc li {
    margin-bottom: 0.5rem;
    padding-left: 0.35rem;
    line-height: 1.75;
}

.doc li strong {
    color: var(--text-primary);
}

/* LINKS */
.doc a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--duration) var(--ease),
                color var(--duration) var(--ease);
}

.doc a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
}

/* DEFINITION TABLE */
.def-table {
    width: 100%;
    margin: 0.85rem 0 1rem;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.def-table td {
    padding: 0.5rem 0.75rem 0.5rem 0;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.def-table td:first-child {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
    width: 100px;
}

.def-table td:last-child {
    color: var(--text-secondary);
}

.def-table tr:last-child td {
    border-bottom: none;
}

/* DATA TABLE */
.data-table {
    width: 100%;
    margin: 0.85rem 0 1.25rem;
    border-collapse: collapse;
    font-size: 0.88rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--accent-soft);
    border-bottom: 1.5px solid var(--border);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background var(--duration) var(--ease);
}

.data-table tbody tr:hover {
    background: var(--accent-soft);
}

/* FOOTER */
.doc-footer {
    padding: 2rem 2.5rem;
    text-align: center;
    background: var(--bg-left);
    border-top: 1.5px solid var(--border);
}

.doc-footer p {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */

/* Desktop */
@media (min-width: 1025px) {
    .doc {
        min-height: auto;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .doc {
        max-width: 100%;
        border-left: none;
        border-right: none;
        padding: 2.5rem 2rem 3rem;
    }
    
    .doc-header h1 {
        font-size: 1.5rem;
    }
    
    .data-table {
        font-size: 0.82rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.65rem 0.8rem;
    }
}

/* Mobile */
@media (max-width: 640px) {
    html {
        overflow-y: auto;
    }
    
    body {
        overflow-y: auto;
    }
    
    .nav {
        padding: 0.6rem 1rem;
    }
    
    .nav-back {
        font-size: 0.8rem;
    }
    
    .doc {
        max-width: 100%;
        padding: 2rem 1.25rem 2.5rem;
        border: none;
        min-height: auto;
        height: auto;
    }
    
    .doc-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .doc-header h1 {
        font-size: 1.35rem;
    }
    
    .doc section {
        margin-bottom: 1.75rem;
    }
    
    .doc h2 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .doc p {
        font-size: 0.9rem;
        margin-bottom: 0.65rem;
    }
    
    .doc ol,
    .doc ul {
        margin: 0.6rem 0 1rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .doc li {
        margin-bottom: 0.4rem;
    }
    
    .def-table {
        font-size: 0.85rem;
    }
    
    .def-table td:first-child {
        width: 90px;
    }
    
    .data-table {
        font-size: 0.75rem;
        margin: 0.6rem 0 1rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.6rem;
    }
    
    .doc-footer {
        padding: 1.5rem 1.25rem;
    }
}

/* PRINT */
@media print {
    .nav {
        display: none;
    }
    
    html {
        overflow: visible;
    }
    
    body {
        overflow: visible;
        background: white;
    }
    
    .doc {
        max-width: 100%;
        padding: 0;
        border: none;
        height: auto;
        min-height: auto;
    }
    
    .doc-footer {
        background: white;
        border-top: none;
        padding: 1.5rem 0;
    }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}