:root {
    --bg: #ffffff;
    --text: #0f172a; /* slate-900 */
    --muted: #475569; /* slate-600 */
    --card: #f8fafc; /* slate-50 */
    --border: #e2e8f0; /* slate-200 */
    --accent: #2563eb; /* blue-600 */
    --link: var(--accent);
    --shadow: 0 10px 25px rgba(2, 6, 23, 0.08);

    /* Typography scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --text: #e5e7eb; /* slate-200 */
        --muted: #94a3b8; /* slate-400 */
        --card: #0f172a; /* slate-900 */
        --border: #1f2937; /* gray-800 */
        --accent: #60a5fa; /* blue-300 */
        --link: var(--accent);
        --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    }
}

* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
}
body {
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        sans-serif;
    color: var(--text);
    background:
        radial-gradient(
            1200px 600px at 20% -10%,
            rgba(37, 99, 235, 0.08),
            transparent 60%
        ),
        radial-gradient(
            800px 400px at 90% 10%,
            rgba(99, 102, 241, 0.08),
            transparent 60%
        ),
        var(--bg);
    line-height: 1.6;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}
.site-header .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}
.brand {
    font-weight: 700;
    letter-spacing: 0.2px;
    text-decoration: none;
    color: var(--text);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: var(--space-2);
    background: none;
    border: none;
    border-radius: 4px;
    z-index: 20;
}

.menu-toggle:hover {
    background: color-mix(in srgb, var(--text) 10%, transparent);
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.site-header nav {
    display: flex;
    align-items: center;
}
.site-header nav a {
    margin-left: 18px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    transition: color 0.2s ease;
}
.site-header nav a:hover {
    color: var(--link);
}

/* Main */
.site-main {
    padding: 40px 0 64px;
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 28px;
    align-items: center;
    padding: 28px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.hero img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.hero h1 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-4xl);
    line-height: 1.2;
    font-weight: 700;
}
.hero p.tagline {
    margin: 0 0 var(--space-4);
    font-size: var(--text-lg);
    color: var(--muted);
    line-height: 1.5;
}
.hero .links a {
    display: inline-block;
    margin-right: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 85%, transparent);
    text-decoration: none;
    color: var(--text);
}
.hero .links a.primary {
    background: var(--accent);
    color: white;
    border-color: color-mix(in srgb, var(--accent) 70%, black);
}
.hero .links a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Sections */
.section {
    margin-top: var(--space-12);
}
.section h2 {
    font-size: var(--text-2xl);
    margin: 0 0 var(--space-4);
    font-weight: 600;
}
.card {
    padding: var(--space-6);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.12);
}

/* Timeline */
.timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline li {
    position: relative;
    padding: 0 0 16px 36px;
}
.timeline li::marker {
    content: none;
}
.timeline li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}
.site-footer .socials a {
    margin-right: 14px;
    color: var(--muted);
    text-decoration: none;
}
.site-footer .socials a:hover {
    color: var(--link);
}
.site-footer .copy {
    color: var(--muted);
    margin-top: 6px;
}

/* Utilities */
a {
    color: var(--link);
}
.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-decoration: none;
}
.btn.primary {
    background: var(--accent);
    color: white;
    border-color: color-mix(in srgb, var(--accent) 70%, black);
}
code,
pre {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px 6px;
}
pre {
    padding: 12px;
    overflow-x: auto;
}

/* Blog post styles */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.post-list li {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
}
.post-list li:last-child {
    border-bottom: none;
}
.post-list a {
    font-size: var(--text-lg);
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
}
.post-list a:hover {
    color: var(--link);
}
.post-meta {
    color: var(--muted);
    font-size: var(--text-sm);
    margin-left: var(--space-2);
}

/* Reading time */
.reading-time {
    color: var(--muted);
    font-size: var(--text-sm);
    margin-left: var(--space-2);
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .site-header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card);
        border: 1px solid var(--border);
        border-top: none;
        border-radius: 0 0 12px 12px;
        flex-direction: column;
        padding: var(--space-4);
        box-shadow: var(--shadow);
        z-index: 10;
        animation: slideDown 0.3s ease-out;
    }

    .site-header nav.active {
        display: flex;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .site-header nav a {
        margin: var(--space-2) 0;
        margin-left: 0;
        padding: var(--space-3);
        border-radius: 4px;
        transition: background-color 0.2s ease;
    }

    .site-header nav a:hover {
        background: color-mix(in srgb, var(--accent) 10%, transparent);
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-6);
    }
    .hero img {
        margin: 0 auto;
        width: 150px;
        height: 150px;
    }
    .hero h1 {
        font-size: var(--text-3xl);
    }
    .hero p.tagline {
        font-size: var(--text-base);
    }
    .site-header .nav {
        padding: var(--space-3) 0;
        position: relative;
    }

    .section {
        margin-top: var(--space-8);
    }
    .card {
        padding: var(--space-4);
    }

    .hero .links {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }
    .hero .links a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    .hero h1 {
        font-size: var(--text-2xl);
    }
    .section h2 {
        font-size: var(--text-xl);
    }
}

/* Talk-specific styles */
.talk-item {
    margin-bottom: var(--space-6);
}

.talk-item h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xl);
    color: var(--text);
}

.talk-meta {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--muted);
}

.talk-date {
    font-weight: 600;
}

.talk-venue::before {
    content: "📍 ";
}

.talk-collab::before {
    content: "👥 ";
}

.talk-topics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.topic {
    padding: var(--space-1) var(--space-3);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: 500;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.talk-links {
    margin-top: var(--space-4);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-6);
}

.topic-area {
    padding: var(--space-4);
    background: color-mix(in srgb, var(--card) 50%, transparent);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.topic-area h4 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-lg);
    color: var(--text);
}

.topic-area ul {
    margin: 0;
    padding-left: var(--space-4);
}

.topic-area li {
    margin-bottom: var(--space-1);
    color: var(--muted);
}

.speaking-cta {
    text-align: center;
    padding: var(--space-6) 0;
}

.speaking-note {
    margin-top: var(--space-3);
    font-style: italic;
    color: var(--muted);
    font-size: var(--text-sm);
}

/* Contact page styles */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin: var(--space-6) 0;
}

.contact-item {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 50%, transparent);
}

.contact-item h4 {
    margin: 0 0 var(--space-2);
    color: var(--text);
    font-size: var(--text-lg);
}

.contact-item p {
    margin: 0 0 var(--space-3);
    color: var(--muted);
    font-size: var(--text-sm);
}

/* Blog page styles */
.rss-link {
    float: right;
    font-size: var(--text-sm);
    color: var(--muted);
    text-decoration: none;
    margin-left: var(--space-4);
}

.rss-link:hover {
    color: var(--link);
}

.post-list {
    margin-top: var(--space-6);
}

.post-preview {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
}

.post-preview:last-child {
    border-bottom: none;
}

.post-preview h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xl);
    font-weight: 600;
}

.post-preview h3 a {
    text-decoration: none;
    color: var(--text);
}

.post-preview h3 a:hover {
    color: var(--link);
}

.post-preview .post-meta {
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--muted);
}

.post-excerpt {
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: var(--space-8) 0;
    color: var(--muted);
}

/* Additional responsive styles */
@media (max-width: 768px) {
    .talk-meta {
        flex-direction: column;
        gap: var(--space-1);
    }

    .topics-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .talk-topics {
        margin: var(--space-2) 0;
    }

    .contact-methods {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .rss-link {
        float: none;
        display: block;
        margin-top: var(--space-2);
        margin-left: 0;
    }

    .post-preview h3 {
        font-size: var(--text-lg);
    }
}
