:root { --bg: #0d1117; --card: #161b22; --accent: #58a6ff; --text: #c9d1d9; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: radial-gradient(circle at top right, #1c2128, var(--bg));
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    padding: 40px 20px;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.container { max-width: 1000px; margin: 0 auto; }
header { margin-bottom: 40px; display: flex; justify-content: space-between; align-items: flex-end; }
h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #58a6ff, #79c0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header-links { display: flex; gap: 15px; }
.btn-link {
    background: var(--card);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid var(--accent);
    transition: 0.3s;
}
.btn-link:hover { background: var(--accent); color: var(--bg); }

.card {
    background: var(--card);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #30363d;
    margin-bottom: 20px;
}

/* Home page */
.main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 30px; }
#about-content { color: var(--text); }
.project-item { padding: 10px 0; border-bottom: 1px solid #30363d; }
.project-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.project-link:hover { text-decoration: underline; }
.code-snippet {
    background: #000;
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #a5d6ff;
    margin-top: 10px;
}

/* Contact page */
.contact-list { list-style: none; }
.contact-item { margin-bottom: 20px; }
.contact-link {
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
    font-size: 1.1rem;
}
.contact-link:hover { color: var(--accent); }
.icon-img { width: 28px; height: 28px; filter: invert(0.7) sepia(1) saturate(5) hue-rotate(180deg); }
.icon-linktree { border-radius: 50%; }
.note { margin-top: 20px; color: #8b949e; font-size: 0.9rem; font-style: italic; }

/* Friends page */
.friends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.friend-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
        object-fit: cover;
        margin: 0 auto 15px; /* center the image horizontally */
        display: block;
        border: 2px solid var(--accent);
}
.friend-name { font-size: 1.2rem; margin-bottom: 15px; text-align: center; }
.social-links { display: flex; justify-content: center; gap: 15px; opacity: 0; transition: 0.3s; }
.card:hover .social-links { opacity: 1; }
.social-icon { width: 24px; height: 24px; filter: invert(0.7) sepia(1) saturate(5) hue-rotate(180deg); }
.icon-circle { border-radius: 50%; }

/* --- Mobile Responsive Overrides --- */

@media (max-width: 768px) {
    /* Stack header elements vertically */
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    /* Fix the main grid on Home page */
    .main-grid {
        grid-template-columns: 1fr;
    }

    /* Ensure text in cards doesn't hit screen edges */
    .card {
        padding: 20px;
    }

    /* Adjust font size for mobile readability */
    h1 {
        font-size: 1.8rem;
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}
