/* Minimalist style inspired by karpathy.ai */
/* No frameworks - just simple, readable CSS */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background: #fff;
}

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

/* Header with photo */
header {
    margin-bottom: 40px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.header-text {
    text-align: center;
}

.header-text h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #111;
}

.tagline {
    color: #666;
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 15px;
}

/* Social Icons */
.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-links a {
    color: #333;
    text-decoration: none;
}

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

.social-links svg {
    width: 24px;
    height: 24px;
}

/* Timeline */
.timeline {
    margin-bottom: 50px;
}

/* Time-scaled timeline */
.timeline {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: 40px;
    padding-right: 40px;
    box-sizing: border-box;
}

.scaled-timeline {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 30px;
    height: 600px;
    position: relative;
    margin-bottom: 50px;
}

.year-axis {
    position: relative;
    border-right: 1px solid #e5e7eb;
}

.year-mark {
    position: absolute;
    right: 15px;
    font-size: 0.85rem;
    color: #666;
    transform: translateY(-50%);
}

.timeline-tracks {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 25px;
    position: relative;
}

.track {
    position: relative;
    height: 100%;
}

.track-line {
    position: absolute;
    left: 5px;
    width: 3px;
    background: #666;
    border-radius: 0;
}

.track-line.ended {
    background: #999;
}

.track-point {
    position: absolute;
    left: 5px;
}

.track-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    left: -5px;
}

.track-dot.ongoing {
    background: #333;
}

.track-dot.start {
    background: #666;
}

.track-dot.end {
    background: #999;
}

.track-dot.event {
    background: #666;
}

.track-content {
    position: absolute;
    left: 25px;
    right: 5px;
}

.track-logo {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    object-fit: contain;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.track-logo.book {
    width: 40px;
    height: auto;
    border-radius: 4px;
}

.track-logo-text {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 10px;
}

.track-logo-text.oxford {
    background: #002147;
}

.track-logo-text.dr {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
}

.track-logo-text.cfr {
    background: #8B4513;
    font-style: italic;
    font-weight: 400;
}

.track-logo-text.belmont {
    background: #002B5C;
}

.track-content p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: #444;
}

/* Single timeline items */
.timeline-item {
    display: grid;
    grid-template-columns: 70px 12px 50px 1fr;
    gap: 15px;
    align-items: start;
    margin-bottom: 30px;
    position: relative;
}

.timeline-date {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    padding-top: 12px;
    font-weight: 500;
}

.timeline-marker {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 18px;
    z-index: 1;
}

.timeline-marker::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #0066cc;
    border-radius: 50%;
}

.timeline-marker::after {
    content: '';
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% + 18px);
    background: #e0e0e0;
}

.timeline-item:last-child .timeline-marker::after {
    display: none;
}

/* Timeline logos */
.timeline-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.timeline-logo-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    flex-shrink: 0;
}

.timeline-logo-img.book-cover-small {
    width: 40px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.oxford-logo {
    background: #002147;
}

.dr-logo {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
}

.timeline-content {
    padding-top: 5px;
}

.timeline-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

/* Sections */
section {
    margin-bottom: 50px;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: #111;
}

section p {
    margin-bottom: 15px;
}

.pub-meta {
    color: #666;
    font-size: 0.9rem;
}

/* Links */
a {
    color: #0000EE;
    text-decoration: underline;
}

a:hover {
    color: #551A8B;
}

/* Lists */
ul {
    list-style: none;
    padding-left: 0;
}

/* Single-line Papers */
.papers {
    margin-top: 15px;
}

.papers li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.paper-year {
    display: inline-block;
    width: 40px;
    color: #888;
    font-size: 0.8rem;
    font-family: monospace;
}

.papers li a {
    color: #0066cc;
}

.papers li a:hover {
    text-decoration: underline;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.course-card {
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    border: 1px solid #ddd;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.course-card:hover {
    background: #eee;
    text-decoration: none;
}

.course-thumbnail {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.course-thumbnail.udacity-course {
    background: #eee;
    color: #333;
}

.course-thumbnail.openmined-course {
    background: #ddd;
    color: #333;
}

.course-thumbnail span {
    font-weight: 600;
    font-size: 0.95rem;
}

.course-info {
    padding: 15px;
}

.course-info strong {
    display: block;
    font-size: 0.9rem;
    color: #111;
    margin-bottom: 5px;
}

.course-role {
    display: inline-block;
    background: #ddd;
    color: #333;
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-bottom: 8px;
}

.course-info p {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.course-stats {
    font-size: 0.75rem;
    color: #888;
}

/* Video Grid - Karpathy style wall of squares */
.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.video-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.video-card:hover {
    opacity: 0.8;
    text-decoration: none;
}

.video-card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #f0f0f0;
}

.video-info {
    padding: 8px 0;
}

.video-info strong {
    display: block;
    font-size: 0.8rem;
    color: #111;
    font-weight: 500;
    line-height: 1.3;
}

.video-info span {
    display: none;
}

/* Talk cards without video */
.talk-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    background: #ddd;
}

.talk-thumbnail.raais {
    background: #ccc;
    color: #333;
}

.talk-thumbnail.oreilly {
    background: #ccc;
    color: #333;
}

.talk-thumbnail.icml {
    background: #ccc;
    color: #333;
}

/* Book Section */
.book-section {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    margin-top: 20px;
}

.book-cover {
    flex-shrink: 0;
}

.book-cover img {
    width: 150px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.book-cover:hover img {
    transform: scale(1.02);
}

.book-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.book-info h3 a {
    color: #111;
}

.book-meta {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.book-info p {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.book-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.book-links a {
    padding: 5px 12px;
    background: #eee;
    font-size: 0.8rem;
    color: #0000EE;
}

.book-links a:hover {
    background: #ddd;
}

/* Blog posts */
.blog-posts li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.blog-posts .date {
    color: #888;
    font-size: 0.8rem;
    font-family: monospace;
    margin-right: 8px;
}

.blog-posts .desc {
    color: #666;
    font-size: 0.85rem;
}

/* Footer */
footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

footer a {
    color: #666;
}

footer a:hover {
    color: #0066cc;
}

/* Responsive */
@media (max-width: 900px) {
    .scaled-timeline {
        height: auto;
        grid-template-columns: 1fr;
        overflow: hidden;
    }

    .year-axis {
        display: none;
    }

    .timeline-tracks {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .track {
        height: auto;
        min-height: 120px;
        padding-left: 25px;
        padding-bottom: 20px;
        position: relative;
        overflow: hidden;
    }

    .track-line,
    .track-point {
        position: absolute;
        left: 0;
        top: 0;
        height: calc(100% - 20px) !important;
    }

    .track-content {
        position: relative;
        left: 0;
        top: 0 !important;
    }

    .track::before {
        content: attr(data-years);
        display: block;
        font-size: 0.8rem;
        color: #666;
        margin-bottom: 10px;
    }

    #bio {
        clear: both;
        position: relative;
    }
}

@media (max-width: 700px) {
    .timeline::before {
        left: 66px;
    }

    .timeline-item {
        grid-template-columns: 60px 12px 40px 1fr;
        gap: 10px;
    }

    .timeline-date {
        font-size: 0.75rem;
    }

    .timeline-logo {
        width: 40px;
        height: 40px;
        font-size: 0.75rem;
    }

    .timeline-logo-img {
        width: 40px;
        height: 40px;
    }

    .timeline-content p {
        font-size: 0.85rem;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .book-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-cover img {
        width: 130px;
    }

    .book-links {
        justify-content: center;
    }

    .blog-posts .date {
        display: block;
        margin-bottom: 2px;
    }

    .blog-posts .desc {
        display: block;
    }
}

@media (max-width: 500px) {
    .container {
        padding: 20px 15px;
    }

    .header-text h1 {
        font-size: 1.6rem;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
    }

    .timeline::before {
        display: none;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-left: 0;
    }

    .timeline-date {
        text-align: left;
        padding-top: 0;
    }

    .timeline-marker {
        display: none;
    }

    .timeline-logo,
    .timeline-logo-img {
        display: none;
    }

    .papers li {
        font-size: 0.85rem;
    }
}
