:root {
    --primary-color: #1db954;
    --dark-bg: #1a1a1a;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e0e0e0;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

nav {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2d2d2d 100%);
    color: white;
    padding: 1.2rem 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

nav ul li {
    display: inline;
    margin: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
}

nav ul li a:hover {
    background-color: var(--primary-color);
    color: white;
}

nav ul li a.active {
    font-weight: bold;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    color: white;
}

header div {
    width: 100%;
    padding: 1rem;
}

header div h1,
header p {
    margin: 0;
}

header h1 {
    font-size: 3em;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.3em;
    margin-bottom: 0;
    opacity: 0.95;
}

header img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 15px;
    object-fit: cover;
    object-position: top;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

main {
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    text-align: center;
    padding: 3rem 2rem;
    margin: 1rem 0;
}

section h2 {
    font-size: 2.5em;
    margin: 0 0 1.5rem 0;
    text-align: center;
    color: var(--text-primary);
    font-weight: 700;
}

section p {
    font-size: 1.1em;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 700px) {
    section#about {
        width: 90%;
        margin: 1rem auto;
    }
    header {
        flex-direction: row;
        padding: 3rem;
    }
}

@media (min-width: 768px) {
    header div {
        width: 50%;
    }
}

@media (min-width: 850px) {
    header div {
        width: 45%;
    }
    header h1 {
        font-size: 3.5em;
    }
}

section#portfolio {
    background: white;
    padding: 3rem 2rem;
    border-radius: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

section#portfolio ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    padding: 0;
    width: 100%;
    list-style: none;
}

section#portfolio ul li {
    list-style-type: none;
}

section#portfolio ul li div {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

section#portfolio ul li div:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

section#portfolio p {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.spotLink {
    color: white;
    text-decoration: none;
    font-weight: bold;
    background-color: var(--primary-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 0;
    transition: var(--transition);
    display: inline-block;
}

.spotLink:hover {
    background-color: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

section#about {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

section#community,
section#teaching,
section#grounded {
    padding: 3rem 2rem;
    background-color: white;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

section#teaching {
    background: linear-gradient(180deg, white 0%, var(--light-bg) 100%);
}

section#donate {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1aa34a 100%);
    color: white;
    padding: 3rem 2rem;
    margin: 0;
    text-align: center;
}

section#donate h2 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 1.5rem;
}

section#donate p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1em;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.donate-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.donate-btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: var(--transition);
    color: white;
    border: 2px solid white;
}

.patreon-btn {
    background-color: rgba(255, 255, 255, 0.2);
}

.patreon-btn:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.coffee-btn {
    background-color: rgba(255, 255, 255, 0.2);
}

.coffee-btn:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

footer {
    background-color: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 2rem;
    position: relative;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

footer .footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

footer .footer-section {
    text-align: center;
}

footer .footer-section h4 {
    margin-top: 0;
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 600;
}

footer .social-links {
    list-style-type: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

footer .social-links li {
    display: inline;
    margin: 0 0.8rem;
}

footer .social-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

footer .social-links a:hover {
    color: #1ed760;
    text-decoration: underline;
}

footer p {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

/* Popup Styles */
.popup {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup.hidden {
    display: none;
}

.popup-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: var(--transition);
}

.popup-close:hover {
    color: var(--primary-color);
    font-size: 32px;
}

.popup-content h2 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.8em;
}

.popup-content p {
    color: var(--text-secondary);
    font-size: 1.05em;
}

.popup-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: bold;
    margin-top: 1.5rem;
    transition: var(--transition);
}

.popup-button:hover {
    background-color: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

/* Content grid and card styles */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem auto;
    padding: 0 1rem;
    max-width: 1100px;
}

.card {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3em;
    font-weight: 600;
}

.card p {
    color: var(--text-secondary);
    font-size: 1em;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav ul {
        gap: 0.5rem;
    }
    
    nav ul li a {
        padding: 0.5rem 0.7rem;
        font-size: 0.9em;
    }

    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 2em;
    }

    header p {
        font-size: 1.1em;
    }

    section {
        padding: 2rem 1rem;
    }

    section h2 {
        font-size: 2em;
    }

    section p {
        font-size: 1em;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    footer .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .donate-buttons {
        flex-direction: column;
    }

    .donate-btn {
        width: 100%;
    }

    .popup-content {
        width: 90%;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    section h2 {
        font-size: 1.5em;
    }

    section#portfolio ul {
        grid-template-columns: 1fr;
    }

    nav ul li a {
        padding: 0.4rem 0.5rem;
        font-size: 0.85em;
    }
}