:root {
    --bg-color: #1a1a1a;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --accent: #ffffff;
    --card-bg: #262626;
    --border: #404040;
    --link: #38bdf8;
    --max-width: 800px;
}

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

a {
    color: var(--link);
    text-decoration: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    padding: 2rem 1rem;
    overflow-x: hidden;
}

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

/* Hero Section */
.hero {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.bio {
    flex: 1;
    text-align: center;
}

.profile-img img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
    object-position: center 20%;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
}

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

.social-links a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.social-links a::after {
    content: '|';
    margin: 0 0.75rem;
    color: var(--text-secondary);
}

.social-links a:last-child::after {
    content: '';
}

.social-links a:hover {
    text-decoration: underline;
}

/* Section Styling */
.section {
    margin-bottom: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.section:first-of-type {
    padding-bottom: 2rem;
}

.section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

/* Cards & Lists */
.card-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 4px;
    min-height: 50px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.card.list-item {
    padding-left: 1rem;
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.grid .card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
}

.card-stack .card.card-row {
    flex-direction: row;
    align-items: center;
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.card-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border: 1px solid #555;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.5;
    transition: border-color 0.2s, color 0.2s;
}

.card-badge:hover {
    border-color: var(--link);
}

.card-stack .card.card-row img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    margin-right: 1rem;
}

.card-stack .card-content {
    padding-left: 0.5rem;
}

.card-content {
    flex: 1;
}

.card h3 {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-content > a:hover,
.card.list-item > a:hover {
    text-decoration: underline;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.section-text {
    margin-bottom: 1.5rem;
}

.section-text p a:hover {
    text-decoration: underline;
}

.section-text ul {
    padding-left: 2.5rem;
    color: var(--text-secondary);
}

.section-text li {
    margin-bottom: 0.5rem;
}

/* Date-aligned list (New/s) */
.date-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.date-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.date-list li:last-child {
    margin-bottom: 0;
}

.date-list .date {
    width: 7.5rem;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
}

.date-list .entry {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.date-list .entry a:hover {
    text-decoration: underline;
}

.date {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Timeline/Career */
.timeline {
    border-left: 2px solid var(--border);
    padding-left: 1.5rem;
    margin-left: 0.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
}

.company {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.company-dates {
    display: inline;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.company-dates .dot {
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

.company-dates .dates {
    font-size: 0.85rem;
    color: var(--text-secondary) !important;
    margin-bottom: 0.75rem;
}

.role {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

footer {
    text-align: center;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 700px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .bio {
        text-align: center;
    }

    .social-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0;
    }

    .social-links a::after {
        margin: 0 0.3rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

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

    .date-list li {
        flex-direction: column;
        gap: 0.1rem;
    }

    .date-list .date {
        width: auto;
    }
}

/* Top-of-page nav (index pages) */
.page-nav {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.page-nav a + a {
    margin-left: 1.5rem;
}

.page-nav a:hover {
    text-decoration: underline;
}

/* Shared centring block: nav and list resolve to the same left edge */
.page-index {
    display: inline-block;
    text-align: left;
}

/* Blogs page */
#blogs-page .section-title {
    text-align: center;
    margin-bottom: 0.4rem;
}

#blogs-page .page-nav {
    margin-bottom: 1rem;
}

#blogs-page .section-text {
    text-align: center;
}

#blogs-page .section-text ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#blogs-page .section-text li p {
    display: flex;
    margin: 0 0 0.5rem 0;
}

#blogs-page .date {
    width: 9.5rem;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

#blogs-page .section-text p {
    font-size: 1rem;
    color: var(--text-primary);
}

#blogs-page footer {
    margin-top: 1.5rem;
}

/* Books page */
#books-page .section-title {
    text-align: center;
    margin-bottom: 0.4rem;
}

#books-page .page-nav {
    margin-bottom: 1rem;
}

#books-page .section-text {
    text-align: center;
}

#books-page .section-text ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#books-page .section-text li p {
    margin: 0 0 0.5rem 0;
}

#books-page .section-text .reading {
    filter: hue-rotate(195deg) saturate(5);
}

#books-page .section-text li.read p {
    color: #808080;
}

#books-page .section-text li.shelf p,
#books-page .section-text li.reading p {
    color: #e8e8e8;
}

#books-page footer {
    margin-top: 1.5rem;
}
