/* Reset & Base Styles */
:root {
    /* Stone Palette (Tailwind-ish) */
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --stone-300: #d6d3d1;
    --stone-400: #a8a29e;
    --stone-500: #78716c;
    --stone-600: #57534e;
    --stone-700: #44403c;
    --stone-800: #292524;
    --stone-900: #1c1917;
    --stone-950: #0c0a09;

    /* Accents */
    --orange-600: #ea580c;
    --amber-700: #b45309;

    /* Semantic Colors (Dark Mode Default) */
    --bg-body: var(--stone-900);
    --bg-card: var(--stone-800);
    --bg-card-hover: var(--stone-700);
    --text-primary: var(--stone-50);
    --text-secondary: var(--stone-300);
    --text-muted: var(--stone-400);
    --border-color: var(--stone-700);
    --accent-color: var(--orange-600);

    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    /* --font-main: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; */

    /* Hero Font Sizes (Editable) */
    --hero-name-size: 3.0rem;
    --hero-position-size: 1.4rem;
    --hero-text-size: 1.15rem;
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 80px;
    /* Compensate for fixed navbar */
}

body.all-projects-page {
    padding-top: 0;
}

html {
    scroll-behavior: smooth;
}

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

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Utilities */
.container {
    max-width: 1400px;
    /* Widened from 1024px */
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (min-width: 1024px) {
    .container-narrow {
        max-width: 50%;
    }
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.my-5 {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.all-projects-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Subtle visual differentiation for entries hidden on homepage */
body.all-projects-page .project-card {
    opacity: 0.4;
}

body.all-projects-page .project-card-archived {
    opacity: 1;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.wrap {
    flex-wrap: wrap;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:flex-row {
        flex-direction: row;
    }

    .md\:text-left {
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Custom About Me Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .about-grid {
        /* Change these values to adjust column widths */
        /* 2fr 1fr means the first column is twice as wide as the second */
        grid-template-columns: 2fr 1fr;
    }
}

/* Components */

/* Navbar */
/* Navbar */
.navbar {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(28, 25, 23, 0.8);
    /* var(--stone-900) with opacity */
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.75rem 0;
    background-color: rgba(28, 25, 23, 0.95);
    border-bottom: 1px solid var(--stone-700);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* About Me Paragraphs */
.container-narrow p {
    font-size: 1.15rem;
    line-height: 1.7;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    font-size: 1rem;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero-section {
    padding: 4rem 0;
}

.profile-picture {
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}

.hero-name {
    font-size: var(--hero-name-size);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-position {
    font-size: var(--hero-position-size);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-text {
    color: var(--text-secondary);
    font-size: var(--hero-text-size);
    max-width: 65ch;
}

.hero-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Skills Badges */
.skill-badge {
    display: inline-block;
    background-color: var(--stone-800);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin: 0.25rem;
    border: 1px solid var(--stone-700);
    transition: background-color 0.2s;
}

.skill-badge:hover {
    background-color: var(--stone-700);
    border-color: var(--stone-600);
}

/* Progress Bars */
.progress-container {
    margin-bottom: 1rem;
}

.progress-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar-bg {
    width: 100%;
    height: 0.5rem;
    background-color: var(--stone-800);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 9999px;
}

/* Project Card Styles */
.project-card {
    background-color: var(--stone-800);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border-color: var(--stone-600);
}

.explore-projects-card {
    appearance: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 260px;
    border-style: dashed;
    border-width: 2px;
    background-color: transparent;
    color: var(--stone-300);
}

.explore-projects-card:hover {
    color: var(--stone-50);
    border-color: var(--orange-600);
    background-color: rgba(234, 88, 12, 0.08);
}

.explore-projects-text {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
}

.card-title {
    color: var(--stone-50);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-completed {
    background-color: rgba(22, 163, 74, 0.2);
    color: #4ade80;
    border: 1px solid rgba(22, 163, 74, 0.4);
}

.badge-ongoing {
    background-color: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.badge-date {
    background-color: rgba(168, 162, 158, 0.2);
    color: var(--stone-300);
    border: 1px solid rgba(168, 162, 158, 0.4);
}

.badge-paper {
    background-color: rgba(59, 130, 246, 0.2);
    /* Blue-500 */
    color: #60a5fa;
    /* Blue-400 */
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.card-body {
    color: var(--stone-300);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    padding: 0;
    /* Override default padding */
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--stone-700);
    margin-top: auto;
}

.meta-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--stone-400);
    flex: 1;
    /* Take available space */
    min-width: 0;
    /* Allow shrinking */
    padding-right: 0.5rem;
    /* Gap from button */
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    /* For tooltip positioning */
    max-width: 100%;
}

.meta-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    /* Grow/shrink to fill space */
    min-width: 0;
    /* Allow truncation */
    display: block;
}

/* Custom Tooltip */
.meta-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: var(--stone-900);
    border: 1px solid var(--stone-700);
    padding: 0.75rem;
    border-radius: 0.5rem;
    width: max-content;
    max-width: 300px;
    z-index: 20;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateY(10px);
    pointer-events: none;
    color: var(--stone-300);
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: normal;
    /* Allow wrapping in tooltip */
}

.meta-item:hover .meta-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    /* Allow clicking links in tooltip */
}

.btn-view {
    background-color: transparent;
    color: var(--orange-600);
    border: 1px solid var(--orange-600);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-view:hover {
    background-color: var(--orange-600);
    color: white;
}

/* Blog Card Specifics */
.blog-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 16 / 9;
    /* Or whatever aspect ratio fits best */
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-img {
    transform: scale(1.05);
}

.blog-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    transform: translateY(100%);
    /* Hidden by default */
    transition: transform 0.3s ease;
    display: flex;
    align-items: flex-end;
}

.blog-card:hover .blog-card-overlay {
    transform: translateY(0);
}

.blog-card-title {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Touch Device Optimization: Always show overlay on devices without hover */
@media (hover: none) {
    .blog-card-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.4));
    }
}

/* Footer */
.footer {
    background-color: var(--stone-950);
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-list {
    list-style: none;
}

.footer-list li {
    margin-bottom: 0.5rem;
}

.footer-link {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link:hover {
    color: var(--accent-color);
}

/* Mobile Nav Toggle (Hidden by default, can be implemented if needed) */
.nav-toggle {
    display: none;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Simple hide for now, or stack them */
        /* For a simple portfolio, stacking might be better than a toggle */
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links.active {
        display: flex;
    }

    .all-projects-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .explore-projects-card {
        min-height: auto;
        padding: 0.9rem 1rem;
        border-radius: 0.75rem;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }

    .explore-projects-text {
        font-size: 0.95rem;
        font-weight: 700;
    }
}
