/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties for Theming */
:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f5;
    --text-primary: #0a0a0a;
    --text-secondary: #404040;
    --text-tertiary: #737373;
    --border-primary: #e5e5e5;
    --border-secondary: #d4d4d4;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --shadow-sm: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #141414;
    --text-primary: #fafafa;
    --text-secondary: #d4d4d4;
    --text-tertiary: #a3a3a3;
    --border-primary: #262626;
    --border-secondary: #404040;
    --accent-primary: #3b82f6;
    --accent-hover: #60a5fa;
    --shadow-sm: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.2);
}

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-weight: 400;
    letter-spacing: -0.011em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container - WIDESCREEN */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* Navigation */
nav {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.nav-home {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}

.nav-home:hover {
    color: var(--accent-primary);
}

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

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

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
}

/* Hero Section with Profile Image */
.hero {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 3rem;
    align-items: start;
    margin: 2rem 0 3rem 0;
}

.hero-content {
    max-width: 900px;
}

.profile-image-container {
    position: relative;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.profile-image:hover {
    opacity: 0.9;
}

/* Typography */
h1 {
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 75ch;
    line-height: 1.6;
}

.subtitle {
    color: var(--text-tertiary);
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

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

a:hover {
    color: var(--accent-hover);
}

/* Lists */
ol, ul {
    margin-bottom: 1rem;
    padding-left: 1.75rem;
}

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

ol li {
    padding-left: 0.25rem;
}

/* Sections */
section {
    margin-bottom: 2.5rem;
}

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

/* Contact Links */
.contact-links {
    list-style: none;
    padding-left: 0;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.contact-links li {
    margin-bottom: 0;
}

.contact-links a {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

.contact-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-primary);
    transition: width 0.2s ease;
}

.contact-links a:hover {
    color: var(--accent-primary);
}

.contact-links a:hover::after {
    width: 100%;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
}

.recent-work img {
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.recent-work img:hover {
    opacity: 0.95;
}

/* Button */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    background-color: transparent;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    border: none;
    position: relative;
}

.button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-primary);
    transition: width 0.2s ease;
}

.button:hover {
    color: var(--accent-primary);
}

.button:hover::after {
    width: 100%;
}

.download-link {
    margin-bottom: 2rem;
}

/* Resume Page */
.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.resume-header-content h1 {
    margin-bottom: 0.5rem;
}

.resume-subtitle {
    color: var(--text-tertiary);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.resume-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    background-color: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    border: none;
    position: relative;
}

.button-secondary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.2s ease;
}

.button-secondary:hover {
    color: var(--text-primary);
}

.button-secondary:hover::after {
    width: 100%;
}

.button svg,
.button-secondary svg {
    flex-shrink: 0;
}

/* Resume Viewer */
.resume-viewer {
    position: relative;
    width: 100%;
}

.pdf-embed-container {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 800px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Resume Fallback */
.resume-fallback {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    transition: background-color 0.3s ease;
}

.resume-fallback svg {
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.resume-fallback h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.resume-fallback p {
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.fallback-actions {
    display: flex;
    gap: 1rem;
}

/* Blog */
.blog-posts {
    margin-top: 2rem;
    display: grid;
    gap: 2rem;
}

.blog-post-preview {
    padding: 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    transition: border-color 0.2s ease;
}

.blog-post-preview:hover {
    border-color: var(--text-tertiary);
}

.blog-post-preview h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

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

.blog-post-preview h2 a:hover {
    color: var(--accent-primary);
}

.blog-post-preview time {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.empty-state {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 1.1rem;
}

/* Blog Post Page */
.post-meta {
    color: var(--text-tertiary);
    margin-bottom: 2rem;
}

.post-meta time {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-primary);
}

/* Code */
code {
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background-color: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

pre {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-primary);
    background-color: transparent;
    transition: border-color 0.3s ease;
}

footer p {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 400;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
        padding: 0 2rem;
    }
}

@media (max-width: 900px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 1.5rem 0 2rem 0;
    }

    .profile-image-container {
        order: -1;
    }

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

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    section {
        margin-bottom: 2rem;
    }

    nav .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .contact-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .resume-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .resume-actions {
        width: 100%;
        flex-direction: column;
    }

    .resume-actions a {
        width: 100%;
        justify-content: center;
    }

    .pdf-embed-container {
        height: 600px;
        min-height: 600px;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .hero {
        margin: 1rem 0 1.5rem 0;
    }

    .profile-image {
        width: 100px;
        height: 100px;
    }

    section {
        margin-bottom: 1.5rem;
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2.5rem;
    height: 2.5rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 1000;
    opacity: 0.6;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: scale(1.1);
}

/* Hide/show sun and moon icons based on theme */
[data-theme="light"] .moon-icon {
    display: block;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
