:root {
    --primary-gradient: linear-gradient(135deg, #ff8a00 0%, #ffb347 100%);
    --bg-color: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
    --card-bg: #f8fafc;
    --accent-color: #ff8a00;
}

html {
    scrollbar-gutter: stable;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1296px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-color);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-color);
}

/* Hero Section */
.hero {
    padding: 8rem 0;
    text-align: center;
    background: radial-gradient(circle at 50% 50%, rgba(255, 138, 0, 0.08) 0%, transparent 60%);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(255, 138, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(255, 138, 0, 0.3);
}

/* Projects Section */
.projects {
    padding: 4rem 0;
}

.projects h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid var(--glass-border);
    display: flex;
    gap: 1.25rem;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 138, 0, 0.2);
}

.project-icon {
    font-size: 2.5rem;
    background: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.project-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.project-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

/* Recent Posts */
.recent-posts {
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
}

.recent-posts h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-card h3 a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: block;
}

.post-card time {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Single Post */
.single-post {
    --doc-content-inset: 0rem;
    padding: 4rem 0;
    max-width: 950px;
    margin: 0 auto;
}

.single-layout.has-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 950px) 250px;
    gap: 2rem;
    justify-content: center;
    align-items: start;
}

.single-layout.has-sidebar .single-post {
    margin: 0;
    max-width: none;
}

.section-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    width: calc(100% - var(--doc-content-inset));
    max-width: calc(100% - var(--doc-content-inset));
    box-sizing: border-box;
    margin-left: var(--doc-content-inset);
    margin-bottom: 5rem;
    position: sticky;
    top: 4rem;
    z-index: 80;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 0;
    border-radius: 0;
    padding: 0;
}

.section-nav a {
    text-decoration: none;
    color: var(--text-muted);
    border: 0;
    border-bottom: 3px solid #cbd5e1;
    background: #ffffff;
    padding: 0.75rem 0.5rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.section-nav a.is-active {
    color: var(--text-color);
    background: #ffffff;
    border-bottom-color: var(--accent-color);
}

.post-header {
    margin-bottom: 3rem;
    text-align: center;
}

.post-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.post-header.with-title-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-title-icon-wrap {
    margin-bottom: 1.25rem;
}

.header-title-icon-image {
    width: 256px;
    height: 256px;
    object-fit: contain;
    display: block;
}

.header-title-icon-text {
    font-size: 3rem;
    line-height: 1;
}

.post-content {
    width: calc(100% - var(--doc-content-inset));
    margin-left: var(--doc-content-inset);
    font-size: 1.125rem;
    color: #334155;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-content ol,
.post-content ul {
    list-style-position: inside;
    padding-left: 0;
    margin-left: 0;
}

.post-content a,
.post-content a:visited {
    color: var(--accent-color);
    text-decoration: none;
}

.post-content a:hover,
.post-content a:focus {
    color: #e67600;
    text-decoration: none;
}

.post-content .img-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -0.8rem;
}

.update-list {
    display: grid;
    gap: 1rem;
}

.update-card {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
}

.update-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #e5e7eb;
}

.update-head h3 {
    font-size: 1.05rem;
    margin: 0;
}

.update-head time {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.update-card ul {
    margin: 0;
    padding-left: 1rem;
}

.update-card li + li {
    margin-top: 0.35rem;
}

.dither-compare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.2rem;
}

.dither-compare figure {
    margin: 0;
}

.dither-compare img {
    width: 100%;
    height: auto;
    display: block;
}

.dither-compare figcaption {
    margin-top: 0.45rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

@media (max-width: 900px) {
    .dither-compare {
        grid-template-columns: 1fr;
    }
}

.apps-page {
    padding: 3rem 0 4rem;
}

.apps-page-detail {
    padding: 0;
}

.apps-header h1 {
    font-size: 2rem;
    margin-bottom: 0.6rem;
}

.apps-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.program-card {
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    background: var(--card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.program-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.program-card-link {
    display: block;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
}

.program-card-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.program-card-icon {
    font-size: 1.25rem;
}

.program-card-icon-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.program-card-title {
    font-weight: 700;
}

.program-card-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.program-docs h2 {
    margin-bottom: 1rem;
}

.program-doc-list {
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.program-doc-list a {
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 0.8rem;
    background: var(--card-bg);
    padding: 0.7rem 0.9rem;
    display: block;
}

/* Download Sidebar */
.download-bar-wrapper {
    position: sticky;
    top: 6rem;
    right: auto;
    width: 250px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1rem;
    z-index: 90;
    animation: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.download-bar {
    display: grid;
    gap: 1rem;
    justify-items: center;
    text-align: center;
}

.program-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.program-icon-box {
    font-size: 3.2rem;
    background: transparent;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    box-shadow: none;
}

.program-icon-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
}

.program-icon-box img {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    object-fit: contain;
}

.program-meta {
    display: flex;
    flex-direction: column;
}

.program-title-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
}

.program-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}

.program-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.program-version {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.program-platform {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.2rem 0 0;
}

.download-btn {
    width: auto;
    flex: 1;
    text-align: center;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
}

.download-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
}

/* Keep content clear of the fixed right sidebar on post pages */
body.has-download-sidebar .main.container {
    max-width: 1296px;
    padding-right: 2rem;
}

@media (max-width: 1100px) {
    .single-layout.has-sidebar {
        display: block;
    }

    .single-layout.has-sidebar .single-post {
        max-width: 950px;
        margin: 0 auto;
    }

    body.has-download-sidebar .main.container {
        max-width: 1120px;
        padding-right: 2rem;
    }

    .download-bar-wrapper {
        position: static;
        width: auto;
        margin-top: 1.5rem;
        animation: none;
    }
}

@media (max-width: 600px) {
    .download-bar {
        gap: 0.75rem;
    }

    .program-meta {
        display: none;
    }

    .download-btn {
        flex-grow: 1;
        text-align: center;
    }
}

/* Footer */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .single-post {
        --doc-content-inset: 0rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}
