/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color palette - minimalist with subtle colors */
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-light: #666666;
    --color-border: #e5e5e5;
    --color-accent: #52796F;

    /* Node colors by type */
    --color-places: #3b82f6;
    --color-roles: #8b5cf6;
    --color-themes: #ec4899;
    --color-interests: #10b981;

    /* Typography */
    --font-sans: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;

    /* Layout */
    --container-max: 1200px;
    --border-radius: 8px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
    display: grid;
    grid-template-columns: auto 1fr;
    background: rgba(255, 255, 255, 0);

    grid-template-rows: auto auto;
    column-gap: var(--space-xl);
    row-gap: var(--space-xs);
    align-items: center;
}

.nav-controls {
    grid-column: 2;
    grid-row: -1/ 1;

}

.nav-logo {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-logo:hover {
    color: var(--color-accent);
}

.nav-container .nav-subtitle{
    grid-column: 1;
    grid-row: 2;
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}



.toggle-switch {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    width: 180px;
    height: 36px;
    background: var(--color-border);
    border-radius: 36px;
    position: relative;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 32px;
    border-radius: 32px;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-text);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(86px);
}

/* Toggle Icons */
.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    pointer-events: none;
    position: relative;
    z-index: 2;
    font-size: 0.875rem;
    font-weight: 500;
}

.toggle-icon svg {
    display: block;
}

.toggle-icon-graph {
    color: var(--color-text);
}

.toggle-icon-list {
    color: var(--color-text);
    opacity: 0;
    margin-left: auto;
}

.toggle-switch input:checked + .toggle-slider .toggle-icon-graph {
    opacity: 0;
}

.toggle-switch input:checked + .toggle-slider .toggle-icon-list {
    opacity: 1;
    margin-left: auto;

}

/* Main Container */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 100px;
}

/* Graph View */
.graph-view {
    display: none;
    position: relative;
}

.graph-view.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.graph-container {
    position: relative;
    width: 100%;
    flex: 1;
    background: #fafafa;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

#graph {
    width: 100%;
    flex: 1;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

#graph svg {
    cursor: grab;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
}

#graph svg:active {
    cursor: grabbing;
    width: 100%;
    height: 100%;
}

/* Graph Nodes */
.graph-node {
    cursor: pointer;
    transition: all 0.2s ease;
}

.graph-node.places {
    fill: #52796F;
}

.graph-node.roles {
    fill: #52796F;
}

.graph-node.themes {
    fill: #52796F;
}

.graph-node.interests {
    fill: #52796F;
}

.graph-node:hover {
    filter: brightness(1.1);
    stroke: white;
    stroke-width: 3px;
}

.graph-label {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    fill: var(--color-text);
    pointer-events: none;
}

/* Graph Controls */
.graph-controls {
    position: absolute;
    bottom: var(--space-lg);
    left: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-end;
    z-index: 10;
}

.control-btn {
    padding: var(--space-xs) var(--space-md);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
}

.control-btn:hover {
    background: var(--color-text);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Legend */
.graph-legend {
    background: white;
    padding: var(--space-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.legend-label-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    user-select: none;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.places {
    background: var(--color-places);
}

.legend-dot.roles {
    background: var(--color-roles);
}

.legend-dot.themes {
    background: var(--color-themes);
}

.legend-dot.interests {
    background: var(--color-interests);
}

.legend-label {
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.detail-panel.active {
    right: 0;
}

.close-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-light);
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--color-text);
}

.detail-content {
    padding: var(--space-2xl) var(--space-lg);
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    line-height: 1.2;
}

.detail-subtitle {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-sm);
}

.detail-body {
    font-size: 0.9375rem;
    line-height: 1.7;
}

.detail-body p {
    margin-bottom: var(--space-md);
}

.detail-body ul {
    margin-left: var(--space-md);
    margin-bottom: var(--space-md);
}

.detail-body li {
    margin-bottom: var(--space-xs);
}

.detail-body strong {
    font-weight: 600;
    color: var(--color-text);
}

.detail-body .meta {
    color: var(--color-text-light);
    font-style: normal;
}

.detail-body .related {
    font-weight: 600;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.detail-body .related::before {
    content: '→';
    font-size: 0.875rem;
    color: var(--color-accent);
    font-weight: 600;
}

.detail-body a {
    color: #52796F;
    text-decoration: none;
}

.detail-body a:hover {
    color: #354f52;
    text-decoration: underline;
}

/* List View */
.list-view {
    display: none;
}

.list-view.active {
    display: block;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.section-content p {
    margin-bottom: var(--space-md);
    color: var(--color-text-light);
}

/* Role */
.role {
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
}

.role-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.role-period {
    color: var(--color-text-light);
    font-size: 0.9375rem;
    white-space: nowrap;
}

/* Project */
.project {
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
}

.project:last-child {
    margin-bottom: 0;
}

.project-content {
    flex: 1;
}

.project-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-description {
    color: var(--color-text-light);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.project-description li::marker {
    color: #354f52;
}

.project-description li {
    margin-bottom: var(--space-xs);
}

.project-description li:last-child {
    margin-bottom: 0;
}

.project-description a {
    text-decoration: none;
    font-size: 0.75rem;
    color: #52796F;
}

.project-description a:hover {
    color: #354f52;
}

.project-role {
    color: var(--color-text-light);
    font-size: 0.9375rem;
    margin: 0;
}

.project-location {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin: 0.25rem 0 0.5rem 0;
}

.project-period {
    color: var(--color-text-light);
    font-size: 0.875rem;
    white-space: nowrap;
}

.project-list {
    margin-left: var(--space-md);
    color: var(--color-text-light);
}

.project-list li {
    margin-bottom: var(--space-xs);
}

/* Education */
.education {
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
}

.education-content {
    flex: 1;
}

.education-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.education-degree {
    color: var(--color-text-light);
}

.education-details {
    color: var(--color-text-light);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Community */
.community-list {
    display: grid;
    gap: var(--space-lg);
}

.community-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
}

.community-content {
    flex: 1;
}

.community-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.community-role {
    color: var(--color-text-light);
}

.community-period {
    color: var(--color-text-light);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Contact Links */
.contact-links {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.contact-link {
    padding: var(--space-xs) var(--space-md);
    background: var(--color-text);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.contact-link:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Footer */
.footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-lg);
    text-align: center;
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
}

.footer-content p {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.5rem;
    }

    /* Navigation */
    .nav-container {
        padding: var(--space-sm);
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: var(--space-sm);
    }

    .nav-logo {
        grid-column: 1;
        grid-row: 1;
    }

    .nav-subtitle {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.8rem;
    }

    .nav-controls {
        grid-column: 1;
        grid-row: 3;
        justify-self: start;
    }

    /* Toggle switch - smaller on mobile */
    .toggle-slider {
        width: 120px;
        height: 32px;
        padding: 0 8px;
    }

    .toggle-slider::before {
        width: 60px;
        height: 28px;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(56px);
    }

    .toggle-icon {
        font-size: 0.75rem;
        gap: 4px;
    }

    .toggle-icon svg {
        width: 14px;
        height: 14px;
    }

    /* Main container */
    .main {
        margin-top: 140px;
    }

    /* List view - better mobile spacing */
    .container {
        padding: var(--space-lg) var(--space-sm);
    }

    /* Projects - stack vertically */
    .project {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .project-period {
        white-space: normal;
    }

    /* Education - stack vertically */
    .education {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .education-details {
        white-space: normal;
    }

    /* Community - stack vertically */
    .community-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .community-period {
        white-space: normal;
    }

    /* Role - stack vertically */
    .role {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .role-period {
        white-space: normal;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .graph-container {
        min-height: 500px;
    }

    /* Center graph view on mobile */
    #graph svg {
        display: block;
        margin: 0 auto;
    }

    /* Hide graph controls on mobile for cleaner view */
    .graph-controls {
        display: none;
    }

    .detail-panel {
        width: 100%;
        right: -100%;
    }

    .detail-panel.active {
        right: 0;
    }

    .container {
        padding: var(--space-lg) var(--space-md);
    }

    .contact-links {
        flex-direction: column;
    }

    .nav-container {
        padding: var(--space-sm) var(--space-md);
    }
}

@media (max-width: 480px) {
    :root {
        --space-xl: 2rem;
        --space-2xl: 2.5rem;
    }

    .hero {
        padding: var(--space-xl) var(--space-md);
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--color-accent);
    color: white;
}

/* Focus States */
button:focus,
a:focus {
    outline: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease;
}
