/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

:root {
    --color-text: #1a1a2e;
    --color-text-secondary: #555;
    --color-bg: #fff;
    --color-border: #e0e0e0;
    --color-accent: #2d5a7b;
    --color-accent-light: #f0f5f9;
    --color-muted: #888;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --max-width: 720px;
    --max-width-wide: 1080px;
}

html {
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-main {
    min-height: calc(100vh - 160px);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    border-bottom: 1px solid var(--color-border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.site-title:hover {
    text-decoration: none;
}

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

.site-nav a {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.15s;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    transition: 0.2s;
}

/* ==========================================================================
   Homepage
   ========================================================================== */

.hero {
    padding: 6rem 0 4rem;
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.hero-name {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.hero-summary {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 3rem;
    max-width: 600px;
}

.highlights {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

.highlights-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-bottom: 1.5rem;
    max-width: var(--max-width);
}

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

.highlight-card {
    background: var(--color-accent-light);
    border-radius: 8px;
    padding: 1.5rem;
}

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

.highlight-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.highlight-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.career-section,
.education-section,
.skills-section {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.career-container {
    max-width: var(--max-width);
}

.career-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.career-entry {
    display: flex;
    gap: 1.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
    align-items: baseline;
}

.career-entry:last-child {
    border-bottom: none;
}

.career-period {
    flex-shrink: 0;
    width: 160px;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.career-role {
    font-size: 0.95rem;
}

.career-note {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.career-note::before {
    content: "· ";
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    background: var(--color-accent-light);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.home-links {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
    display: flex;
    gap: 1.5rem;
}

.home-links a {
    font-weight: 500;
    font-size: 1rem;
}

/* ==========================================================================
   Blog / Post Listing
   ========================================================================== */

.post-feed {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

.post-feed-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.post-card {
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem 0;
}

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

.post-card-link {
    display: block;
    color: inherit;
}

.post-card-link:hover {
    text-decoration: none;
}

.post-card-link:hover .post-card-title {
    color: var(--color-accent);
}

.post-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.post-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    transition: color 0.15s;
}

.post-card-excerpt {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.post-card-meta {
    font-size: 0.8rem;
    color: var(--color-muted);
    display: flex;
    gap: 1rem;
}

/* ==========================================================================
   Single Post / Page
   ========================================================================== */

.post-template .site-main,
.page-template .site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

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

.post-title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    display: flex;
    gap: 1rem;
}

.post-feature-image {
    margin-bottom: 2rem;
    border-radius: 6px;
    overflow: hidden;
}

.post-feature-image img {
    width: 100%;
    display: block;
}

/* Ghost content styles */
.gh-content {
    font-size: 1rem;
    line-height: 1.8;
}

.gh-content > * + * {
    margin-top: 1.5rem;
}

.gh-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 3rem;
    letter-spacing: -0.01em;
}

.gh-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2.5rem;
}

.gh-content ul, .gh-content ol {
    padding-left: 1.5rem;
}

.gh-content li + li {
    margin-top: 0.4rem;
}

.gh-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 1.25rem;
    color: var(--color-text-secondary);
    font-style: italic;
}

.gh-content pre {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: #f5f5f5;
    padding: 0.15em 0.35em;
    border-radius: 3px;
}

.gh-content pre code {
    background: none;
    padding: 0;
}

.gh-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 3rem 0;
}

.gh-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gh-content img {
    border-radius: 6px;
}

.gh-content .kg-card {
    margin-top: 2rem;
}

.gh-content .kg-width-wide {
    max-width: var(--max-width-wide);
    margin-left: calc(50% - min(50vw - 1.5rem, var(--max-width-wide) / 2));
    width: calc(min(100vw - 3rem, var(--max-width-wide)));
}

.gh-content .kg-width-full {
    max-width: none;
    margin-left: calc(50% - 50vw);
    width: 100vw;
}

.gh-content .kg-width-full img {
    border-radius: 0;
}

.gh-content figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
}

/* ==========================================================================
   About & Experience Pages
   ========================================================================== */

.page-about .post-title,
.page-experience .post-title {
    font-size: 2rem;
}

/* Experience timeline */
.gh-content .experience-entry {
    border-left: 2px solid var(--color-border);
    padding-left: 1.5rem;
    margin-top: 2rem;
}

.gh-content .experience-entry h3 {
    margin-top: 0;
}

/* ==========================================================================
   Tag Archive
   ========================================================================== */

.tag-header {
    padding: 3rem 0 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.tag-name {
    font-size: 2rem;
    font-weight: 700;
}

.tag-description {
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

/* ==========================================================================
   Error Pages
   ========================================================================== */

.error-page {
    text-align: center;
    padding: 8rem 1.5rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-border);
    line-height: 1;
}

.error-message {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    margin-top: 1rem;
}

.error-page a {
    display: inline-block;
    margin-top: 2rem;
    font-weight: 500;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* ==========================================================================
   Mobile
   ========================================================================== */

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

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 1rem 1.5rem;
        z-index: 100;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 0.75rem;
    }

    .site-header .container {
        position: relative;
    }

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

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

    .highlights {
        padding-bottom: 3rem;
    }

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

    .home-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .career-entry {
        flex-direction: column;
        gap: 0.2rem;
    }

    .career-period {
        width: auto;
    }

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

@media (max-width: 480px) {
    .hero-name {
        font-size: 1.7rem;
    }

    .highlights-grid {
        grid-template-columns: 1fr;
    }

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