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

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 2rem auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    color: #e0e0e0;
}

h1 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.6;
    font-weight: 300;
    letter-spacing: 1px;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.social-links a:hover {
    color: #fff;
}

.canvas-container {
    background: #000;
    border: 1px solid #333;
    padding: 2rem;
    margin-bottom: 1rem;
}

#neuralNetwork {
    display: block;
    width: 100%;
    height: 700px;
    cursor: pointer;
}

.tooltip {
    position: fixed;
    background: #000;
    color: #e0e0e0;
    padding: 10px 14px;
    border: 1px solid #555;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    max-width: 250px;
}

.tooltip.show {
    opacity: 1;
}

.tooltip strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #fff;
}

footer {
    text-align: center;
    color: #666;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #111;
    border: 1px solid #333;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-category {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 8px;
    border: 1px solid #444;
    color: #888;
    margin-bottom: 0.75rem;
}

.modal-category.athletics { border-color: #4a9; color: #4a9; }
.modal-category.education { border-color: #69f; color: #69f; }
.modal-category.tech { border-color: #f6a; color: #f6a; }
.modal-category.startup { border-color: #fa6; color: #fa6; }
.modal-category.writing { border-color: #af6; color: #af6; }
.modal-category.personal { border-color: #999; color: #999; }

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
    margin: 0.5rem 0;
    letter-spacing: 1px;
}

.modal-year {
    font-size: 0.85rem;
    color: #666;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #ccc;
}

.modal-links {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-links a {
    display: inline-block;
    font-size: 0.75rem;
    color: #888;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #444;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.modal-links a:hover {
    color: #fff;
    border-color: #888;
}

.modal-links a::before {
    content: '\2192';
    margin-right: 6px;
}

.modal-connections {
    border-top: 1px solid #333;
    padding-top: 1rem;
}

.connection-group {
    margin-bottom: 1rem;
}

.connection-group:last-child {
    margin-bottom: 0;
}

.connection-group:empty,
.connection-group.hidden {
    display: none;
}

.connection-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
    display: block;
    margin-bottom: 0.5rem;
}

.connection-nodes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.connection-node {
    font-size: 0.75rem;
    color: #888;
    padding: 4px 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.connection-node:hover {
    color: #fff;
    border-color: #666;
}

/* Tablet and below */
@media (max-width: 768px) {
    .container {
        margin: 1rem auto;
    }

    h1 {
        font-size: 1.75rem;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .social-links {
        gap: 1.25rem;
    }

    .social-links a {
        font-size: 0.75rem;
        padding: 8px 4px;
    }

    .canvas-container {
        padding: 1rem;
        border: none;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    #neuralNetwork {
        width: 1000px;
        min-width: 1000px;
        height: 500px;
    }

    .tooltip {
        display: none;
    }

    .modal-content {
        padding: 1.5rem;
        max-height: 85vh;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-body p {
        font-size: 0.85rem;
    }

    footer {
        font-size: 0.7rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        width: 100%;
        margin: 0.5rem auto;
    }

    header {
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-links a {
        font-size: 0.7rem;
    }

    .canvas-container {
        padding: 0.5rem;
    }

    #neuralNetwork {
        width: 900px;
        min-width: 900px;
        height: 450px;
    }

    .modal-content {
        width: 95%;
        padding: 1.25rem;
        max-height: 90vh;
    }

    .modal-close {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.75rem;
        padding: 4px;
    }

    .modal-header h2 {
        font-size: 1.1rem;
        padding-right: 1.5rem;
    }

    .modal-category {
        font-size: 0.6rem;
    }

    .modal-body p {
        font-size: 0.8rem;
        line-height: 1.6;
    }

    .modal-links a {
        font-size: 0.7rem;
        padding: 8px 12px;
    }

    .connection-node {
        font-size: 0.7rem;
        padding: 6px 10px;
    }

    footer p {
        padding: 0 1rem;
    }
}

/* Small phones */
@media (max-width: 360px) {
    h1 {
        font-size: 1.3rem;
    }

    #neuralNetwork {
        width: 800px;
        min-width: 800px;
        height: 400px;
    }

    .social-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        margin: 0.5rem auto;
    }

    header {
        margin-bottom: 0.5rem;
    }

    h1 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .social-links {
        margin-top: 0.5rem;
        gap: 1rem;
    }

    .canvas-container {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    #neuralNetwork {
        width: 900px;
        min-width: 900px;
        height: 280px;
    }

    footer {
        display: none;
    }

    .modal-content {
        max-height: 95vh;
        padding: 1rem;
    }
}
