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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #2a2a2a;
}

body.graph-page {
    overflow: hidden;
}

/* ===== Graph Page Styles ===== */

.graph-page {
    background: #f8f8f6;
}

.graph-container-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.graph-header {
    padding: 20px 30px;
    background: #f8f8f6;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: #4a4a4a;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #1a1a1a;
}

.view-toggles {
    display: flex;
    gap: 8px;
}

.view-toggle {
    padding: 6px 16px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #6a6a6a;
    background: transparent;
    border: 1px solid #d0d0d0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle:hover {
    color: #1a1a1a;
    border-color: #1a1a1a;
}

.view-toggle.active {
    color: #1a1a1a;
    background: #f0f0f0;
    border-color: #1a1a1a;
}

#graph-container {
    flex: 1;
    position: relative;
    background: #f8f8f6;
    overflow: hidden;
}

#graph {
    display: block;
}

#info-panel {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    max-height: 80vh;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 200;
    overflow-y: auto;
    transition: all 0.2s ease;
}

#info-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(20px);
}

#close-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    color: #6a6a6a;
    cursor: pointer;
    transition: color 0.2s ease;
}

#close-panel:hover {
    color: #1a1a1a;
}

#panel-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-right: 30px;
}

#panel-description {
    font-size: 14px;
    line-height: 1.6;
    color: #6a6a6a;
    margin-bottom: 16px;
}

.metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #6a6a6a;
    background: #f0f0f0;
    text-transform: capitalize;
}

.date {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    background: #f0f0f0;
    color: #6a6a6a;
}

.node-link {
    display: inline-block;
    margin-top: 8px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #1a1a1a;
    transition: opacity 0.2s ease;
}

.node-link:hover {
    opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .graph-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .view-toggles {
        width: 100%;
        justify-content: flex-start;
    }

    .view-toggle {
        flex: 1;
        padding: 8px 12px;
        font-size: 12px;
    }

    #info-panel {
        position: fixed;
        right: 15px;
        left: 15px;
        width: auto;
        top: auto;
        bottom: 20px;
        transform: none;
        max-height: 60vh;
        padding: 20px;
    }

    #info-panel.hidden {
        transform: translateY(20px);
    }
}

/* Scrollbar styling */
#info-panel::-webkit-scrollbar {
    width: 6px;
}

#info-panel::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 10px;
}

#info-panel::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

#info-panel::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ===== Landing Page Styles ===== */

.landing-page {
    background: #fafafa;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #2a2a2a;
    line-height: 1.6;
}

.landing-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 40px;
}

.landing-header {
    margin-bottom: 80px;
}

.header-title {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.landing-header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 42px;
    font-weight: 400;
    margin: 0;
    color: #1a1a1a;
}

.graph-button {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    text-decoration: none;
    padding: 8px 16px;
    border: 1.5px solid #1a1a1a;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.graph-button:hover {
    background: #1a1a1a;
    color: #fafafa;
}

.intro-text {
    font-size: 16px;
    line-height: 1.6;
    color: #6a6a6a;
    margin: 20px 0 24px 0;
    max-width: 600px;
}

.header-nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.header-nav a {
    color: #4a4a4a;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.header-nav a:hover {
    color: #1a1a1a;
}

.landing-main section {
    margin-bottom: 80px;
}

.landing-main h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 32px;
    color: #1a1a1a;
}

/* Projects */
.projects-section {
    background: linear-gradient(to bottom, rgba(139, 125, 184, 0.03), transparent);
    padding: 40px;
    margin: 0 -40px 80px;
    border-left: 3px solid rgba(139, 125, 184, 0.2);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.project-item {
    padding: 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.project-item:hover {
    background: rgba(139, 125, 184, 0.05);
    transform: translateX(4px);
}

.project-item h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.project-item h3 a {
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.project-item h3 a:hover {
    border-bottom-color: #1a1a1a;
}

.project-item p {
    color: #6a6a6a;
    font-size: 15px;
    margin: 0;
}

/* Writing */
.writing-section {
    background: linear-gradient(to bottom, rgba(107, 154, 172, 0.03), transparent);
    padding: 40px;
    margin: 0 -40px 80px;
    border-left: 3px solid rgba(107, 154, 172, 0.2);
}

.writing-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.writing-item {
    padding: 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.writing-item:hover {
    background: rgba(107, 154, 172, 0.05);
    transform: translateX(4px);
}

.writing-item h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.writing-item h3 a {
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.writing-item h3 a:hover {
    border-bottom-color: #1a1a1a;
}

.writing-item p {
    color: #6a6a6a;
    font-size: 15px;
    margin: 0 0 8px 0;
}

.item-type {
    display: inline-block;
    font-size: 11px;
    color: #8a8a8a;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-more-links {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.view-more {
    display: inline-block;
    color: #4a4a4a;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.view-more:hover {
    color: #1a1a1a;
}

/* Sparks Joy sections */
.sparks-joy-section {
    margin-bottom: 60px;
    padding: 40px;
    margin-left: -40px;
    margin-right: -40px;
    transition: background 0.3s ease;
}

.sparks-joy-section:nth-of-type(2) {
    background: linear-gradient(to bottom, rgba(168, 232, 201, 0.03), transparent);
    border-left: 3px solid rgba(168, 232, 201, 0.2);
}

.sparks-joy-section:nth-of-type(3) {
    background: linear-gradient(to bottom, rgba(232, 178, 168, 0.03), transparent);
    border-left: 3px solid rgba(232, 178, 168, 0.2);
}

.sparks-joy-section h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.sparks-joy-section ul {
    list-style: none;
    padding: 0;
}

.sparks-joy-section li {
    color: #6a6a6a;
    font-size: 15px;
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    transition: color 0.2s ease;
}

.sparks-joy-section li:hover {
    color: #4a4a4a;
}

.sparks-joy-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6a6a6a;
}

/* Graph section */
.graph-section {
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.graph-section p {
    color: #6a6a6a;
    font-size: 15px;
}

.graph-section a {
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px solid #1a1a1a;
}

.graph-section a:hover {
    opacity: 0.6;
}

/* Content pages (Reads, Things, Repercussions) */
.content-section {
    margin-bottom: 60px;
}

.content-section h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.content-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.content-item {
    padding: 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: rgba(107, 154, 172, 0.02);
    border-left: 2px solid rgba(107, 154, 172, 0.2);
}

.content-item:hover {
    background: rgba(107, 154, 172, 0.05);
    transform: translateX(4px);
}

.content-item h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.content-author {
    font-size: 14px;
    color: #8a8a8a;
    font-style: italic;
    margin-bottom: 8px;
}

.content-item p {
    color: #6a6a6a;
    font-size: 15px;
    line-height: 1.6;
    margin: 4px 0 0 0;
}

/* Responsive */
@media (max-width: 768px) {
    .landing-container {
        padding: 60px 24px;
    }

    .landing-header {
        margin-bottom: 60px;
    }

    .landing-header h1 {
        font-size: 36px;
    }

    .intro-text {
        font-size: 15px;
        margin: 16px 0 20px 0;
    }

    .header-nav {
        gap: 16px;
    }

    .header-title {
        gap: 12px;
    }

    .graph-button {
        font-size: 13px;
        padding: 6px 12px;
    }

    .landing-main section {
        margin-bottom: 60px;
    }

    .landing-main h2 {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .project-list,
    .writing-list {
        gap: 24px;
    }

    .sparks-joy-section {
        margin-bottom: 48px;
        padding: 24px;
        margin-left: -24px;
        margin-right: -24px;
    }

    .sparks-joy-section h2 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .projects-section,
    .writing-section {
        padding: 24px;
        margin-left: -24px;
        margin-right: -24px;
    }

    .project-item,
    .writing-item {
        padding: 12px;
    }

    .view-more-links {
        flex-direction: column;
        gap: 12px;
    }

    .content-section {
        margin-bottom: 48px;
    }

    .content-section h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .content-list {
        gap: 20px;
    }

    .content-item {
        padding: 16px;
    }

    .content-item h3 {
        font-size: 17px;
    }
}
