/* ================================================================
   Architecture Page — Dedicated Styles
   ================================================================ */

/* ---- Hero Stats ---- */
.arch-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.arch-stat { text-align: center; }
.arch-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}
.arch-stat-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ================================================================
   SCROLL STORYTELLING
   ================================================================ */
.arch-story {
    position: relative;
    padding: 6rem 2rem;
}

.arch-story-inner {
    max-width: var(--container);
    margin: 0 auto;
}

.story-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 5rem 0;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    position: relative;
}

.story-step.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Alternate layout */
.story-step:nth-child(even) {
    direction: rtl;
}
.story-step:nth-child(even) > * {
    direction: ltr;
}

/* Connector line between steps */
.story-step::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: 5rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
    transform: translateX(-50%);
}
.story-step:last-child::after { display: none; }

/* SVG visual area */
.story-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-svg-wrap {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.04);
    background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-svg-wrap::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.story-svg {
    width: 180px;
    height: 180px;
}

/* SVG animations */
.svg-pulse {
    animation: svgPulse 3s ease-in-out infinite;
}
.svg-spin {
    animation: svgSpin 12s linear infinite;
    transform-origin: 100px 90px;
}

@keyframes svgPulse {
    0%, 100% { r: 20; opacity: 0.6; }
    50% { r: 24; opacity: 1; }
}
@keyframes svgSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Story content */
.story-content {
    padding: 1rem 0;
}

.story-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.6;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.story-step:nth-child(2) .story-num { color: #eab308; }
.story-step:nth-child(3) .story-num { color: #ef4444; }
.story-step:nth-child(4) .story-num { color: #a855f7; }
.story-step:nth-child(5) .story-num { color: #06b6d4; }
.story-step:nth-child(6) .story-num { color: #3b82f6; }
.story-step:nth-child(7) .story-num { color: #ec4899; }

.story-content h3 {
    font-size: clamp(22px, 2.5vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.2;
}

.story-content p {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 16px;
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.story-tag {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.3px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-3);
    transition: all 0.3s ease;
}

.story-step:hover .story-tag {
    border-color: rgba(2,245,160,0.15);
    color: var(--text-2);
}

/* ================================================================
   ARCHITECTURE GRID SECTION
   ================================================================ */
.arch-grid-section {
    position: relative;
    padding: 6rem 0;
}

.arch-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.arch-filter-btn {
    padding: 8px 20px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    font-family: 'Inter', sans-serif;
}
.arch-filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}
.arch-filter-btn.active {
    border-color: rgba(2,245,160,0.3);
    background: rgba(2,245,160,0.08);
    color: var(--accent);
}

.arch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---- Node Card ---- */
.arch-node {
    position: relative;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 20px;
    overflow: hidden;
    transition: all 0.4s var(--ease);
}
.arch-node.span-2 { grid-column: span 2; }

.arch-node:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.arch-node:hover .arch-node-glow { opacity: 1; }

.arch-node.filtered-out {
    opacity: 0.08 !important;
    transform: scale(0.97) !important;
    pointer-events: none;
}

.arch-node-glow {
    position: absolute;
    top: -1px; left: -1px; right: -1px;
    height: 2px;
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Theme glows */
.arch-node[data-theme="green"] .arch-node-glow { background: linear-gradient(90deg, transparent, #02f5a0, transparent); }
.arch-node[data-theme="blue"] .arch-node-glow { background: linear-gradient(90deg, transparent, #3b82f6, transparent); }
.arch-node[data-theme="purple"] .arch-node-glow { background: linear-gradient(90deg, transparent, #a855f7, transparent); }
.arch-node[data-theme="red"] .arch-node-glow { background: linear-gradient(90deg, transparent, #ef4444, transparent); }
.arch-node[data-theme="yellow"] .arch-node-glow { background: linear-gradient(90deg, transparent, #eab308, transparent); }
.arch-node[data-theme="cyan"] .arch-node-glow { background: linear-gradient(90deg, transparent, #06b6d4, transparent); }
.arch-node[data-theme="pink"] .arch-node-glow { background: linear-gradient(90deg, transparent, #ec4899, transparent); }
.arch-node[data-theme="orange"] .arch-node-glow { background: linear-gradient(90deg, transparent, #f97316, transparent); }

/* Node header */
.arch-node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.arch-node-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.arch-node[data-theme="green"] .arch-node-icon { background: rgba(2,245,160,0.08); color: #02f5a0; border: 1px solid rgba(2,245,160,0.12); }
.arch-node[data-theme="blue"] .arch-node-icon { background: rgba(59,130,246,0.08); color: #3b82f6; border: 1px solid rgba(59,130,246,0.12); }
.arch-node[data-theme="purple"] .arch-node-icon { background: rgba(168,85,247,0.08); color: #a855f7; border: 1px solid rgba(168,85,247,0.12); }
.arch-node[data-theme="red"] .arch-node-icon { background: rgba(239,68,68,0.08); color: #ef4444; border: 1px solid rgba(239,68,68,0.12); }
.arch-node[data-theme="yellow"] .arch-node-icon { background: rgba(234,179,8,0.08); color: #eab308; border: 1px solid rgba(234,179,8,0.12); }
.arch-node[data-theme="cyan"] .arch-node-icon { background: rgba(6,182,212,0.08); color: #06b6d4; border: 1px solid rgba(6,182,212,0.12); }
.arch-node[data-theme="pink"] .arch-node-icon { background: rgba(236,72,153,0.08); color: #ec4899; border: 1px solid rgba(236,72,153,0.12); }
.arch-node[data-theme="orange"] .arch-node-icon { background: rgba(249,115,22,0.08); color: #f97316; border: 1px solid rgba(249,115,22,0.12); }

.arch-node-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.arch-node-number {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-3);
    margin-top: 1px;
}

/* Components */
.arch-node-components {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.arch-comp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s ease;
}
.arch-comp:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
}
.arch-comp svg { opacity: 0.5; flex-shrink: 0; }
.arch-comp span { font-size: 11px; color: var(--text-2); white-space: nowrap; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .story-step {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 3rem 0;
    }
    .story-step:nth-child(even) { direction: ltr; }
    .story-visual { order: -1; }
    .story-svg-wrap { width: 200px; height: 200px; }
    .story-svg { width: 130px; height: 130px; }
    .arch-grid {
        grid-template-columns: 1fr;
    }
    .arch-node.span-2 { grid-column: span 1; }
    .arch-stats { gap: 24px; }
}
