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

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #ffffff;
    --border: #222222;
    --max-width: 1200px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.nav {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo:hover {
    opacity: 0.8;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.potato-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

/* Main Content */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem 2rem;
    min-height: calc(100vh - 200px);
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    margin-top: -2rem;
}

/* Hero Section */
.hero {
    margin-bottom: 5rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 540px;
    line-height: 1.6;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 0;
    margin-bottom: 2rem;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* Page Title */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
}

/* Sections */
.recent-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.section-subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

/* Article List */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.article-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.article-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: opacity 0.2s ease;
}

.article-link:hover {
    opacity: 0.8;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.article-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.view-all {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--text-primary);
}

/* Reading List */
.reading-section {
    margin-bottom: 3rem;
}

.reading-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reading-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.reading-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reading-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1.0625rem;
}

.reading-author {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.reading-why {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.pdf-link {
    text-decoration: none;
    color: var(--text-primary);
}

.pdf-link:hover {
    opacity: 0.8;
}

/* Collapsible Reading Categories */
.reading-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reading-category {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.category-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.category-toggle:hover {
    background: var(--bg-tertiary);
}

.category-toggle::-webkit-details-marker {
    display: none;
}

.category-toggle::before {
    content: '▶';
    margin-right: 0.75rem;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.reading-category[open] .category-toggle::before {
    transform: rotate(90deg);
}

.category-title {
    flex: 1;
}

.category-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.reading-category .reading-list {
    padding: 0.5rem 1.5rem 1.5rem;
}

.reading-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Article Full Page */
.back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-primary);
}

.article-full {
    max-width: 100%;
}

.article-header {
    margin-bottom: 3rem;
}

.article-title-large {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-meta-large {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.article-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content .lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
    border-left: 3px solid var(--border);
    padding-left: 1.5rem;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 3rem 0 1rem;
    letter-spacing: -0.01em;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-secondary);
}

.article-content ul {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

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

.article-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.375rem 0.875rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
}

/* About Page */
.about-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.about-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--text-primary);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9375rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

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

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

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        padding: 1rem;
    }
    
    .nav-container {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
    }
    
    .potato-icon {
        width: 24px;
        height: 24px;
    }
    
    .main {
        padding: 2rem 1rem;
    }
    
    .main-wide {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 1.875rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .profile-image {
        width: 100px;
        height: 100px;
        border-radius: 0;
    }
    
    .article-title-large {
        font-size: 1.75rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .reading-title {
        font-size: 1rem;
    }
    
    .reading-why {
        font-size: 0.875rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem 0.75rem;
    }
}

/* Selection */
::selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Code Blocks */
pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

pre code {
    display: block;
    line-height: 1.6;
}

/* Inline code */
:not(pre) > code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Copy button */
.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    opacity: 0;
}

pre:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background: var(--border);
    color: var(--text-primary);
}

.copy-button.copied {
    background: #2d5a27;
    color: #fff;
    border-color: #2d5a27;
}

/* Syntax Highlighting */
.code-keyword { color: #ff7b72; }
.code-string { color: #a5d6ff; }
.code-comment { color: #8b949e; font-style: italic; }
.code-function { color: #d2a8ff; }
.code-number { color: #79c0ff; }
.code-property { color: #7ee787; }

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

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}
