/* Basic Reset & Font Import */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

/* --- Theme Variables --- */
:root {
    --font-main: 'Inter', sans-serif;

    /* Default: Dark Mode */
    --bg-color: #1a1a1a;
    --card-bg: #2a2a2a;
    --text-color: #e0e0e0;
    --text-muted: #aaaaaa;
    --border-color: #444444;
    --accent-color: #8a63d2; /* Muted Purple */
    --link-color: #a381e0;   /* Lighter Purple for links */
    --header-footer-bg: #222222;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --icon-sun: '☀️';
    --icon-moon: '🌙';

    /* Status Colors - Dark Mode */
    --status-discontinued-bg: #5a3e3e; /* Dark red-brown */
    --status-discontinued-text: #ffb3b3; /* Light pink */
    --status-archived-bg: #5a5a5a;     /* Medium grey */
    --status-archived-text: #d0d0d0;   /* Light grey */
    --status-handed-over-bg: #3e5a5a;  /* Dark cyan/teal */
    --status-handed-over-text: #b3ffff; /* Light cyan */
    --status-deprecated-bg: #5a5a3e;   /* Dark yellow-olive */
    --status-deprecated-text: #ffffb3; /* Light yellow */
    --status-deleted-bg: #612f2f;      /* Darker red */
    --status-deleted-text: #ff9999;    /* Light red/pink */
}

body.light-mode {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #555555;
    --border-color: #dddddd;
    --accent-color: #6a1b9a; /* Darker Purple for Light Mode */
    --link-color: #6a1b9a;   /* Use accent color directly for links */
    --header-footer-bg: #eeeeee;
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Status Colors - Light Mode (Defined for contrast) */
    --status-discontinued-bg: #fce4ec; /* Light pink */
    --status-discontinued-text: #ad1457; /* Dark magenta */
    --status-archived-bg: #eeeeee;     /* Light grey */
    --status-archived-text: #5f6368;   /* Dark grey */
    --status-handed-over-bg: #e0f7fa;  /* Light cyan */
    --status-handed-over-text: #006064; /* Dark cyan */
    --status-deprecated-bg: #fff9c4;   /* Light yellow */
    --status-deprecated-text: #f9a825; /* Dark yellow/amber */
    --status-deleted-bg: #d32f2f;      /* Medium red */
    --status-deleted-text: #ffffff;    /* White */
}


/* --- General Styles --- */
body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2 {
    margin-bottom: 0.5em;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
}

h2 {
    font-size: 1.5rem;
    margin-left: 0.5em; /* Space between icon and title */
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* --- Header --- */
header {
    background-color: var(--header-footer-bg);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.header-content {
    flex-grow: 1;
}

header h1 {
    text-align: center;
    font-size: 2rem; /* Slightly smaller H1 in header */
    margin-bottom: 0.2em;
}

header .tagline {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

header nav {
    text-align: center;
}

header nav a {
    margin: 0 1rem;
    font-size: 1rem;
    font-weight: 700;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.5rem;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    margin-left: 1rem; /* Space from nav */
}

#theme-toggle:hover {
    background-color: var(--card-bg);
    border-color: var(--accent-color);
}

/* Set icon based on theme */
body:not(.light-mode) #theme-toggle::before { /* Default to dark mode icon */
    content: var(--icon-sun);
}
body.light-mode #theme-toggle::before {
    content: var(--icon-moon);
}


/* --- Main Content & Graveyard --- */
main {
    flex-grow: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto; /* Center content */
    width: 100%;
}

.graveyard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* --- Project Card --- */
.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-header .icon {
    font-size: 1.8rem;
    line-height: 1;
    /* Removed margin-right here, handled by h2 margin-left */
}

.project-card h2 { /* Target h2 inside card specifically if needed */
     margin-left: 0.5em; /* Keep space between icon and title */
     font-size: 1.4rem; /* Slightly smaller card titles */
     color: var(--text-color); /* Ensure card title uses main text color */
     /* Remove margin-bottom if spacing is handled by card padding/other elements */
     margin-bottom: 0;
}


.project-card .timeline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    margin-top: 0.2rem; /* Add slight space below header */
}

.project-card .description {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex-grow: 1; /* Makes description take up space */
}

.project-card .fate {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 0.8rem;
}

.project-card .links {
    margin-top: auto; /* Pushes links to the bottom */
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.project-card .links a {
    margin-right: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Status Tags */
.status {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem; /* Space below status tag */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3; /* Ensure text fits well */
}

/* Apply status colors using specific classes */
.status-discontinued {
    background-color: var(--status-discontinued-bg);
    color: var(--status-discontinued-text);
}
.status-archived {
    background-color: var(--status-archived-bg);
    color: var(--status-archived-text);
}
.status-handed-over {
    background-color: var(--status-handed-over-bg);
    color: var(--status-handed-over-text);
}
.status-deprecated {
     background-color: var(--status-deprecated-bg);
     color: var(--status-deprecated-text);
}
.status-deleted {
     background-color: var(--status-deleted-bg);
     color: var(--status-deleted-text);
}

/* --- Footer --- */
footer {
    background-color: var(--header-footer-bg);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto; /* Pushes footer down */
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--text-muted);
    font-weight: 700;
}

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

/* --- Responsiveness --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }
    .header-content {
        width: 100%; /* Ensure content takes full width before wrapping */
    }
    header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.1em;
    }
    header .tagline {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    header nav {
         margin-bottom: 0.8rem; /* Add space between nav and button when wrapped */
    }
    header nav a {
        margin: 0 0.75rem;
    }
    #theme-toggle {
        margin-top: 0; /* Remove top margin if nav has bottom margin */
        margin-left: 0;
        align-self: center; /* Center button when wrapped */
    }
    main {
        padding: 1rem;
    }
    .graveyard {
        grid-template-columns: 1fr; /* Stack cards on small screens */
        gap: 1rem;
    }
    h1 { /* Main page H1 */
        font-size: 1.8rem;
        text-align: center; /* Center main H1 on small screens */
    }
    h2 { /* General h2 */
        font-size: 1.3rem;
    }
   .project-card h2 { /* Card titles on small screens */
        font-size: 1.2rem;
   }
   .card-header .icon {
        font-size: 1.6rem; /* Slightly smaller icon */
   }
}