/* ============================================
   PROJECTS PAGE — Extended Styles
   ============================================ */

/* --- PAGE HERO --- */
.page-hero {
    position: relative;
    z-index: 2;
    padding: 160px 0 60px;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 10px;
    border-radius: 100px;
    background: rgba(124, 110, 240, 0.08);
    border: 1px solid rgba(124, 110, 240, 0.15);
    margin-bottom: 28px;
}

.page-hero-title {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
    line-height: 1.1;
}

.page-hero-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 650px;
}

/* --- PROJECT NAV BAR --- */
.proj-nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    margin-bottom: 20px;
}

.proj-nav-scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.proj-nav-scroll::-webkit-scrollbar {
    display: none;
}

.proj-nav-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-decoration: none;
    letter-spacing: 0.03em;
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.3s var(--ease);
}

.proj-nav-link:hover,
.proj-nav-link.active {
    color: var(--text-primary);
    background: rgba(124, 110, 240, 0.1);
}

/* --- PROJECT SECTIONS --- */
.proj-section {
    position: relative;
    z-index: 2;
    padding: 80px 0 100px;
    border-top: 1px solid var(--border);
}

.proj-section:first-of-type {
    border-top: none;
}

.proj-header {
    margin-bottom: 48px;
}

.proj-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    line-height: 1.15;
}

.proj-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 700px;
}

/* --- STATUS BADGES --- */
.proj-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 16px;
}

.proj-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-live {
    background: rgba(74, 222, 128, 0.08);
    color: var(--accent-4);
    border: 1px solid rgba(74, 222, 128, 0.15);
}
.status-live::before { background: var(--accent-4); }

.status-dev {
    background: rgba(86, 196, 251, 0.08);
    color: var(--accent-2);
    border: 1px solid rgba(86, 196, 251, 0.15);
}
.status-dev::before { background: var(--accent-2); }

.status-paused {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-tertiary);
    border: 1px solid var(--border);
}
.status-paused::before { background: var(--text-tertiary); }

/* Also for other-card status badges */
.other-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 12px;
}
.other-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* --- DETAIL GRID --- */
.proj-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.proj-info {
    padding: 32px;
}

.proj-info h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-2);
    margin-bottom: 14px;
}

.proj-info p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

/* --- ARCHITECTURE DIAGRAMS --- */
.proj-diagram {
    padding: 36px;
    margin-bottom: 28px;
    overflow-x: auto;
}

.proj-diagram h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-1);
    margin-bottom: 28px;
}

.diagram-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.diagram-col {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.diagram-arrow {
    font-size: 1.4rem;
    color: var(--accent-1);
    font-weight: 300;
    opacity: 0.5;
    flex-shrink: 0;
}

.diagram-node {
    padding: 20px 16px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.diagram-node:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.node-input {
    background: rgba(86, 196, 251, 0.05);
    border-color: rgba(86, 196, 251, 0.12);
}

.node-process {
    background: rgba(124, 110, 240, 0.05);
    border-color: rgba(124, 110, 240, 0.12);
}

.node-output {
    background: rgba(74, 222, 128, 0.05);
    border-color: rgba(74, 222, 128, 0.12);
}

.node-support {
    background: rgba(255, 255, 255, 0.02);
}

.node-icon {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.node-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.node-sub {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.diagram-support {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

/* --- LAYER DIAGRAM (MoltBook) --- */
.diagram-layers {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layer-item {
    display: grid;
    grid-template-columns: 48px 180px 1fr;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.layer-item:hover {
    transform: translateX(4px);
    border-color: var(--border-hover);
}

.layer-5 { background: rgba(247, 126, 185, 0.05); border-color: rgba(247, 126, 185, 0.12); }
.layer-4 { background: rgba(124, 110, 240, 0.05); border-color: rgba(124, 110, 240, 0.12); }
.layer-3 { background: rgba(86, 196, 251, 0.05); border-color: rgba(86, 196, 251, 0.12); }
.layer-2 { background: rgba(74, 222, 128, 0.05); border-color: rgba(74, 222, 128, 0.12); }
.layer-1 { background: rgba(255, 189, 46, 0.05); border-color: rgba(255, 189, 46, 0.12); }

.layer-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-1);
    text-align: center;
}

.layer-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.layer-desc {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* --- META ROW --- */
.proj-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.proj-meta-card {
    padding: 32px;
}

.proj-meta-card h4 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.result-list {
    list-style: none;
    padding: 0;
}

.result-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
}

.result-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-1);
    font-weight: 600;
}

.result-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- LESSONS --- */
.proj-lessons {
    padding: 32px;
    margin-bottom: 28px;
}

.proj-lessons h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-3);
    margin-bottom: 14px;
}

.proj-lessons p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.proj-lessons code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(124, 110, 240, 0.1);
    color: var(--accent-2);
}

/* --- SUBSYSTEM GRID --- */
.proj-subsystem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.subsystem-card {
    padding: 32px;
    position: relative;
}

.subsystem-num {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(124, 110, 240, 0.12);
    line-height: 1;
    margin-bottom: 12px;
}

.subsystem-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.subsystem-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

/* --- OTHER PROJECTS GRID --- */
.other-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.other-card {
    padding: 28px;
    transition: all 0.4s var(--ease);
}

.other-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.other-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.other-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 14px;
}

/* --- CTA --- */
.proj-cta {
    position: relative;
    z-index: 2;
    padding: 40px 0 100px;
}

.proj-cta-content {
    padding: 60px;
    text-align: center;
}

.proj-cta-content h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 16px;
}

.proj-cta-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* --- LIVE PREVIEW --- */
.proj-preview {
    margin-bottom: 28px;
}

.proj-preview h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-1);
    margin-bottom: 16px;
}

.preview-browser {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4);
    position: relative;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(30, 30, 40, 0.9);
    border-bottom: 1px solid var(--border);
}

.preview-dots {
    display: flex;
    gap: 6px;
}

.preview-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.preview-dots span:nth-child(1) { background: #ff5f57; }
.preview-dots span:nth-child(2) { background: #febc2e; }
.preview-dots span:nth-child(3) { background: #28c840; }

.preview-url {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-url .lock-icon {
    color: var(--accent-4);
    font-size: 0.7rem;
}

.preview-url span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.preview-frame {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.preview-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #0a0a0f;
}

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    pointer-events: none;
}

.preview-overlay .btn {
    pointer-events: auto;
}

.preview-fallback {
    display: none;
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.preview-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.preview-fallback .preview-overlay {
    height: 100%;
    background: rgba(10, 10, 15, 0.5);
    align-items: center;
    padding-bottom: 0;
}

.preview-visit {
    text-align: center;
    margin-top: 12px;
}

.preview-visit a {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.preview-visit a:hover {
    color: var(--accent-1);
}

/* --- PROJECT INDEX GRID --- */
.proj-index {
    position: relative;
    z-index: 2;
    padding: 20px 0 60px;
}

.proj-grid-heading {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.proj-grid-heading-secondary {
    margin-top: 60px;
}

.proj-index-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.proj-index-card {
    display: flex;
    flex-direction: column;
    padding: 32px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s var(--ease);
    position: relative;
    overflow: hidden;
}

.proj-index-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    border-color: var(--border-hover);
}

.proj-index-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 16px;
    width: fit-content;
}

.proj-index-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.proj-index-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.proj-index-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.proj-index-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
    flex-grow: 1;
}

.proj-index-arrow {
    display: block;
    font-size: 1.2rem;
    color: var(--accent-1);
    margin-top: 8px;
    transition: transform 0.3s var(--ease);
}

.proj-index-card:hover .proj-index-arrow {
    transform: translateX(8px);
}

/* --- BACK NAV --- */
.proj-back-bar {
    position: relative;
    z-index: 2;
    padding: 100px 0 0;
}

.proj-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.3s var(--ease);
}

.proj-back-link:hover {
    color: var(--text-primary);
    background: rgba(124, 110, 240, 0.08);
}

/* --- PROJ PAGE NAV (prev/next) --- */
.proj-page-nav {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 0 0 60px;
    position: relative;
    z-index: 2;
}

.proj-page-nav a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 28px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    transition: all 0.3s var(--ease);
    max-width: 45%;
}

.proj-page-nav a:hover {
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.04);
}

.proj-page-nav .nav-dir {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.proj-page-nav .nav-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.proj-page-nav .next {
    text-align: right;
    margin-left: auto;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .proj-detail-grid,
    .proj-meta-row,
    .diagram-support {
        grid-template-columns: 1fr;
    }

    .proj-subsystem-grid,
    .other-grid,
    .proj-index-grid {
        grid-template-columns: 1fr;
    }

    .proj-page-nav {
        flex-direction: column;
    }

    .proj-page-nav a {
        max-width: 100%;
    }

    .diagram-flow {
        flex-direction: column;
        gap: 4px;
    }

    .diagram-arrow {
        transform: rotate(90deg);
    }

    .diagram-col {
        max-width: 100%;
        width: 100%;
    }

    .layer-item {
        grid-template-columns: 40px 1fr;
    }

    .layer-desc {
        display: none;
    }

    .proj-cta-content {
        padding: 40px 24px;
    }
}

@media (max-width: 600px) {
    .page-hero {
        padding: 130px 0 40px;
    }
    
    .other-grid {
        grid-template-columns: 1fr;
    }
}
