/* scire.dev - Broken-Grid Developer Knowledge */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --sepia-light: #F5F0E0;
    --fragment-cream: #EDE8D8;
    --knowledge-indigo: #3730A3;
    --glitch-coral: #F97316;
    --merge-green: #16A34A;
    --conflict-red: #DC2626;
    --deep-sepia: #1A1810;
    --muted-brown: #78716C;
}
body {
    background: var(--sepia-light);
    color: var(--deep-sepia);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    font-weight: 400;
    overflow-x: hidden;
}

/* Gradient Mesh Backgrounds */
.gradient-mesh {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.mesh-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(55,48,163,0.06) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}
.mesh-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(249,115,22,0.05) 0%, transparent 70%);
    bottom: -50px;
    left: -80px;
}

/* Glitch Stripes */
.glitch-stripe {
    position: absolute;
    height: 3px;
    background: var(--glitch-coral);
    z-index: 2;
    animation: glitchShift 4s ease-in-out infinite;
}
.stripe-hero { width: 120px; top: 45%; left: -10px; }
.stripe-1 { width: 80px; top: 20px; right: -20px; }
.stripe-2 { width: 100px; bottom: 30px; left: -15px; }
@keyframes glitchShift {
    0%, 90%, 100% { transform: translateX(0); opacity: 0.7; }
    92% { transform: translateX(4px); opacity: 1; }
    94% { transform: translateX(-2px); opacity: 0.8; }
}

/* Hero */
#hero {
    position: relative;
    padding: 5rem 2rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero-title {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--deep-sepia);
}
.hero-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--muted-brown);
    margin-top: 0.5rem;
}

/* Merge Conflict Markers */
.merge-conflict {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 2rem;
}
.conflict-marker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--conflict-red);
    opacity: 0.5;
    display: block;
    border-top: 1px solid rgba(220,38,38,0.15);
    border-bottom: 1px solid rgba(220,38,38,0.15);
    padding: 4px 0;
}

/* Broken Grid */
#content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}
.broken-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 16px;
}
.fragment {
    position: relative;
    background: var(--fragment-cream);
    padding: 2.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fragment.visible {
    opacity: 1;
    transform: translateY(0);
}
.fragment-wide {
    grid-column: 1 / 8;
}
.fragment-overlap-right {
    grid-column: 5 / 13;
    margin-top: -2rem;
    z-index: 1;
    mix-blend-mode: normal;
    border-left: 3px solid var(--knowledge-indigo);
}
.fragment-overlap-left {
    grid-column: 1 / 9;
    margin-top: -1rem;
}
.fragment-narrow {
    grid-column: 6 / 12;
}
.fragment-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--deep-sepia);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}
.fragment-body {
    color: var(--deep-sepia);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}
.fragment-body:last-child { margin-bottom: 0; }

/* Code Block */
.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: rgba(55,48,163,0.06);
    padding: 1.25rem;
    border-radius: 4px;
    display: block;
    line-height: 1.7;
    color: var(--knowledge-indigo);
    margin-top: 1rem;
    border-left: 2px solid var(--knowledge-indigo);
}

/* Stack List (diff style) */
.stack-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stack-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 2px;
}
.stack-item.add {
    background: rgba(22,163,74,0.08);
    color: var(--merge-green);
}
.stack-item.del {
    background: rgba(220,38,38,0.06);
    color: var(--conflict-red);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Footer */
#footer {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}
.footer-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--muted-brown);
}

/* Responsive */
@media (max-width: 700px) {
    .fragment {
        grid-column: 1 / -1 !important;
        margin-top: 0 !important;
    }
    .fragment-overlap-right { border-left: none; border-top: 3px solid var(--knowledge-indigo); }
}
