/* --- Variables & Themes --- */
:root {
    --font-mono: 'JetBrains Mono', monospace;
    --border-radius: 16px;
}

/* 1. LIGHT (Latte) */
[data-theme="latte"] {
    --bg-base: #eff1f5;
    --bg-card: #e6e9ef;
    --bg-card-inner: #dce0e8;
    --text-main: #4c4f69;
    --text-muted: #6c6f85;
    --accent-blue: #1e66f5;
    --accent-green: #40a02b;
    --accent-red: #d20f39;
    --accent-yellow: #df8e1d;
    --accent-mauve: #8839ef;
    --border-color: #bcc0cc;
}

/* 2. LIGHT² (Beige - replacing Frappe logic) */
[data-theme="frappe"] {
    --bg-base: #ebe6dc;
    --bg-card: #e4dfd5;
    --bg-card-inner: #d8d3c8;
    --text-main: #575279;
    --text-muted: #9893a5;
    --accent-blue: #2e7de9;
    --accent-green: #56949f;
    --accent-red: #b4637a;
    --accent-yellow: #ea9d34;
    --accent-mauve: #907aa9;
    --border-color: #d1cbbd;
}

/* 3. DARK (Macchiato) */
[data-theme="macchiato"] {
    --bg-base: #24273a;
    --bg-card: #363a4f;
    --bg-card-inner: #1e2030;
    --text-main: #cad3f5;
    --text-muted: #a5adcb;
    --accent-blue: #8aadf4;
    --accent-green: #a6da95;
    --accent-red: #ed8796;
    --accent-yellow: #eed49f;
    --accent-mauve: #c6a0f6;
    --border-color: #494d64;
}

/* 4. DARK² (Mocha) */
[data-theme="mocha"] {
    --bg-base: #1e1e2e;
    --bg-card: #313244;
    --bg-card-inner: #181825;
    --text-main: #cdd6f4;
    --text-muted: #a6adc8;
    --accent-blue: #89b4fa;
    --accent-green: #a6e3a1;
    --accent-red: #f38ba8;
    --accent-yellow: #f9e2af;
    --accent-mauve: #cba6f7;
    --border-color: #45475a;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-mono);
    line-height: 1.6;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* --- Navigation --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    margin: 1rem auto 4rem auto;
    padding: 1rem 0;
}

.logo { font-size: 1.3rem; font-weight: bold; color: var(--text-main); }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--text-muted); font-size: 1.1rem; }
.nav-links a:hover { color: var(--text-main); }

main { max-width: 1200px; margin: 0 auto; width: 100%; flex: 1; }

/* --- Hero Section --- */
.hero { margin-bottom: 6rem; }
.hero h1 { font-size: 3rem; margin-bottom: 1.5rem; }
.highlight-blue { color: var(--accent-blue); }

.bio {
    color: var(--text-muted);
    max-width: 800px;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.underline-link { border-bottom: 1px dashed var(--text-muted); }
.underline-link:hover { color: var(--accent-blue); border-color: var(--accent-blue); }

.socials {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    max-width: 800px; 
    width: 100%;
}

.socials .icon {
    width: 16px; 
    height: 16px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    transition: filter 0.3s;
}

.socials img.icon {
    filter: invert(1); 
}

[data-theme="latte"] .socials .icon,
[data-theme="frappe"] .socials .icon { 
    filter: invert(0); 
}

.more-link {
    margin-left: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* --- Projects Section --- */
.projects { margin-bottom: 6rem; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.section-header h2 { color: var(--accent-blue); font-size: 1.5rem; }

.dotted-link { border-bottom: 1px dotted var(--text-muted); padding-bottom: 2px; }
.dotted-link:hover { color: var(--accent-blue); border-color: var(--accent-blue); }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s, background-color 0.3s;
    overflow: hidden;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent-blue); }

.project-card { padding: 0; display: flex; flex-direction: column; }
.terminal-header {
    background: var(--bg-card-inner);
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: var(--accent-red); }
.yellow { background: var(--accent-yellow); }
.green { background: var(--accent-green); }
.stars { font-size: 0.8rem; color: var(--text-muted); }

.card-content { padding: 2rem; background: var(--bg-card-inner); flex-grow: 1; }
.repo-title { margin-bottom: 1rem; }
.repo-owner { color: var(--accent-red); }
.repo-name { color: var(--accent-green); }
.card-footer { padding: 1.5rem; background: var(--bg-card); }
.tags { margin-top: 1rem; display: flex; gap: 0.5rem; }
.tag { background: var(--bg-card-inner); padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; color: var(--text-muted); }

/* --- Bento Grid --- */
.bento-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}
.widget-theme { grid-column: span 1; }
.widget-connect { grid-column: span 1; }
.widget-map { grid-column: span 1; }
.widget-terminal { grid-column: span 1; }

@media (max-width: 1000px) {
    .bento-section { grid-template-columns: repeat(2, 1fr); }
    .widget-theme, .widget-connect, .widget-map, .widget-terminal { grid-column: span 1; }
}
@media (max-width: 600px) {
    .bento-section { grid-template-columns: 1fr; }
    .widget-theme, .widget-connect, .widget-map, .widget-terminal { grid-column: span 1; }
}

.widget-header {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme Widget */
.theme-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.theme-buttons button {
    flex: 1 1 40%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    
    transition: all 0.2s ease;
}
.theme-buttons button:hover {
    background: var(--bg-card-inner);
    transform: translateY(-2px);
    color: var(--text-main);
}
.theme-buttons button.active {
    border-color: var(--accent-mauve);
    color: var(--text-main);
    background: rgba(203, 166, 247, 0.1);
    font-weight: bold;
}

/* Connect Widget */
.email-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    background: var(--accent-blue);
    border: none;
    border-radius: 8px;
    color: var(--bg-base);
    font-weight: bold;
    text-align: center;
}
.email-btn:hover { opacity: 0.9; }

/* Map Widget */
.map-placeholder {
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    
    background-color: #11111b;
    background-image: linear-gradient(#313244 1px, transparent 1px), linear-gradient(90deg, #313244 1px, transparent 1px);
    background-size: 20px 20px;
}
.map-footer { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); }

/* Status Widget */
.terminal-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.5rem 0;
}
.term-line { display: flex; gap: 0.5rem; }
.prompt { color: var(--accent-green); }
.term-output { color: var(--text-main); margin-bottom: 0.2rem; }
.cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--accent-mauve);
    animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Footer --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-content p { color: var(--text-muted); font-size: 0.9rem; }

.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--text-muted);
    font-size: 1.6rem;
}
.footer-links a:hover { color: var(--accent-blue); }

@media (max-width: 600px) {
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
}

/* --- About Page Styles --- */

.about-section {
    margin-top: 2rem;
    margin-bottom: 6rem;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-main);
}

.about-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 4rem;
    align-items: start;
}

/* Image Styling */
.about-image-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.profile-pic {
    width: 100%;
    aspect-ratio: 1/1; 
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); 
}

/* Bio Text Styling */
.about-bio p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.highlight-text {
    color: var(--text-main);
    font-weight: bold;
}

/* Dashed Links */
.dashed-link {
    text-decoration: none;
    border-bottom: 1px dashed;
    transition: all 0.2s ease;
    padding-bottom: 2px;
    background-color: transparent;
}

.dashed-link:hover {
    border-bottom-style: solid;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* --- Dashed Link Colors (Blue & Purple Only) --- */

.dashed-link.blue { 
    color: var(--accent-blue); 
    border-color: var(--accent-blue); 
}

.dashed-link.purple { 
    color: var(--accent-mauve); 
    border-color: var(--accent-mauve); 
}

/* Bottom Socials in Bio */
.about-socials {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.about-socials a {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.about-socials a:hover {
    color: var(--accent-blue);
}

.star-divider {
    opacity: 0.5;
    font-size: 0.8rem;
}

.email-text {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: text;
}

/* Responsive: Stack them on smaller screens */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr; /* Single column */
        gap: 2rem;
    }
    
    .about-image-container {
        max-width: 300px; /* Limit image size on mobile */
        margin-bottom: 1rem;
    }
}

/* --- Contact Styles --- */

.contact-section {
    margin-top: 4rem;
    margin-bottom: 6rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* 1. Availability Card Styling */
.availability-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-card-inner));
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    background: rgba(166, 209, 137, 0.1);
    width: fit-content;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(166, 209, 137, 0.3);
}

.ping-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.status-text {
    font-size: 0.85rem;
    color: var(--accent-green);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.availability-card h3 {
    margin-bottom: 0;
    color: var(--text-main);
    font-size: 1.2rem;
}

/* Resume Button Styling */
.resume-cta-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-blue);
    color: var(--bg-base);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: opacity 0.2s, transform 0.2s;
}
.resume-cta-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* List Styling */
.availability-list { list-style: none; }
.availability-list li {
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}
.availability-list li i { color: var(--accent-blue); }

/* Social Grid Styling */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.social-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
}
.social-card:hover { transform: translateY(-5px); }

.card-icon {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-card-inner);
}

.social-card h3 { font-size: 1.3rem; color: var(--text-main); margin-bottom: 0.5rem; }
.social-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.link-arrow { font-size: 0.85rem; font-weight: bold; margin-top: auto; }

/* Specific Card Colors */
.social-card.email .card-icon { color: var(--accent-blue); }
.social-card.email:hover { border-color: var(--accent-blue); box-shadow: 0 4px 20px rgba(137, 180, 250, 0.1); }
.social-card.email .link-arrow { color: var(--accent-blue); }

.social-card.linkedin .card-icon { color: var(--accent-mauve); }
.social-card.linkedin:hover { border-color: var(--accent-mauve); box-shadow: 0 4px 20px rgba(203, 166, 247, 0.1); }
.social-card.linkedin .link-arrow { color: var(--accent-mauve); }

.social-card.github .card-icon { color: var(--accent-green); }
.social-card.github:hover { border-color: var(--accent-green); box-shadow: 0 4px 20px rgba(166, 209, 137, 0.1); }
.social-card.github .link-arrow { color: var(--accent-green); }

/* Mobile Stack */
@media (max-width: 600px) {
    .social-grid { grid-template-columns: 1fr; }
    .card-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .resume-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Mobile Optimization --- */

@media (max-width: 768px) {
    
    body {
        padding: 1rem;
    }

    nav {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    .nav-links {
        gap: 1.5rem;
        font-size: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .bio {
        font-size: 1rem;
    }

    .project-grid {
        grid-template-columns: 1fr; 
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-image-container {
        max-width: 100%;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .card-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .resume-cta-btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero, .projects, .bento-section, .about-section, .contact-section {
        margin-bottom: 4rem;
    }
}