@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Fira+Code:wght@400;600&family=Space+Grotesk:wght@700&display=swap');

:root {
    --bg-dark: #050505;
    --bg-glass: rgba(15, 15, 20, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #2dd4bf;
    --accent-hover: #14b8a6;
    --accent-secondary: #818cf8;
    --glow-spread: 0 0 20px rgba(45, 212, 191, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Effects with Animation */
.cyber-grid {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(rgba(45, 212, 191, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 212, 191, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    animation: drift 20s linear infinite;
}

@keyframes drift {
    from { background-position: 0 0; }
    to { background-position: -40px 40px; }
}

.glow-orb {
    position: fixed;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(150px);
    opacity: 0.15;
    animation: pulseOrb 10s ease-in-out infinite alternate;
}
.glow-orb.top-left {
    background: var(--accent);
    top: -20vh;
    left: -20vw;
}
.glow-orb.bottom-right {
    background: var(--accent-secondary);
    bottom: -20vh;
    right: -20vw;
    animation-delay: 5s;
}

@keyframes pulseOrb {
    0% { transform: scale(1); opacity: 0.1; }
    100% { transform: scale(1.1); opacity: 0.2; }
}

/* Navbar */
.navbar {
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-content {
    max-width: 1000px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}
.logo-icon {
    color: var(--accent);
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.logo:hover .highlight {
    text-shadow: var(--glow-spread);
    transition: text-shadow 0.3s ease;
}
.highlight {
    color: var(--accent);
}
.nav-links .nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}
.nav-links .nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px var(--border-glass);
}

/* Container & Typography Alignment */
.container {
    flex: 1;
    max-width: 1000px;
    width: 90%;
    margin: 0 auto;
    padding: 4rem 0;
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

h1, h2, h3, h4 {
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}
h1 { font-size: 3rem; letter-spacing: -1px; }
h2 { 
    font-size: 2rem; 
    margin-top: 3rem; 
    color: var(--accent-secondary); 
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
h2::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: var(--glow-spread);
}
h3 { font-size: 1.4rem; color: var(--text-main); margin-top: 1.5rem; }
p { margin-bottom: 1.5rem; color: var(--text-muted); font-size: 1.1rem; }
ul, ol { margin-bottom: 1.5rem; margin-left: 2rem; color: var(--text-muted); }
li { margin-bottom: 0.5rem; }
a { color: var(--accent); text-decoration: none; transition: 0.2s; }
a:hover { text-shadow: var(--glow-spread); }

/* Code & Tables */
code {
    font-family: 'Fira Code', monospace;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
    border: 1px solid rgba(45, 212, 191, 0.2);
}
pre {
    background: #000;
    border: 1px solid var(--border-glass);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 2rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: var(--text-muted);
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    text-align: left;
    color: var(--text-muted);
}
th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-main);
}
blockquote {
    border-left: 4px solid var(--accent);
    margin-left: 0;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-style: italic;
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.1), transparent);
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
}

/* Glass Cards for Index Page with Staggered Animation */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.post-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: popIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Delaying card animations for a cool staggered effect */
.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes popIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Card Hover 3D Lift */
.post-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}
.post-card:hover::before { left: 150%; }

.post-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 15px 40px -10px rgba(45, 212, 191, 0.25), inset 0 0 20px rgba(45, 212, 191, 0.05);
    background: rgba(25, 25, 30, 0.6);
}

.post-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    font-family: 'Space Grotesk', sans-serif;
}
.post-card a.post-link {
    color: var(--text-main);
    text-decoration: none;
    display: block;
    position: relative;
    z-index: 2;
}
.post-card:hover a.post-link {
    color: var(--accent);
}
.post-meta {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 20px;
}
.post-excerpt {
    color: var(--text-muted);
    font-size: 1rem;
    flex: 1;
    line-height: 1.6;
}

/* Homepage Hero */
.hero {
    text-align: center;
    padding: 4rem 0 5rem;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 4rem;
}
.hero h1 {
    font-size: 4rem;
    background: linear-gradient(to right, #fff, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(45, 212, 191, 0.2));
}
.hero p {
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto;
    color: var(--text-muted);
}

/* Footer Alignment */
.footer {
    text-align: center;
    padding: 3rem 1rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.5);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Post Page Specifics */
.post-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 2rem;
    text-align: center;
}
.post-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    text-shadow: 0 0 30px rgba(255,255,255,0.1);
}
.post-header .meta {
    font-family: 'Fira Code', monospace;
    color: var(--accent);
    font-size: 1rem;
}
