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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --accent-orange: #ff6b35;
    --accent-cyan: #00d9ff;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #707070;
    --border-color: #2a2a2a;
    --grid-color: rgba(255, 107, 53, 0.08);
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.08; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    position: relative;
    overflow-x: hidden;
}

/* Animated grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 49px, var(--grid-color) 49px, var(--grid-color) 50px),
        repeating-linear-gradient(90deg, transparent, transparent 49px, var(--grid-color) 49px, var(--grid-color) 50px);
    pointer-events: none;
    animation: gridPulse 8s ease-in-out infinite;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 30px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    margin-bottom: 80px;
    position: relative;
    animation: slideInUp 0.8s ease-out;
}

.site-title, header h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 20px;
    color: var(--accent-orange);
    letter-spacing: -0.02em;
    position: relative;
}

header h1 a {
    color: var(--accent-orange);
    text-decoration: none;
    transition: color 0.3s ease;
}

header h1 a:hover {
    color: var(--accent-cyan);
}

.site-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 120px;
    height: 3px;
    background: var(--accent-orange);
}

.site-meta {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.site-meta span {
    position: relative;
}

.site-meta span::before {
    content: '▸';
    margin-right: 8px;
    color: var(--accent-orange);
}

/* Intro */
.intro {
    font-family: 'Roboto', sans-serif;
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 80px;
    color: var(--text-primary);
    max-width: 700px;
    border-left: 3px solid var(--accent-orange);
    padding-left: 30px;
    font-weight: 400;
    animation: slideInUp 0.8s ease-out 0.1s both;
}

/* Questions section */
.questions-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.questions-header h2, .questions-list h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
}

.questions-count {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 700;
}

/* Question items */
.question-item {
    position: relative;
    margin-bottom: 50px;
    padding: 35px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.8s ease-out both;
}

.question-item:nth-child(1) { animation-delay: 0.3s; }
.question-item:nth-child(2) { animation-delay: 0.4s; }
.question-item:nth-child(3) { animation-delay: 0.5s; }
.question-item:nth-child(4) { animation-delay: 0.6s; }

.question-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--accent-orange), var(--accent-cyan));
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-item:hover {
    border-color: var(--accent-orange);
    transform: translateX(8px);
    box-shadow: -8px 0 0 rgba(255, 107, 53, 0.1);
}

.question-item:hover::before {
    height: 100%;
}

.question-number {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.question-item h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.4rem;
    line-height: 1.5;
    margin-bottom: 18px;
    font-weight: 500;
}

.question-item h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.question-item h3 a::after {
    content: '→';
    margin-left: 10px;
    color: var(--accent-orange);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    display: inline-block;
}

.question-item:hover h3 a::after {
    opacity: 1;
    transform: translateX(0);
}

.question-item h3 a:hover {
    color: var(--accent-orange);
}

.preview {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Q&A Page */
main {
    animation: slideInUp 0.8s ease-out 0.1s both;
}

.qa-page {
    margin-bottom: 60px;
}

.qa-page section {
    margin-bottom: 50px;
    background: var(--bg-secondary);
    padding: 35px;
    border-left: 4px solid var(--accent-orange);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-orange);
}

.qa-page .answer {
    border-left-color: var(--accent-cyan);
}

.qa-page h2 {
    color: var(--accent-orange);
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.qa-page .answer h2 {
    color: var(--accent-cyan);
}

.question-text {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.answer-content {
    font-size: 1.05rem;
    line-height: 1.75;
}

.answer-content p {
    margin-bottom: 20px;
}

.answer-content a {
    color: var(--accent-cyan);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.answer-content a:hover {
    color: var(--accent-orange);
}

.answer-content h3 {
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.answer-content ol, .answer-content ul {
    margin-left: 25px;
    margin-bottom: 20px;
}

.answer-content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

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

.answer-content code {
    background: rgba(0, 217, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.answer-content pre {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    line-height: 1.6;
}

.answer-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--accent-cyan);
    font-size: 0.92em;
    display: block;
}

/* Code block wrapper */
.code-block-wrapper {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.code-block-wrapper pre {
    margin-bottom: 0;
    flex: 1;
}

/* Copy button for code blocks */
.copy-button {
    flex-shrink: 0;
    padding: 8px;
    background: #000000;
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--accent-cyan);
    transition: all 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-button:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.copy-button:active {
    background: rgba(0, 217, 255, 0.2);
}

.copy-button.copied {
    background: var(--accent-cyan);
    color: #000000;
    border-color: var(--accent-cyan);
}

/* Navigation */
.page-nav {
    margin: 40px 0;
}

.back-link {
    color: var(--accent-orange);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link:hover {
    color: var(--accent-cyan);
}

/* Footer */
footer {
    margin-top: 100px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

    header h1, .site-title {
        font-size: 3rem;
    }

    .intro {
        font-size: 1.05rem;
        padding-left: 20px;
    }

    .question-item {
        padding: 25px;
    }

    .question-item h3 {
        font-size: 1.2rem;
    }

    .site-meta {
        flex-direction: column;
        gap: 10px;
    }

    .qa-page section {
        padding: 25px;
    }

    .question-text {
        font-size: 1.15rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #505050;
}
