/* Svbtle-inspired Design System */
:root {
    --bg: #ffffff;
    --sidebar-bg: #fafafa;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #e8e8e8;
    --hover-bg: #f0f0f0;
    --accent: #ff5a4f;
    --accent-hover: #e54940;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

    --sidebar-width: 240px;
    --content-max: 760px;
}

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

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg);
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
}

.sidebar-inner {
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-avatar {
    display: block;
    width: 72px;
    height: 72px;
    margin-bottom: 1.25rem;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-logo {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.sidebar-logo:hover {
    color: var(--accent);
    text-decoration: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-nav a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.sidebar-nav a:hover {
    color: var(--accent);
    text-decoration: none;
}

.sidebar-coming-soon {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.sidebar-coming-soon:hover {
    color: var(--text-secondary);
}

.sidebar-coming-soon em {
    font-size: 0.75rem;
    font-style: normal;
    opacity: 0.7;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-social {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.sidebar-social a {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-family: var(--font-mono);
    transition: color 0.15s;
}

.sidebar-social a:hover {
    color: var(--accent);
}

.lang-toggle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.lang-toggle a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.15s;
}

.lang-toggle a:hover {
    color: var(--text-primary);
}

.lang-toggle a.active {
    color: var(--text-primary);
    font-weight: 600;
}

.lang-toggle span {
    margin: 0 0.25rem;
    opacity: 0.5;
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.main-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.125rem;
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
    transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--sidebar-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--sidebar-bg);
    padding: 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    padding: 0;
}

/* Homepage */
.home-section {
    margin-bottom: 3rem;
}

.home-section h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
}

.home-list {
    list-style: none;
}

.home-list a {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.625rem 0;
    text-decoration: none;
}

.home-list a:hover {
    color: inherit;
}

.home-list a:hover .home-list-title {
    color: var(--accent);
}

.home-list-title {
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.15s;
}

.home-list-desc {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.home-list-desc::before {
    content: '—';
    margin-right: 0.5rem;
}

.home-list-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-left: auto;
}

.home-more {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.15s;
}

.home-more:hover {
    color: var(--accent);
}

/* Page Header */
.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header p {
    margin: 0;
    color: var(--text-tertiary);
}

/* Post List */
.post-list {
    list-style: none;
}

.post-item {
    padding: 0.625rem 0;
}

.post-item a {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    text-decoration: none;
}

.post-item a:hover {
    color: inherit;
}

.post-item a:hover .post-title {
    color: var(--accent);
}

.post-title {
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.15s;
}

.post-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-left: auto;
}

.post-description {
    display: none;
}

/* Post Detail */
.post-header {
    margin-bottom: 2.5rem;
}

.post-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.post-header .post-meta {
    font-size: 0.875rem;
}

.post-content {
    line-height: 1.85;
    font-size: 1.0625rem;
}

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

.post-content p:last-child {
    margin-bottom: 0;
}

.post-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    font-size: 1.375rem;
}

.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    color: var(--text-primary);
}

.post-content li {
    margin-bottom: 0.625rem;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content strong {
    font-weight: 600;
}

.post-content em {
    font-style: italic;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* Project Cards */
.card-grid {
    display: grid;
    gap: 1.5rem;
}

.card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.15s;
}

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

.card:hover .project-name {
    color: var(--accent);
}

.project-card {
    display: block;
}

.project-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    transition: color 0.15s;
}

.project-tagline {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.project-card-link {
    display: block;
    text-decoration: none;
}

.project-store-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--accent);
    text-decoration: none;
}

.project-store-link:hover {
    text-decoration: underline;
}

/* Project Landing */
.project-hero {
    text-align: center;
    padding: 2rem 0;
}

.project-hero .project-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.project-hero h1 {
    margin-bottom: 0.5rem;
}

.project-hero .tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.feature-list {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.feature-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.feature-list li:last-child {
    border-bottom: none;
}

.project-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.project-links a {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.15s;
}

.project-links a:hover {
    color: var(--accent);
}

/* FAQ */
.faq-list {
    margin-top: 1rem;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1rem 0;
    background: none;
    border: none;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.faq-question:hover {
    opacity: 0.7;
}

.faq-icon {
    font-size: 1.25rem;
    color: var(--text-tertiary);
    transition: transform 0.2s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding-bottom: 1rem;
}

.faq-answer p {
    margin: 0;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    font: inherit;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    transition: border-color 0.15s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--text-tertiary);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

.form-button {
    padding: 0.75rem 1.5rem;
    font: inherit;
    font-weight: 500;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.form-button:hover {
    background: var(--accent-hover);
}

.form-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-message {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.form-message.success {
    color: #22863a;
}

.form-message.error {
    color: #cb2431;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background: var(--bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 380px;
    width: 90%;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-tertiary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 0.25rem;
}

.modal-content > p {
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subscribe-form input {
    padding: 0.75rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.subscribe-form input:focus {
    outline: none;
    border-color: var(--text-tertiary);
}

.subscribe-form button {
    padding: 0.75rem;
    font: inherit;
    font-weight: 500;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.subscribe-form button:hover {
    background: var(--accent-hover);
}

/* Privacy & Content Pages */
.privacy-content h1 {
    margin-bottom: 0.5rem;
}

.privacy-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.privacy-content ul {
    padding-left: 1.25rem;
    margin: 0.75rem 0;
}

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

/* Utilities */
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.mt-sm { margin-top: 0.75rem; }
.mt-md { margin-top: 1.25rem; }
.mt-lg { margin-top: 2rem; }
.mt-xl { margin-top: 3rem; }

.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1.25rem; }
.mb-lg { margin-bottom: 2rem; }
.mb-xl { margin-bottom: 3rem; }

/* Mobile Footer (hidden on desktop) */
.mobile-footer {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    html {
        font-size: 16px;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-inner {
        padding: 1rem 1.5rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        height: auto;
    }

    .sidebar-avatar {
        width: 40px;
        height: 40px;
        margin-bottom: 0;
    }

    .sidebar-logo {
        margin-bottom: 0;
        margin-right: auto;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 1.25rem;
    }

    .sidebar-coming-soon {
        display: none;
    }

    .sidebar-bottom {
        display: none;
    }

    .main {
        margin-left: 0;
    }

    .main-inner {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .project-hero {
        padding: 1rem 0;
    }

    .project-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Mobile Footer - fixed at bottom */
    .mobile-footer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem 1.5rem;
        border-top: 1px solid var(--border);
        background: var(--sidebar-bg);
        text-align: center;
        z-index: 100;
    }

    /* Add padding to main content so it doesn't hide behind fixed footer */
    .main-inner {
        padding-bottom: 5rem;
    }

    .mobile-footer-social {
        display: flex;
        justify-content: center;
        gap: 1.5rem;
        margin-bottom: 1rem;
    }

    .mobile-footer-social a {
        font-size: 0.8125rem;
        color: var(--text-tertiary);
        text-decoration: none;
        font-family: var(--font-mono);
    }

    .mobile-footer-social a:hover {
        color: var(--accent);
    }

    .mobile-footer .lang-toggle {
        font-size: 0.8125rem;
    }
}
