@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&display=swap');

:root {
    /* Colors */
    --bg-color: #111;
    --text-color: #e0e0e0;
    --accent-color: #00ff9d;
    --link-color: #fff;
    --link-hover-color: #00ff9d;
    --secondary-color: #333;
    --code-bg: #1a1a1a;
    --quote-bg: #1a1a1a;
    --hover-color: #00cc7a;

    /* Fonts */
    --font-serif: 'EB Garamond', 'Charter', 'Bitstream Charter', 'Sitka Text', serif;
    --font-mono: monospace;
}

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

::selection {
    background-color: rgba(0, 255, 157, 0.3);
    /* Softer, transparent accent */
    color: inherit;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    font-size: 1.2rem;
    /* Slightly reduced from 1.25rem */
    line-height: 1.5;
    /* Reduced from 1.6 */
    padding: 1.5rem;
    /* Reduced from 2rem */
    max-width: 900px;
    /* Increased slightly for index/list view comfort */
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Typography & Layout */
.container {
    max-width: 100%;
}

header {
    margin-bottom: 1.5rem;
    /* Reduced from 2rem */
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    /* Reduced from 1rem */
    text-align: center;
}

h1 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.8rem;
    /* Reduced from 2.2rem */
    line-height: 1.1;
    margin-bottom: 0.1rem;
    letter-spacing: -0.02em;
}

h1 span {
    font-weight: 700;
    /* Make the name slightly bolder */
}

h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    /* Reduced */
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 0.2rem;
}

.post-layout h2 {
    color: var(--accent-color);
}

h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

h4 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-color);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    /* Reduced from 1.5rem */
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* Drop Cap */
.drop-cap::first-letter {
    float: left;
    font-size: 3.8rem;
    line-height: 0.8;
    padding-right: 0.5rem;
    padding-top: 0.1rem;
    color: var(--accent-color);
    font-family: var(--font-serif);
    font-weight: 700;
}


/* Links */


a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--secondary-color);
    transition: all 0.2s ease;
}

a:hover {
    color: var(--link-hover-color);
    border-bottom: 1px solid var(--link-hover-color);
    background-color: rgba(0, 255, 157, 0.1);
}

/* Navigation */
nav {
    margin-bottom: 0;
    /* Removed margin as it's now part of flex group */
}

.header-title-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    margin-bottom: 0.1rem;
    position: relative;
}

.header-title-group nav {
    grid-column: 1;
    justify-self: end;
    /* Place next to title */
    display: flex;
    align-items: center;
    padding-right: 1rem;
    /* Gap to title */
}

.header-title-group h1 {
    grid-column: 2;
    margin: 0;
    line-height: 1;
    /* white-space: nowrap; Removed to allow wrapping */
}

.back {
    text-decoration: none;
    color: var(--accent-color);
    font-family: var(--font-serif);
    font-size: 1.5rem;
    /* Larger for arrow */
    line-height: 1;
    border-bottom: none;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
    padding: 0.5rem;
    /* Hit area */
    margin-left: -1rem;
    /* Pull slightly left to balance center */
}

.back:hover {
    text-decoration: none;
    background-color: transparent;
    border-bottom: none;
    transform: translateX(-3px);
}

/* Meta Info */
.meta {
    font-family: var(--font-serif);
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.intro {
    font-family: var(--font-serif);
    /* Switched to Serif */
    color: #888;
    font-size: 0.9rem;
    /* Reduced from 1rem */
    margin-top: 0;
    font-style: italic;
    /* Added italic for style */
}

section {
    margin-bottom: 2.5rem;
    /* Reduced from 3rem */
}

.content hr {
    border: 0;
    border-top: 1px solid var(--secondary-color);
    margin-top: 3rem;
    margin-bottom: 4rem;
    display: block;
    width: 100%;
}

/* Content Container */
.content {
    margin-top: 1.5rem;
}

/* Lists */
.content ul,
.content ol {
    margin: 0.5rem 0 1rem 1.5rem;
    padding-left: 0;
}

.content li {
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

.content li::marker {
    color: var(--accent-color);
}


.content ul {
    list-style-type: disc;
}

.content ol {
    list-style-type: decimal;
}

/* Blockquotes */
blockquote {
    background: var(--quote-bg);
    border-left: 3px solid var(--accent-color);
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    font-style: italic;
    color: #ccc;
    border-radius: 0 4px 4px 0;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    border: 1px solid var(--secondary-color);
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.85rem;
}

code {
    font-family: var(--font-mono);
    background: var(--code-bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.85em;
}

pre code {
    background: transparent;
    padding: 0;
    font-size: 1em;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
    border: 1px solid var(--secondary-color);
}

.thumbnail {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--secondary-color);
    filter: brightness(0.8);
}

/* Footnotes */
.footnotes {
    margin-top: 3rem;
    border-top: 1px solid var(--secondary-color);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: #888;
    text-align: left;
}

.footnotes p {
    text-align: left;
}


.footnotes ol {
    margin-left: 1.5rem;
}

/* Footer */
footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    font-family: var(--font-serif);
}

/* --- Index / Projects Specific Styles --- */

.intro {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    text-align: center;
    font-style: italic;
}

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

.contact,
.articles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-link,
.article-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.03);
    /* Subtle glass feel */
    color: var(--text-color);
    padding: 1.5rem;
    /* More breathing room */
    border-radius: 12px;
    /* Softer corners */
    border: 1px solid var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smooth physics */
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-link::before,
.article-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 157, 0.01), transparent);
    /* Extremely subtle shine */
    transform: translateX(-100%);
    transition: transform 0.8s;
    /* Slower, more relaxed */
}

.project-link:hover,
.article-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    /* Minimal lift */
    border-color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* Very soft shadow */
}

.project-link:hover::before,
.article-link:hover::before {
    transform: translateX(100%);
}

.project-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    /* Slightly larger */
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: var(--font-serif);
    color: #fff;
    /* Brighter title */
}

.project-logo {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    border: none;
    margin: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.description {
    color: #aaa;
    /* Softer text */
    font-size: 1rem;
    font-family: var(--font-serif);
    line-height: 1.5;
}

/* Contact Links */
.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    /* More space */
    justify-content: center;
    margin-top: 1rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.contact-link:hover {
    color: var(--bg-color);
    /* Invert text for contrast */
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    /* Micro lift */
    box-shadow: 0 0 8px rgba(0, 255, 157, 0.2), 0 0 2px rgba(0, 255, 157, 0.1);
    /* Faint glow */
    text-shadow: none;
}

/* Terminal Cursor */
.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 1.5rem;
    background-color: var(--accent-color);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 4px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Articles List Specifics (from articles.html) */
ul.posts {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Even tighter gap */
    margin: 0;
}

a.post-link {
    text-decoration: none;
    background: transparent;
    /* Remove background for cleaner look */
    color: var(--text-color);
    padding: 0.5rem 0;
    /* Minimal padding */
    border-radius: 0;
    border-left: none;
    /* Remove border */
    display: flex;
    align-items: flex-start;
    /* Align to top */
    gap: 1rem;
    transition: all .2s ease;
    border-bottom: 1px solid #222;
    /* Subtle separator */
}

a.post-link:hover {
    background-color: transparent;
    transform: translateX(5px);
    border-bottom: 1px solid var(--accent-color);
    /* Highlight separator on hover */
}

.post-thumbnail {
    width: 120px;
    /* Slightly larger for better visibility */
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--secondary-color);
    flex-shrink: 0;
    margin: 0;
    filter: brightness(0.7);
    transition: filter 0.2s ease;
}

a.post-link:hover .post-thumbnail {
    filter: brightness(1);
    border-color: var(--accent-color);
}

.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    justify-content: center;
}

.post-title {
    font-weight: 600;
    color: var(--text-color);
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.2;
}

a.post-link:hover .post-title {
    color: var(--accent-color);
}

.post-description {
    color: #888;
    font-size: 0.95rem;
    line-height: 1.4;
    font-family: var(--font-serif);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.2rem;
    font-family: var(--font-serif);
}

/* Donation Specifics */
/* Donation Specifics */
.donation-option {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.donation-option:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.crypto-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-serif);
    font-weight: 600;
}

.crypto-icon {
    width: 32px;
    height: 32px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--bg-color);
    font-size: 1.1rem;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.donation-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

.address-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.address-input {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
    padding: 1rem;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    width: 100%;
    transition: all 0.2s ease;
}

.address-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.1);
}

.copy-button {
    align-self: flex-start;
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-serif);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.copy-button:hover {
    border-color: var(--accent-color);
    color: var(--bg-color);
    background-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.2);
}

.copy-button.copied {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-link {
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s ease;
    border-bottom: 1px dotted transparent;
}

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

.qr-code {
    background-color: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.qr-label {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    color: #888;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    body {
        padding: 1rem;
        font-size: 1.1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .content p {
        text-align: left;
    }

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

    .qr-container {
        order: -1;
        margin-bottom: 1rem;
    }

    a.post-link {
        padding: 0.75rem;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .post-thumbnail {
        width: 80px;
        height: 48px;
    }

    /* Mobile Header Fixes */
    .header-title-group {
        display: grid;
        grid-template-columns: 1fr;
        align-items: center;
        gap: 0;
    }

    .header-title-group nav {
        display: none;
    }

    .header-title-group h1 {
        grid-column: 1;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
        font-size: 1.6rem;
        width: 100%;
    }
}