/* Google Fonts optimized with preload in HTML head */

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

:root {
    --primary-orange: #ff6b35;
    --primary-hover: #ff5722;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6a6a6a;
    --text-muted: #757575;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --border-light: #e5e5e5;
    --border-ultra-light: #f0f0f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
    --accent-yellow: #ffd93d;
    --code-bg: #f6f8fa;
    --quote-bg: #fdfdfd;
}

[data-theme="dark"] {
    --primary-orange: #ff8a5b;
    --primary-hover: #ff7043;
    --text-dark: #e8e8e8;
    --text-medium: #c0c0c0;
    --text-light: #9a9a9a;
    --text-muted: #7a7a7a;
    --bg-white: #0a0a0a;
    --bg-light: #141414;
    --border-light: #2a2a2a;
    --border-ultra-light: #1f1f1f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --accent-yellow: #ffd93d;
    --code-bg: #1a1a1a;
    --quote-bg: #0f0f0f;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-white);
    font-feature-settings: 'liga', 'kern';
}

/* RSS Icon Styles */
.list-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rss-icon {
    color: var(--text-light);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.rss-icon:hover {
    color: var(--primary-orange);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-rss {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-rss:hover {
    color: var(--primary-orange);
}

.footer-rss-link {
    color: var(--primary-orange);
    text-decoration: underline;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Links */
a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Header */
.header {
    padding: 1.5rem 0;
    background: var(--bg-white);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary-orange);
    text-decoration: none;
}

/* Hero Section */
.hero {
    padding: 6rem 0 4rem;
    background: var(--bg-white);
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-dark);
    white-space: nowrap;
}

.hero-tagline {
    font-size: 1.2rem;
    color: var(--text-medium);
    font-weight: 400;
    font-style: normal;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.hero-description {
    margin-top: 0;
}

.hero-description p {
    font-size: 1.1rem;
    color: var(--text-medium);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.hero-description p:first-child {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 400;
}

.hero-image {
    position: relative;
}

.profile-pic {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

/* Sections */
.blog,
.updates,
.projects {
    padding: 4rem 0;
    background: var(--bg-white);
}

.updates {
    background: var(--bg-light);
    overflow-x: hidden;
}

.updates .micro-posts {
    width: 100%;
    box-sizing: border-box;
}

.updates .micro-post {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.updates .micro-content {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}

.section-footer {
    margin-top: 2rem;
}

.view-all {
    color: var(--primary-orange);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--primary-hover);
}

/* Blog Cards */
.posts-grid {
    display: grid;
    gap: 2rem;
}

.post-card {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-ultra-light);
    transition: transform 0.2s ease;
}

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


.post-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.post-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: var(--primary-orange);
}

.post-excerpt {
    font-size: 1rem;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.read-more:hover {
    text-decoration: underline;
}

/* Updates Section */
.micro-posts {
    display: grid;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.micro-post {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-ultra-light);
}

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

.micro-meta {
    margin-bottom: 0.5rem;
}

.micro-meta time {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.micro-title {
    margin: 0.5rem 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.micro-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.micro-title a:hover {
    color: var(--primary-orange);
}

.micro-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-medium);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.micro-content p {
    margin-bottom: 0.5rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Rich text formatting in updates */
.micro-content h1,
.micro-content h2,
.micro-content h3,
.micro-content h4,
.micro-content h5,
.micro-content h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.micro-content h1 { font-size: 1.1rem; }
.micro-content h2 { font-size: 1.05rem; }
.micro-content h3 { font-size: 1rem; }

.micro-content ul,
.micro-content ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.micro-content li {
    margin-bottom: 0.25rem;
}

.micro-content blockquote {
    padding: 1rem 0.75rem 0.5rem;
    border-left: 2px solid var(--primary-orange);
    margin: 0.75rem 0;
    font-style: italic;
    color: var(--text-light);
    position: relative;
    background: var(--quote-bg);
    border-radius: 3px;
}

.micro-content blockquote::before {
    content: '"';
    position: absolute;
    top: -0.1rem;
    left: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 107, 53, 0.32);
    font-family: Georgia, serif;
    line-height: 1;
}

.micro-content blockquote::after {
    content: '"';
    position: absolute;
    bottom: -0.5rem;
    right: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 107, 53, 0.32);
    font-family: Georgia, serif;
    line-height: 1;
}

.micro-content code {
    background: var(--code-bg);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.micro-content pre {
    background: var(--code-bg);
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

.micro-content strong {
    font-weight: 600;
    color: var(--text-dark);
}

.micro-content em {
    font-style: italic;
}

.micro-link {
    color: var(--primary-orange);
    text-decoration: none;
}

.micro-link:hover {
    text-decoration: underline;
}

.micro-footer {
    text-align: left;
    margin-top: 2rem;
}

.view-all-link {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Projects Section */
.project-list {
    display: grid;
    gap: 1.5rem;
}

.project-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-ultra-light);
}

.project-item:last-child {
    border-bottom: none;
}

.project-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
}

.project-title a {
    color: var(--primary-orange);
    text-decoration: underline;
    text-decoration-color: var(--primary-orange);
    text-underline-offset: 2px;
    font-weight: 600;
}

.project-status {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--quote-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.project-description {
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-light);
}

/* Article Page */
.article {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.article-header {
    margin-bottom: 3rem;
    text-align: center;
}

.article-image {
    margin: 2rem 0;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.article-content {
    font-size: 1.2rem;
    line-height: 1.8;
    font-weight: 400;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 3rem 0 1rem;
    letter-spacing: -0.02em;
}

.article-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ol,
.article-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    display: block;
}

.article-content blockquote {
    border-left: 3px solid var(--primary-orange);
    padding: 1.5rem 1.5rem 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-medium);
    position: relative;
    background: var(--quote-bg);
    border-radius: 4px;
}

.article-content blockquote::before {
    content: '"';
    position: absolute;
    top: -0.2rem;
    left: 0.75rem;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 107, 53, 0.35);
    font-family: Georgia, serif;
    line-height: 1;
}

.article-content blockquote::after {
    content: '"';
    position: absolute;
    bottom: -0.8rem;
    right: 0.75rem;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 107, 53, 0.35);
    font-family: Georgia, serif;
    line-height: 1;
}

.article-content blockquote p {
    margin-bottom: 0;
}

.article-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--border-light);
}

.article-content code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--text-dark);
}

.article-content pre code {
    background: transparent;
    padding: 0;
    border: none;
}

/* List Pages */
.list-page {
    padding: 4rem 0;
}

.list-header {
    margin-bottom: 3rem;
}

.list-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.list-description {
    font-size: 1.1rem;
    color: var(--text-medium);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-links {
        gap: 1.5rem;
        justify-content: center;
    }

    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-title {
        font-size: 2.2rem;
        white-space: normal;
        line-height: 1.2;
    }

    .hero-tagline {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .hero-description {
        text-align: left;
    }

    .hero-description p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .hero-image {
        order: -1;
        margin: 0 auto;
    }

    .profile-pic {
        width: 160px;
        height: 160px;
    }

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

    .post-title {
        font-size: 1.3rem;
    }

    .post-card {
        padding: 1.5rem 0;
    }

    .post-excerpt {
        font-size: 0.95rem;
    }

    .micro-posts {
        gap: 1rem;
        max-width: 100%;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .updates .container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .micro-post {
        padding: 1rem 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .micro-content {
        font-size: 0.95rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    .micro-content * {
        max-width: 100% !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .micro-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .micro-meta time {
        font-size: 0.8rem;
    }

    .project-list {
        gap: 1rem;
    }

    .project-item {
        padding: 1rem 0;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .article {
        padding: 2rem 1rem;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-image {
        order: -1;
        position: static;
    }
    
    .about-profile-pic {
        width: 200px;
        height: 200px;
    }
    
    .about-header h1 {
        font-size: 2.2rem;
    }
    
    .about-text {
        font-size: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

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

    .hero-tagline {
        font-size: 0.9rem;
    }

    .hero-description p {
        font-size: 0.9rem;
    }

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

    .micro-content,
    .post-excerpt,
    .project-description {
        font-size: 0.9rem;
    }

    .micro-title {
        font-size: 0.95rem;
    }

    .micro-meta time {
        font-size: 0.75rem;
    }
}

.hidden {
    display: none;
}

/* Nuclear option for mobile overflow fixes */
@media (max-width: 768px) {
    .updates,
    .updates .container,
    .updates .micro-posts,
    .updates .micro-post,
    .updates .micro-content,
    .updates .micro-content p,
    .updates .micro-title {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .updates .container {
        padding: 0 1rem !important;
        margin: 0 !important;
    }

    /* Allow link previews to be natural width but constrain them */
    .updates .link-preview,
    .updates .link-preview-card {
        width: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
}