/* 
   Modern Backend Theme Styling - PREMIUM EDITION
   Optimized for Dark Mode, Mobile-First, Performance
*/

:root {
    --bg-color: #050505;
    --card-bg: rgba(23, 23, 23, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent: #3b82f6; 
    --accent-glow: rgba(59, 130, 246, 0.5);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --max-width: 1200px;
}

* { box-sizing: border-box; scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 50% -20%, #1e1b4b 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, #0d1117 0%, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
img { max-width: 100%; height: auto; border-radius: 12px; }

.inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

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

.animate-fade { animation: fadeIn 0.8s ease-out forwards; }

/* --- HEADER --- */
.gh-head {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}
.inner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 72px;
}

.gh-head-brand { 
    font-size: 1.4rem; 
    font-weight: 800; 
    letter-spacing: -0.02em; 
    flex: 1;
}
.gh-head-menu { flex: 2; display: flex; justify-content: center; }
.gh-head-menu ul { display: flex; list-style: none; gap: 2rem; margin: 0; padding: 0; }
.gh-head-menu li a { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); transition: 0.2s; }
.gh-head-menu li a:hover { color: var(--text-primary); }

.gh-head-actions { flex: 1; display: flex; justify-content: flex-end; gap: 0.8rem; }

@media (max-width: 900px) {
    .gh-head-menu { display: none; } /* On simple mobile/tablet, hide middle menu */
    .gh-head-actions .btn-secondary { display: none; } /* Hide secondary CTA on mobile */
    .gh-head-brand { flex: 1; }
    .gh-head-actions { flex: 0; }
}

/* --- HERO --- */
.hero {
    padding: 8rem 0 6rem;
    text-align: center;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: var(--accent);
    filter: blur(150px);
    opacity: 0.15;
    z-index: -1;
}
.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    line-height: 1;
    background: linear-gradient(180deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 3rem;
}
.hero-ctas { display: flex; justify-content: center; gap: 1.5rem; }

.btn {
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary { 
    background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
    color: #fff; 
    border: none;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 5px 25px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-secondary { 
    background: rgba(255, 255, 255, 0.03); 
    color: #fff; 
    border: 1px solid var(--card-border);
    backdrop-filter: blur(5px);
}
.btn-secondary:hover { 
    background: rgba(255,255,255,0.08); 
    border-color: rgba(255,255,255,0.3); 
}

/* Portal & Membership Alignments */
.gh-portal-triggerbtn-container { display: none !important; } /* Custom trigger used */
.gh-subscribe-form button, 
button[data-portal="signup"], 
button[data-portal="signup"] {
    background: var(--accent) !important;
    color: #fff !important;
}
input.gh-input {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 0.8rem 1.2rem !important;
}

@media (max-width: 640px) {
    .hero-ctas { flex-direction: column; padding: 0 1rem; }
    .hero-ctas .btn { width: 100%; justify-content: center; }
}

/* --- PROJECTS --- */
.section-title { 
    font-size: 2.5rem; font-weight: 800; margin-bottom: 3rem; 
    letter-spacing: -0.02em; text-align: center;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}
.project-card h3 { margin: 0 0 1rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.project-card p { 
    color: var(--text-secondary); 
    font-size: 1.05rem; 
    line-height: 1.5;
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-tech { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: auto; }
.tech-tag {
    font-size: 0.75rem; 
    font-weight: 800; 
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* --- POST CARDS --- */
.posts-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.post-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}
.post-card:hover { 
    background: rgba(59, 130, 246, 0.05); 
    border-color: var(--accent);
    transform: translateX(10px);
}
.post-card-content h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.5rem; }
.post-card-content p { color: var(--text-secondary); font-size: 1rem; margin: 0; }
.post-card-meta { text-align: right; font-size: 0.85rem; color: var(--text-secondary); min-width: 120px; }

@media (max-width: 768px) {
    .post-card { grid-template-columns: 1fr; }
}

/* --- TECH STACK --- */
.tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.stack-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}
.stack-box h4 { margin: 0 0 1rem; color: var(--text-secondary); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.1em; }
.stack-items { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.stack-item { background: #111; padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem; }

/* --- FOOTER --- */
.gh-foot {
    background: #000;
    padding: 6rem 0;
    margin-top: 8rem;
    border-top: 1px solid var(--card-border);
}
.footer-cta { text-align: center; margin-bottom: 4rem; }
.footer-links { display: flex; justify-content: center; gap: 3rem; margin-top: 2rem; font-weight: 600; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: #fff; }

/* Ghost Mandatory Classes */
.kg-width-wide { max-width: 1100px; width: 100%; margin-left: auto; margin-right: auto; }
.kg-width-full { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }
.kg-width-full img { border-radius: 0; width: 100%; }
