:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-text-primary: #212529;
    --color-text-secondary: #495057;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    --color-primary: #0d6efd;
    --color-primary-hover: #0b5ed7;
    --color-primary-light: #e7f0fe;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --transition-speed: 0.2s;
    --sticky-nav-offset: 120px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.page-content {
    flex-grow: 1;
    width: 100%;
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

ul,
ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

u {
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

header {
    padding: 0.75rem 1.5rem;
    background-color: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--color-border);
    box-sizing: border-box;
}

.header-text {
    text-align: center;
    font-size: 1rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    min-height: 25vh;
    padding: 2rem 1.5rem;
    gap: 3rem;
    perspective: 1000px;
}

.hero-logo {
    max-width: 24rem;
    height: auto;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: rotateX(0) rotateY(0);
}

.hero p {
    font-size: clamp(1.75rem, 2vw, 3rem);
    font-weight: 500;
    text-align: left;
    line-height: 1.1;
    margin: 0;
    color: var(--color-text-primary);
}

.hero-divider {
    width: 2px;
    height: 10rem;
    background-color: var(--color-border);
    border-radius: 2px;
}

.hero.hero--streamlined {
    min-height: auto;
    padding: 2rem 1.5rem;
    gap: 2rem;
}

.hero.hero--streamlined .hero-logo {
    max-width: 16rem;
    transition: none;
    transform: none !important;
}

.hero.hero--streamlined .hero-divider {
    height: 6rem;
}

.hero.hero--streamlined p {
    font-size: 1.5rem;
    line-height: 1.3;
}

nav.horizontal-menu {
    position: sticky;
    top: var(--header-height, 60px);
    z-index: 99;
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: rgba(248, 249, 250, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.horizontal-menu ul {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style-type: none;
    margin: 0;
    padding: 0;
    gap: 1rem 3rem;
    flex-wrap: wrap;
}

.horizontal-menu ul li {
    margin: 0;
}

.horizontal-menu ul li a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    white-space: nowrap;
}

.horizontal-menu ul li a:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--color-text-primary);
    text-decoration: none;
}

.rainbow-button-wrapper {
    position: relative;
}

.rainbow-menu {
    position: relative;
    z-index: 2;
    color: white !important;
    font-weight: 700 !important;
    background: linear-gradient(45deg, #f94144, #f3722c, #f8b400);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.rainbow-menu-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    color: transparent;
    background: linear-gradient(45deg, #f94144, #f3722c, #f8b400);
    filter: blur(15px);
    opacity: 0;
    transform: scale(0.95);
}

.rainbow-button-wrapper:hover .rainbow-menu {
    transform: translateY(-2px);
}

.page-chapter {
    padding: 5rem 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--color-border);
}

.page-chapter:last-child {
    border-bottom: none;
}

.chapter-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.chapter-header h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.chapter-header.chapter-header--tight {
    margin-bottom: 2rem;
}

.chapter-header.chapter-header--tight h2 {
    margin-bottom: 1.25rem;
}

.static-page-container {
    max-width: 1400px;
    margin: 4rem auto 0.5rem auto;
    padding: 2rem 3rem;
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* Reduce spacing below project headings */
.page-chapter .static-page-container {
    margin-top: 2rem;
}

.static-page-container h1 {
    font-size: 2.25rem;
    text-align: center;
}

.static-page-container h2 {
    font-size: 1.75rem;
}

.static-page-container p,
.static-page-container li {
    line-height: 1.7;
}

.code-font {
    display: inline-block;
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", "Courier New", monospace;
    color: var(--color-primary);
    background-color: rgba(13, 110, 253, 0.1);
    padding: 0.2em 0.5em;
    border-radius: 6px;
    font-weight: 500;
}

.blinking-cursor {
    font-weight: 700;
    margin-left: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.blinking-cursor.is-typing {
    opacity: 1;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    49% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

.explainer {
    background-color: var(--color-surface);
    padding: 3rem 1.5rem 5rem;
    text-align: center;
    position: relative;
}

.explainer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: var(--color-bg);
    clip-path: ellipse(75% 100% at 50% 100%);
}

.explainer p {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    max-width: 800px;
    margin: 0 auto;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.dual-panel-section.page-chapter {
    padding-top: 2rem;
    border-bottom: none;
}

.dual-panel-container {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.dual-panel-text {
    text-align: center;
}

.dual-panel-text h2 {
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", "Courier New", monospace;
    font-size: 1.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-text-secondary);
    background-color: rgba(0, 0, 0, 0.03);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    display: inline-block;
    margin-bottom: 2rem;
}

.dual-panel-text p,
.dual-panel-text li {
    text-align: left;
    font-size: 1.15rem;
}

.dual-panel-visual {
    position: relative;
    height: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

#global-network-container {
    cursor: grab;
}

#global-network-container.grabbing {
    cursor: grabbing;
}

#global-network-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.narrative-flow-wrapper {
    max-width: 1400px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
    display: flex;
    gap: 5rem;
}

.narrative-nav {
    flex: 1 1 35%;
    position: relative;
    max-width: 400px;
}

.narrative-nav-sticky-content {
    position: sticky;
    top: var(--sticky-nav-offset);
}

.narrative-nav h3 {
    font-size: clamp(1.75rem, 2vw, 3rem);
    font-weight: 500;
    line-height: 1.1;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

.narrative-nav p {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    position: relative;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.narrative-nav p::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(249, 65, 68, 0.5), rgba(243, 114, 44, 0.5), transparent);
    bottom: 0;
}

.narrative-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.nav-active-bar {
    position: absolute;
    left: -1.5rem;
    width: 3px;
    background: linear-gradient(180deg, #f94144, #f3722c, #f8b400);
    z-index: 1;
    transition: top 0.4s ease, height 0.4s ease;
    border-radius: 3px;
}

.narrative-nav .nav-item {
    font-size: 1.25rem;
    padding: 1.25rem 0;
    cursor: pointer;
    transition: color 0.3s ease;
    color: var(--color-text-muted);
    position: relative;
    z-index: 2;
}

.narrative-nav .nav-item.active {
    color: var(--color-text-primary);
    font-weight: 500;
}

.narrative-content {
    flex: 1 1 65%;
}

.narrative-step {
    padding: 3rem;
    margin-bottom: 2rem;
    opacity: 0.5;
    transition: opacity 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease;
}

.narrative-step.is-active-step {
    opacity: 1;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
}

.narrative-step h4 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.narrative-step p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.process-section {
    background-color: var(--color-bg);
}

.process-flow-container {
    max-width: 1050px;
    margin: 0 auto;
}

.process-flow-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

.process-flow-steps::before {
    content: '';
    position: absolute;
    background-color: var(--color-border);
    height: 2px;
    top: 24px;
    left: 75px;
    right: 75px;
    z-index: 1;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    width: 150px;
    z-index: 2;
}

.process-step span {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background-color: var(--color-surface);
    transition: all 0.3s ease;
}

.process-step p {
    margin-top: 0.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.process-step.active span,
.process-step:hover span {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.process-step.active p,
.process-step:hover p {
    color: var(--color-primary);
}

.process-flow-content {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 150px;
}

.process-content-pane {
    display: none;
}

.process-content-pane.active {
    display: block;
    animation: fade-in 0.5s ease;
}

.process-content-pane p:last-child {
    margin-bottom: 0;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spotlight-cta {
    background-color: var(--color-primary-light);
    padding: 3rem 1.5rem 4rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.spotlight-content h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-text-primary);
}

.spotlight-content p {
    color: var(--color-text-secondary);
    max-width: 650px;
    font-weight: 400;
    margin: 1.5rem auto 3rem auto;
    font-size: 1.15rem;
    line-height: 1.7;
}

.spotlight-button-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.spotlight-button {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    background: var(--color-surface);
    border: 2px solid var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.spotlight-button:hover {
    background: white;
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-lg);
}

.open-faq-section {
    background-color: var(--color-bg);
    padding-top: 3rem;
    padding-bottom: 2.5rem;
}

.open-faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0;
    max-width: 1000px;
    margin: 0 auto;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
}

.open-faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

.open-faq-section .chapter-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
}

.open-faq-section .chapter-header .subtitle {
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.open-faq-section .chapter-header {
    margin-bottom: 0.5rem;
}

.open-faq-answer {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.open-faq-answer>* {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.open-faq-answer>*:last-child {
    margin-bottom: 0;
}

.open-faq-answer ul {
    list-style-position: outside;
    padding-left: 2rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.contact-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.form-label-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin-top: -0.25rem;
    margin-bottom: 0.75rem;
}

.form-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

textarea.form-input {
    resize: vertical;
}

.form-submit-group {
    text-align: center;
    margin-top: 2rem;
}

.form-submit {
    display: inline-block;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-primary);
    color: white;
    background-color: var(--color-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition-speed) ease, transform 0.1s ease;
}

.form-submit:hover {
    background-color: var(--color-primary-hover);
    text-decoration: none;
    color: white;
}

.form-submit:active {
    transform: scale(0.98);
}

.form-success-container {
    text-align: center;
}

.form-success-container h3 {
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.auth-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(33, 37, 41, 0.7);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.auth-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    background: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.auth-modal-backdrop.active .auth-modal-content {
    transform: scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 2.5rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.auth-modal-content h3 {
    text-align: center;
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.auth-modal-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.input-error-message {
    color: #dc3545;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.4rem;
    height: 1rem;
}

.form-input.is-invalid {
    border-color: #dc3545;
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.auth-error-message,
.form-error-message {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
    display: none;
}

.auth-error-message.active,
.form-error-message.active {
    display: block;
}

#loginSubmitBtn:disabled {
    background-color: var(--color-primary);
    opacity: 0.5;
    cursor: not-allowed;
}

#loginSubmitBtn.is-loading,
#registerSubmitBtn.is-loading {
    opacity: 0.7;
    cursor: wait;
}

.donation-interactive-container {
    max-width: 600px;
    margin: 2rem auto 0 auto;
}

.donation-method-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.donation-tab-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
}

.donation-tab-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.donation-tab-button.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}

.donation-tab-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.donation-widget-panes {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    min-height: 640px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.donation-widget-pane {
    display: none;
    width: 100%;
    height: 100%;
    text-align: center;
}

.donation-widget-pane.active {
    display: block;
    animation: fade-in 0.4s ease;
}

.nowpayments-iframe {
    display: block;
    width: 100%;
    max-width: 360px;
    height: 570px;
    border: none;
    margin: 0 auto;
}

.card-widget-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.card-widget-text {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.stripe-button-container {
    padding-bottom: 2rem;
}

stripe-buy-button {
    margin: 0 auto;
}

footer {
    background-color: var(--color-surface);
    padding: 1rem 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    height: 60px;
    width: auto;
    display: block;
}

.footer-logo-link:hover {
    text-decoration: none;
}

.footer-link {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.footer-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}


.project-board-container {
    max-width: 1200px;
    margin: -1rem auto 0;
    padding: 0;
}

.page-chapter:has(.project-board-container) {
    padding-bottom: 2rem;
}

.project-section {
    margin-bottom: 3rem;
}

.project-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.project-section-title.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.project-section-title.pending {
    color: #ffc107;
    border-bottom-color: #ffc107;
}

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

.project-card {
    background: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.project-card.active {
    border-left: 4px solid var(--color-primary);
}

.project-card.pending {
    border-left: 4px solid #ffc107;
}


a.project-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.project-card:hover {
    text-decoration: none;
    color: inherit;
}

.project-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.project-status.active {
    background-color: #d4edda;
    color: #155724;
}

.project-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.project-description {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-meta {
    margin-bottom: 1rem;
}

.project-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.project-readiness {
    margin-bottom: 1rem;
}

.readiness-label {
    font-weight: 600;
    color: var(--color-text-primary);
}

.readiness-value {
    color: var(--color-text-secondary);
    margin-left: 0.5rem;
}

.project-dates {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.project-dates span {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.project-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.team-label {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.875rem;
}

.team-members {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.tasks-summary {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}


.project-overview {
    background: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.project-meta-info {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.meta-item {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.meta-item strong {
    color: var(--color-text-primary);
}

.project-manager {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manager-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manager-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.manager-name {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}


.project-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-bottom: 3px solid transparent;
    transition: all var(--transition-speed) ease;
}

.tab-button:hover {
    color: var(--color-text-primary);
    background-color: var(--color-bg);
}

.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.tab-button.disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.8;
    transform: none;
}

.tab-button.disabled:hover {
    background-color: #f5f5f5;
    transform: none;
    box-shadow: none;
    color: #999;
}

.tab-lock-icon {
    margin-left: 0.5rem;
    font-size: 0.8em;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


.task-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.task-section {
    background: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
}

.task-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.task-section-title.completed {
    color: #28a745;
    border-bottom-color: #28a745;
}

.task-section-title.ongoing {
    color: #007bff;
    border-bottom-color: #007bff;
}

.task-section-title.pending {
    color: #ffc107;
    border-bottom-color: #ffc107;
}

.task-icon {
    font-size: 1.5rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.task-item {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border-left: 4px solid var(--color-border);
    transition: all var(--transition-speed) ease;
}

.task-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.task-item.completed {
    border-left-color: #28a745;
}

.task-item.ongoing {
    border-left-color: #007bff;
}

.task-item.pending {
    border-left-color: #ffc107;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.task-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    flex: 1;
}

.task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.task-status.completed {
    background-color: #d4edda;
    color: #155724;
}

.task-status.ongoing {
    background-color: #cce7ff;
    color: #004085;
}

.task-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.task-description {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.task-progress {
    font-weight: 600;
    color: var(--color-primary);
}

.task-deadline {
    font-weight: 600;
    color: var(--color-text-primary);
}

.task-content {
    margin-bottom: 1rem;
}

.task-section-detail {
    margin-bottom: 1.25rem;
}

.task-section-detail h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-section-detail ul {
    margin: 0;
    padding-left: 1.25rem;
}

.task-section-detail li {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.task-contribution {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.contribution-button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    display: inline-block;
}

.contribution-button:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.contribution-button.disabled {
    background: var(--color-text-muted);
    color: var(--color-text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.contribution-button.disabled:hover {
    background: var(--color-text-muted);
    transform: none;
    box-shadow: none;
}

.task-dependency-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

.task-completed-by {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.completed-by-label {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.875rem;
}

.completed-by-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.completed-by-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.completed-by-name {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.project-cta {
    background: var(--color-primary-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
    border: 1px solid var(--color-primary);
}

.project-cta p {
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .spotlight-button {
    margin: 0;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 1011;
    position: relative;
    width: 30px;
    height: 24px;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-text-primary);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
    left: 0;
}

.mobile-menu-toggle span:nth-child(1) {
    top: 0;
}

.mobile-menu-toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle span:nth-child(3) {
    bottom: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 249, 250, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-links {
    text-align: center;
    overflow-y: auto;
    padding: 6rem 1.5rem 2rem;
    max-height: 100vh;
}

.mobile-menu-links a {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-links a:not(.rainbow-menu):hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.mobile-menu-links .rainbow-button-wrapper {
    margin-top: 1.5rem;
}

.mobile-menu-links .rainbow-menu {
    font-size: 1.25rem;
    padding: 0.75rem 1.5rem;
}

body.mobile-menu-open {
    overflow: hidden;
}

body.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

body.mobile-menu-open .mobile-menu-toggle span {
    background-color: var(--color-text-primary);
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

@media (max-width: 1024px) {
    .dual-panel-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .dual-panel-section.page-chapter {
        position: relative;
        top: -60px;
        margin-bottom: -60px;
        padding-bottom: 2rem;
    }

    .dual-panel-visual {
        grid-row: 1;
        height: 350px;
    }

    .dual-panel-text {
        text-align: left;
    }

    .narrative-flow-wrapper {
        flex-direction: column;
        gap: 0;
        margin-bottom: 2rem;
    }

    .narrative-nav {
        display: none;
    }

    .narrative-step {
        opacity: 0.6;
        background-color: transparent;
        box-shadow: none;
        border-radius: 0;
        padding: 3rem 1rem;
        margin-bottom: 0;
        transition: opacity 0.4s ease, background-color 0.4s ease;
    }

    .narrative-step.is-active-step {
        opacity: 1;
        background-color: var(--color-surface);
        box-shadow: var(--shadow-lg);
        border-radius: var(--border-radius);
    }

    .narrative-content .narrative-step:last-child {
        border-bottom: none;
    }

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

    .static-page-container {
        padding: 2rem 2.5rem;
        margin: 3.5rem auto 0.5rem auto;
    }

    .task-sections {
        gap: 1.75rem;
    }
}

@media (max-width: 992px) {
    .horizontal-menu {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .horizontal-menu ul {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    main>.page-chapter:first-child {
        padding-top: 0.5rem;
    }

    .page-chapter {
        padding: 4rem 1rem;
    }
    
    /* Reduce spacing between hamburger menu and page heading on mobile */
    .page-chapter[style*="padding-top: 2.5rem"] {
        padding-top: 1.5rem !important;
    }

    .spotlight-cta {
        padding: 4rem 1rem;
    }

    .open-faq-grid {
        border-top: none;
        padding-top: 0;
    }

    .open-faq-section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .open-faq-answer:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .hero .hero-logo-link {
        display: none;
    }

    .hero {
        flex-direction: column;
        min-height: 0;
        justify-content: flex-start;
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }

    .hero p {
        text-align: center;
        margin: 0;
    }

    nav.horizontal-menu {
        padding: 1rem;
        margin: 0;
    }

    .hero-divider {
        display: none;
    }

    .explainer {
        padding-top: 1.5rem;
    }

    .explainer .code-font {
        display: block;
        width: -moz-fit-content;
        width: fit-content;
        margin: 1.25rem auto 0;
    }

    .process-section.page-chapter {
        padding: 2.5rem 1rem;
        text-align: left;
    }

    .process-section .chapter-header {
        margin-bottom: 1.5rem;
    }

    .process-flow-steps {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .process-flow-steps::before {
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: auto;
        top: 20px;
        bottom: 20px;
    }

    .process-step {
        flex-direction: row;
        align-items: center;
        width: auto;
        max-width: 90%;
        margin: 0 auto;
        background-color: var(--color-surface);
        border-radius: 50px;
        box-shadow: var(--shadow-sm);
        padding: 0.4rem 1rem;
        gap: 0.75rem;
    }

    .process-step span {
        width: 36px;
        height: 36px;
    }

    .process-step p {
        margin: 0;
    }

    .process-flow-content {
        padding: 1.25rem;
        min-height: 0;
    }

    .process-content-pane h4 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .process-content-pane p {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 0;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .project-board-container {
        padding: 0.5rem 0;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-meta-row {
        gap: 1rem;
    }

    .static-page-container {
        padding: 1.5rem 2rem;
        margin: 3rem auto 0.5rem auto;
    }

    .project-tabs {
        gap: 0.25rem;
    }

    .tab-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .task-sections {
        gap: 1.5rem;
    }

    .task-item {
        padding: 1.25rem;
    }

    .project-meta-info {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-text {
        font-size: 0.8rem;
    }

    .horizontal-menu {
        padding: 0.75rem 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero p {
        font-size: 1.5rem;
    }

    .page-chapter {
        padding: 3rem 1rem;
    }
    
    /* Further reduce spacing on very small screens */
    .page-chapter[style*="padding-top: 2.5rem"] {
        padding-top: 1rem !important;
    }

    .chapter-header h2,
    .spotlight-content h2,
    .open-faq-section .chapter-header h2 {
        font-size: 1.8rem;
    }

    .narrative-step {
        padding: 1.5rem;
    }

    .spotlight-cta {
        padding: 3rem 1rem 3.5rem;
    }

    .spotlight-content p,
    .open-faq-section .chapter-header .subtitle {
        font-size: 1rem;
    }

    .spotlight-button-container {
        flex-direction: column;
        align-items: stretch;
    }

    .spotlight-button {
        width: 100%;
        margin: 0 0 0.5rem 0;
    }

    .static-page-container {
        padding: 1.5rem;
        margin: 2rem auto;
    }

    .auth-modal-content {
        padding: 1.5rem;
    }

    .donation-method-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    
    .project-board-container {
        padding: 1rem 0;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.25rem;
    }

    .project-section-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .project-title {
        font-size: 1.125rem;
    }

    .project-dates {
        flex-direction: column;
        gap: 0.25rem;
    }

    .project-meta-row {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .meta-item {
        font-size: 0.8rem;
    }

    .project-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .task-sections {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .task-item {
        padding: 1rem;
    }

    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .task-content {
        gap: 1rem;
    }

    .task-section-detail h6 {
        font-size: 0.9rem;
    }

    .task-section-detail ul {
        font-size: 0.85rem;
    }

    .contribution-button {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .project-meta-info {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .project-manager {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .manager-info {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Repository Content Styles */
.repository-content {
    max-width: 100%;
    margin: 0 auto;
}

.repository-content h3 {
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.repository-content > p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.repository-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.repo-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-speed) ease;
}

.repo-section:hover {
    box-shadow: var(--shadow-md);
}

.repo-section h4 {
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.repo-files {
    list-style: none;
    padding: 0;
    margin: 0;
}

.repo-files li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.repo-files li:last-child {
    border-bottom: none;
}

.repo-files li strong {
    color: var(--color-text-primary);
    font-weight: 600;
    min-width: 200px;
    flex-shrink: 0;
}

.repository-access {
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.repository-access h4 {
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.repository-access p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.access-notes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note {
    background: var(--color-surface);
    border-left: 4px solid var(--color-primary);
    padding: 1rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.note strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Responsive adjustments for repository */
@media (max-width: 768px) {
    .repository-sections {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .repo-section {
        padding: 1rem;
    }
    
    .repo-files li {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .repo-files li strong {
        min-width: auto;
    }
}