:root {
    --green-dark: #102e15;
    --green-pure: #1B4222;
    --green-mint: #7BB848;
    --green-glow: #7bb8484d;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(123, 184, 72, 0.2);
    --top-buffer: 5vh;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Always reserve scrollbar gutter so layout never shifts horizontally
   between short pages (no scrollbar) and long pages (scrollbar). */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--green-mint) transparent;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--green-mint); border-radius: 4px; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--green-dark);
    color: var(--white);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    padding: var(--top-buffer) 0 0 0;
}

/* Background layers fixed so they stay full-viewport on long pages */
.grid-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(123, 184, 72, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(123, 184, 72, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1; pointer-events: none;
}

#particle-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2; pointer-events: none;
}

.glow-spot {
    position: fixed; width: 600px; height: 600px;
    background: radial-gradient(circle, var(--green-glow) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 3; animation: pulse 8s infinite alternate; pointer-events: none;
}

.container {
    position: relative; z-index: 10; width: 88%; max-width: 1000px; text-align: center;
}

/* The loaf: rounded top, flat base, always reaches the bottom */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    padding: 2.5rem 2.5rem 6rem;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - var(--top-buffer));
}

/* Logo as home button â€” fixed dimensions so it never shifts between pages
   or during font/image load. .logo-text overrides all h1 element styles
   explicitly so it renders identically whether the tag is h1 or span. */
.logo-wrapper {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem; gap: 12px;
    height: 64px;          /* fixed â€” prevents vertical jump during font swap */
    text-decoration: none;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
a.logo-wrapper:hover { opacity: 0.85; cursor: pointer; }

.logo-icon {
    width: 55px;
    height: 55px;          /* explicit â€” reserves space before image loads */
    aspect-ratio: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(123, 184, 72, 0.3));
}
.logo-text {
    /* Layout */
    font-family: 'Poppins', sans-serif; font-weight: 600;
    font-size: 3.2rem; line-height: 1; letter-spacing: -1.5px;
    padding: 0; margin: 0;  /* kill h1 default margin-bottom */
    /* Neutralise h1 gradient that would otherwise override .text-pure/.text-mint */
    background: none;
    -webkit-background-clip: initial; -webkit-text-fill-color: initial;
    background-clip: initial; color: inherit;
    /* Neutralise other h1 rules */
    text-wrap: unset;
}
.text-pure { color: var(--white); }
.text-mint {
    background: linear-gradient(to right, #6CAE3E, #8BC75A);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

h1 {
    font-size: 2.2rem; margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--green-mint));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-wrap: balance; line-height: 1.2;
}
p.subtitle { color: #ccc; font-size: 1.15rem; margin-bottom: 1.75rem; font-weight: 300; line-height: 1.5; }

/* Section heading inside a page (e.g. "Open Source", "Paid") */
.section-heading {
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.5px;
    margin: 0.25rem 0 1.1rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid var(--green-mint);
    line-height: 1.1;
}
.section-heading:not(:first-of-type) { margin-top: 2.5rem; }

/* Stacked single-column card list (used for software section). */
.cards-stack {
    display: flex; flex-direction: column; gap: 14px; margin-bottom: 1.5rem;
}
.cards-stack .project-link { padding: 18px 22px; }
.cards-stack .project-title { font-size: 1.1rem; }

.projects-grid {
    display: grid; gap: 12px; margin-bottom: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.project-link {
    background: rgba(0,0,0,0.3); padding: 16px 20px; border-radius: 12px;
    border: 1px solid var(--border); text-decoration: none; color: white;
    transition: 0.3s; display: block; text-align: left; position: relative;
    overflow: hidden;
}
.project-link:hover {
    background: rgba(0,0,0,0.5); border-color: var(--green-mint);
    transform: translateY(-2px);
}
.project-title { font-weight: 600; color: var(--green-mint); margin-bottom: 6px; font-size: 1rem; }
.project-desc { font-size: 0.9rem; color: #aaa; font-weight: 300; line-height: 1.4; }
.free-tag {
    position: absolute; top: -30px; right: -30px;
    width: 60px; height: 60px;
    background: var(--green-mint);
    transform: rotate(45deg);
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 6px;
    color: white; font-size: 0.6rem; font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    box-shadow: -2px 2px 6px rgba(0,0,0,0.3);
}
.free-tag::after {
    content: ''; position: absolute;
    bottom: -3px; left: -10px; right: -10px;
    height: 0.5px; background: var(--green-mint);
}
.price-tag {
    position: absolute; top: -30px; right: -30px;
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #d4a017, #b8860b);
    transform: rotate(45deg);
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 6px;
    color: white; font-size: 0.6rem; font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    box-shadow: -2px 2px 6px rgba(0,0,0,0.3);
}

/* Section nav cards on home */
.section-card {
    background: rgba(0,0,0,0.3); padding: 18px 22px; border-radius: 12px;
    border: 1px solid var(--border); text-decoration: none; color: white;
    transition: 0.3s; display: block; margin-bottom: 14px; text-align: left;
}
.section-card:hover {
    background: rgba(0,0,0,0.5); border-color: var(--green-mint);
    transform: translateY(-2px);
}
.section-card h3 { font-size: 1.25rem; color: var(--green-mint); margin-bottom: 6px; font-weight: 600; }
.section-card p { font-size: 0.95rem; color: #bbb; line-height: 1.5; font-weight: 300; }

/* Blog post listing */
.post-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 1.5rem; }
.post-item { text-align: left; }
.post-item-date { font-size: 0.8rem; color: #888; margin-bottom: 6px; }
.post-item-title { font-weight: 600; color: var(--green-mint); margin-bottom: 6px; font-size: 1.05rem; }
.post-item-excerpt { font-size: 0.9rem; color: #aaa; font-weight: 300; line-height: 1.4; }

/* Long-form post body */
.post-content { color: #ccc; line-height: 1.85; text-align: left; }
.post-content h2 { font-size: 1.4rem; color: var(--green-mint); margin: 1.8rem 0 0.9rem; }
.post-content p { margin-bottom: 1.1rem; }
.post-content a { color: var(--green-mint); }
.post-meta { font-size: 0.85rem; color: #888; margin-bottom: 1.5rem; text-align: left; }

.product-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 1rem 0 1.8rem;
    text-align: left;
}
.product-buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 15px 30px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green-mint), var(--green-pure));
    color: white;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 28px rgba(123, 184, 72, 0.3);
    transition: 0.3s;
}
.product-buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(123, 184, 72, 0.45);
}
.product-price {
    color: var(--green-mint);
    font-size: 1.2rem;
}
.product-cta-note {
    color: #aaa;
    font-size: 0.95rem;
}

/* Social */
.social-links { display: flex; gap: 16px; justify-content: center; margin-bottom: 1.75rem; flex-wrap: wrap; }
.social-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 20px; text-decoration: none;
    background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    color: white; font-size: 0.9rem; transition: 0.3s;
}
.social-link:hover { background: rgba(0,0,0,0.5); border-color: var(--green-mint); }

/* Form */
.input-group { display: flex; flex-direction: column; gap: 12px; max-width: 500px; margin: 0 auto; }
input[type="email"], textarea {
    padding: 14px 24px; border-radius: 12px; border: 1px solid var(--border);
    background: rgba(0,0,0,0.3); color: white; outline: none; width: 100%; font-size: 1rem; transition: 0.3s;
    font-family: 'Outfit', sans-serif;
}
textarea { resize: vertical; min-height: 110px; }
input[type="email"]::placeholder, textarea::placeholder { color: rgba(255,255,255,0.4); }
input[type="email"]:focus, textarea:focus { border-color: var(--green-mint); background: rgba(0,0,0,0.5); }
button {
    padding: 14px 35px; border-radius: 50px; border: none;
    background: linear-gradient(135deg, var(--green-mint), var(--green-pure));
    color: white; font-weight: 700; cursor: pointer; transition: 0.3s; white-space: nowrap;
    font-family: 'Outfit', sans-serif;
}
button:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(123, 184, 72, 0.4); }

/* Download button on file cards */
.download-btn {
    display: inline-block; padding: 8px 16px;
    background: linear-gradient(135deg, var(--green-mint), var(--green-pure));
    color: white; text-decoration: none; border-radius: 8px;
    font-size: 0.9rem; font-weight: 600; transition: 0.3s; margin-top: 8px;
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(123, 184, 72, 0.3); }
.file-meta { font-size: 0.85rem; color: #888; margin: 10px 0 6px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

@keyframes pulse {
    0% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.2); }
}

@media (max-width: 600px) {
    .logo-text { font-size: 2.5rem; } .logo-icon { width: 40px; }
    .projects-grid { grid-template-columns: 1fr; }
    .glass-card { padding: 2rem 1.5rem 5rem; }
}

