/* ── Reading Progress ── */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ── Project Hero ── */
.project-hero {
    padding: 8rem 0 5rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.project-hero-inner {
    max-width: 860px;
}

.project-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

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

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent, #ff7d45);
    background: rgba(255, 125, 69, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
}

.project-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.project-hero-title span {
    color: var(--primary);
    display: block;
}

.project-hero-tagline {
    font-size: 1.15rem;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 700px;
    margin-bottom: 2rem;
}

.project-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.project-hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.project-links-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Tech Stack Strip ── */
.tech-stack-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2rem;
}

.project-hero-image {
    margin-top: 3rem;
    width: 100%;
    max-width: 800px;
}

.project-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg);
}

.tech-pill {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(42, 107, 255, 0.2);
}

/* ── Content Sections ── */
.project-body {
    padding: 5rem 0;
}

.project-body .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 4rem;
    align-items: start;
}

.project-content {
    margin-bottom: 3.5rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.project-content p, 
.project-content ul, 
.project-content ol,
.project-content h2,
.project-content h3,
.project-content h4 {
    max-width: 100%;
}

/* ── Section Dividers ── */
.project-section {
    margin-bottom: 1rem;
}

.project-section+.project-section {
    padding-top: 4rem;
}

.project-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.project-content h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-top: 3.5rem;
    margin-bottom: 0.5rem;
}

.project-content h3:first-child {
    margin-top: 0;
}

.project-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.project-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* List override for project body */
.project-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 2rem;
}

.project-content ol {
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.project-content ol li {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    padding-left: 0.25rem;
}

.project-content ul li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.project-content ul li::before {
    content: '→';
    color: var(--primary);
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0.1rem;
}

/* Nested lists logic */
.project-content ul ul {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.project-content ul ul li::before {
    content: '•';
    color: var(--text-lighter);
    font-size: 1.25rem;
    top: -0.1rem;
}

.project-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.project-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text);
    font-style: italic;
}

.project-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.project-content th {
    background: var(--bg-light);
    color: var(--text);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.project-content td {
    padding: 0.65rem 1rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

.project-content tr:last-child td {
    border-bottom: none;
}

.project-content tr:hover td {
    background: var(--bg-light);
}

/* Architecture diagram override for project body */
.project-content pre {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 2rem;
}

.project-content pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0;
}

/* Sidebar ── */
.project-sidebar {
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.sidebar-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-lighter);
    margin-bottom: 1rem;
}

.sidebar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.sidebar-row:last-child {
    border-bottom: none;
}

.sidebar-row .label {
    color: var(--text-lighter);
}

.sidebar-row .value {
    color: var(--text);
    font-weight: 500;
}

.sidebar-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sidebar-tag {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

/* ToC */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toc-list a {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    line-height: 1.4;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

/* Share */
.share-btns {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.55rem 1rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.share-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Post footer */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.post-footer a:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .project-hero {
        padding: 6rem 0 4rem;
        overflow-x: hidden;
    }

    .project-hero .container {
        max-width: 100%;
        overflow-x: hidden;
    }

    .project-hero-inner {
        min-width: 0;
        width: 100%;
    }

    .project-hero-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .project-hero-tagline {
        font-size: 1rem;
    }

    .project-links-row {
        flex-direction: column;
        width: 100%;
    }

    .project-links-row .btn {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .project-body .container {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    .project-content {
        min-width: 0 !important;
        width: 100% !important;
        overflow: hidden;
    }

    .toc-list {
        display: none;
    }
}
