/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --text-light: #888;
    --border-color: #d4d4d4;
    --border-heavy: #c0c0c0;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --bg-main: #ffffff;
    --bg-alt: #f8f8f8;
    --bg-border: #e8e8e8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-border);
    font-size: 16px;
    /* Add wider greyish borders on left and right - 2.5x original */
    border-left: 150px solid var(--bg-border);
    border-right: 150px solid var(--bg-border);
    min-height: 100vh;
}

/* Main container with white background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 150px;
    right: 150px;
    bottom: 0;
    background-color: var(--bg-main);
    z-index: -1;
}

/* Header */
header {
    background-color: var(--bg-main);
    padding: 2.5rem 0 2rem 0;
    margin-top: 2rem;
    z-index: 100;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6.5rem;
}

.site-name {
    font-family: 'American Typewriter', 'Courier New', Courier, monospace;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.site-name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-name a:hover {
    color: var(--accent-blue);
}

/* Navigation - unified blue color */
nav {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    position: relative;
    color: var(--accent-blue);
}

.nav-link:hover {
    background-color: var(--bg-alt);
    transform: translateY(-1px);
}

.nav-link.active {
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.8rem;
    right: 0.8rem;
    height: 2px;
    background-color: currentColor;
}

/* Main content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    display: none;
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

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

.content {
    max-width: 100%;
}

/* Typography */
h1 {
    font-family: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2 {
    font-family: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
    color: var(--text-primary);
}

h3 {
    font-family: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Home section with image */
.home-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    column-gap: 4rem;
    row-gap: 2rem;
}

.tagline {
    grid-column: 1;
    grid-row: 1;
}

.home-image {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    align-self: start;
}

.profile-pic {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: contain;
    border: 4px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.about {
    grid-column: 1;
    grid-row: 2;
}

.about p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Experience section */
.experience-item {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.experience-item:last-of-type {
    border-bottom: none;
}

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

.exp-period {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

.exp-company {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.exp-company a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.exp-company a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.exp-description {
    line-height: 1.7;
}

.section-subhead {
    margin-top: 3rem;
    font-size: 1.6rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.skill-tag {
    padding: 0.5rem 1.2rem;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.skill-tag:hover {
    background-color: var(--bg-main);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-2px);
}

/* Contact section */
.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background-color: var(--bg-alt);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-link i {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

.contact-link:hover {
    background-color: var(--bg-main);
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Contact Form */
.contact-form-section {
    margin-top: 3rem;
    padding: 2rem;
    background-color: var(--bg-alt);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.contact-form-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--bg-main);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.submit-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.form-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Form messages */
.form-message {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

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

.form-message-success {
    background-color: #d1fae5;
    border: 2px solid #10b981;
    color: #065f46;
}

.form-message-error {
    background-color: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.form-message p {
    margin: 0 0 1rem 0;
    font-weight: 600;
    font-size: 1.05rem;
}

.back-home-link {
    color: #059669;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-block;
    transition: color 0.2s ease;
}

.back-home-link:hover {
    color: #047857;
    text-decoration: underline;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Blog */
.blog-intro {
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.blog-post {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.blog-post-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

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

.blog-post-title a:hover {
    color: var(--accent-blue);
}

.blog-post-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.blog-post-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
}

.blog-post-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    display: inline-block;
    font-weight: 500;
}

.blog-post-link:hover {
    text-decoration: underline;
}

/* Blog post page */
.post-content {
    margin-top: 2rem;
}

.post-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.post-content .post-meta {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.post-content .post-body {
    line-height: 1.8;
}

.post-content .post-body p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.post-content .post-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.post-content .post-body h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.post-content .post-body code {
    background-color: var(--bg-alt);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.post-content .post-body pre {
    background-color: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.post-content .post-body pre code {
    background-color: transparent;
    padding: 0;
    border: none;
}

/* Enhanced code highlighting */
.post-content .post-body pre {
    position: relative;
}

.post-content .post-body pre code.hljs {
    display: block;
    padding: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Markdown-specific styles */
.post-content .post-body hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2.5rem 0;
}

.post-content .post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content .post-body table th,
.post-content .post-body table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-content .post-body table th {
    background-color: var(--bg-alt);
    font-weight: 600;
    color: var(--text-primary);
}

.post-content .post-body table tr:hover {
    background-color: var(--bg-alt);
}

.post-content .post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content .post-body ul,
.post-content .post-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-content .post-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.post-content .post-body blockquote {
    border-left: 4px solid var(--accent-blue);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content .post-body a {
    color: var(--accent-blue);
    text-decoration: none;
}

.post-content .post-body a:hover {
    text-decoration: underline;
}

.back-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    display: inline-block;
    font-weight: 500;
}

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

/* Resume Page */
.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--accent-blue);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.download-btn i {
    font-size: 1.1rem;
}

.resume-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 250px);
    min-height: 600px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-alt);
}

.resume-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

.resume-fallback {
    display: none;
    text-align: center;
    padding: 3rem;
}

.resume-fallback p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.resume-fallback a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.resume-fallback a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    text-align: center;
    border-top: 2px solid var(--border-color);
    margin-top: 4rem;
}

footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    body {
        border-left: 100px solid var(--bg-border);
        border-right: 100px solid var(--bg-border);
    }

    body::before {
        left: 100px;
        right: 100px;
    }
}

@media (max-width: 768px) {
    body {
        border-left: 50px solid var(--bg-border);
        border-right: 50px solid var(--bg-border);
    }

    body::before {
        left: 50px;
        right: 50px;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    header {
        margin-top: 1rem;
        padding: 1.5rem 0 1rem 0;
    }

    .header-content {
        padding: 0 1.5rem;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        text-align: center;
    }

    .site-name {
        font-size: 1.8rem;
    }

    nav {
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.95rem;
        padding: 0.4rem 0.8rem;
    }

    main {
        padding: 0 1.5rem;
    }

    .section {
        padding: 1.5rem 0;
    }

    /* Mobile home page layout */
    .home-container {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        text-align: center;
    }

    .tagline {
        order: 1;
        margin-bottom: 0.5rem;
    }

    .home-image {
        order: 2;
        margin-bottom: 0.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .about {
        order: 3;
        margin-top: 0;
    }

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

    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .contact-links {
        grid-template-columns: 1fr;
    }

    .contact-form-section {
        padding: 1.5rem;
    }

    footer {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        border-left: 25px solid var(--bg-border);
        border-right: 25px solid var(--bg-border);
    }

    body::before {
        left: 25px;
        right: 25px;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    header {
        margin-top: 0.5rem;
        padding: 1rem 0 0.75rem 0;
    }

    .header-content {
        padding: 0 1rem;
        gap: 1rem;
    }

    .site-name {
        font-size: 1.5rem;
    }

    nav {
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.35rem 0.7rem;
    }

    main {
        padding: 0 1rem;
    }

    .tagline {
        font-size: 1rem;
    }

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

    .about p {
        font-size: 1rem;
    }

    .contact-form-section {
        padding: 1.25rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }
}
