/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* --- CSS Variables --- */
:root {
    --background-color: #ffffff;
    --text-color: #111111;
    --border-color: #e0e0e0;
    --tag-bg-color: #111111;
    --tag-text-color: #ffffff;
    --button-hover-bg: #f5f5f5;
}

body.dark-mode {
    --background-color: #111111;
    --text-color: #ffffff;
    --border-color: #333333;
    --tag-bg-color: #ffffff;
    --tag-text-color: #111111;
    --button-hover-bg: #222222;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* --- Main Container --- */
.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header / Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    padding: 1.5rem 0;
    flex-shrink: 0;
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 1.5rem;
    border-left: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

nav a:hover {
    background-color: var(--button-hover-bg);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 1.5rem;
    border-left: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--text-color);
}

/* --- Main Content --- */
main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.description {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 700px;
    line-height: 1.7;
}

/* --- Hero CTA Buttons --- */
.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.cta-btn:hover {
    background-color: var(--button-hover-bg);
}

.cta-btn-outline {
    background-color: var(--text-color);
    color: var(--background-color);
    border-color: var(--text-color);
}

.cta-btn-outline:hover {
    background-color: var(--background-color);
    color: var(--text-color);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tag:hover {
    background-color: var(--text-color);
    color: var(--background-color);
}

.tag svg {
    width: 14px;
    height: 14px;
    fill: var(--text-color);
}

.tag:hover svg {
    fill: var(--background-color);
}

/* --- Cert Section --- */
.cert-section {
    padding: 2rem 4rem;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.cert-card:hover {
    background-color: var(--button-hover-bg);
}

.cert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.cert-card .cert-name {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.4;
}

.cert-card .cert-issuer {
    display: block;
    font-size: 0.75rem;
    opacity: 0.5;
    margin-top: 0.25rem;
}

/* --- Section Styling --- */
.section {
    padding: 4rem;
    border-top: 1px solid var(--border-color);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

.project-card {
    border: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

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

.project-card h3 {
    font-size: 1.2rem;
    margin: 0;
}

.external-link svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--text-color);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.external-link:hover svg {
    transform: translate(2px, -2px);
    opacity: 0.7;
}

.project-card p {
    font-size: 0.9rem;
    opacity: 0.8;
    flex-grow: 1;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Restored project tag spacing */
.project-card .tags {
    margin-bottom: 1.5rem;
}

.project-link {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    text-align: center;
    transition: background-color 0.2s ease;
}

.project-link:hover {
    background-color: var(--button-hover-bg);
}

/* --- Blog Section --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    border: 1px solid var(--border-color);
    padding: 2rem;
}

.blog-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.blog-card p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.blog-card a {
    color: var(--text-color);
    text-decoration: underline;
}

/* --- Journal Section --- */
.journal-entry {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.journal-meta {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.journal-entry p {
    font-size: 1rem;
    line-height: 1.6;
}

.more-entries-link-container {
    text-align: center;
    margin-top: 2rem;
}

.more-entries-link {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s ease;
}

.more-entries-link:hover {
    background-color: var(--button-hover-bg);
}

/* --- Disabled Project Link --- */
.project-link-disabled {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    text-align: center;
    opacity: 0.5;
    cursor: default;
}

/* --- Resume Link --- */
.resume-link-container {
    margin-top: 2rem;
}

.resume-link {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s ease;
}

.resume-link:hover {
    background-color: var(--button-hover-bg);
}

/* --- Footer --- */
footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border-color);
}

footer a {
    text-align: center;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

footer a:first-child {
    border-right: 1px solid var(--border-color);
}

footer a:hover {
    background-color: var(--button-hover-bg);
}

/* --- Footer Cert Strip --- */
.cert-strip {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.cert-strip a {
    font-size: 0.7rem;
    opacity: 0.5;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 0;
    border: none;
    transition: opacity 0.2s;
}

.cert-strip a:hover {
    opacity: 1;
    background: none;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    header { padding: 0 1rem; flex-direction: column; align-items: stretch; }
    .logo { text-align: center; padding: 1rem 0; border-bottom: 1px solid var(--border-color); }
    nav { justify-content: center; }
    nav a { flex-grow: 1; text-align: center; padding: 1rem; border-left: 1px solid var(--border-color); }
    main, .section { padding: 2rem; }
    .cert-section { padding: 1.5rem 2rem; }
    h1 { font-size: 2rem; }
    .cert-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        align-items: stretch;
    }

    nav a,
    .theme-toggle {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .hero-cta {
        flex-direction: column;
    }

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

    footer {
        grid-template-columns: 1fr;
    }

    footer a:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .cert-strip {
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
}