/* --- CSS variables and themes --- */
:root {
    --nav-width: 1200px;
    --main-width: 1024px;
    --code-bg: #ffffff;
    --theme: #ededed;
    --secondary: rgb(30, 30, 30);
    --body-bg: #f5f5f5;
    --font-serif: 'Merriweather', Georgia, 'Times New Roman', Times, serif;
}

/* --- Base styles --- */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--body-bg);
    color: var(--secondary);
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* Fixed background image div for cross-browser mobile support */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-image: url('assets/profile.png');
    background-repeat: no-repeat;
    background-position: center 20%;
    background-size: contain;
}

/* Background image scaling for desktop vs mobile */
@media screen and (min-width: 768px) {
    .bg-image {
        background-size: auto 90vh; /* Set height to 90% of viewport on desktop */
        background-position: 65% center; /* Move Chris slightly to the right */
    }
}

@media screen and (max-width: 767px) {
    .bg-image {
        background-size: contain;
        background-position: center 25%;
    }
}

strong, b {
    font-weight: 900;
}

mark {
    background-color: var(--body-bg);
    color: var(--secondary);
    padding: 0 4px;
    font-family: var(--font-serif);
    font-weight: 400;
    border-radius: 2px;
}

/* --- Header / Navigation --- */
.header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav {
    max-width: var(--nav-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    height: 70px;
}

.logo a {
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    color: var(--secondary);
    letter-spacing: 0.5px;
}

#menu {
    display: flex;
    list-style: none;
    gap: 30px;
    padding: 0;
    margin: 0;
}

#menu a {
    text-decoration: none;
    color: var(--secondary);
    font-size: 15px;
    font-weight: 400;
    opacity: 0.8;
    transition: opacity 0.2s ease, border-bottom 0.2s ease;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
}

#menu a:hover {
    opacity: 1;
    border-bottom: 1px solid var(--secondary);
}

/* --- Main Layout --- */
.main {
    max-width: 100%;
    margin: 0 auto;
}

/* --- Hero Section (.first-entry home-info) --- */
.first-entry {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: calc(100vh - 70px);
    width: var(--main-width);
    max-width: 90%;
    margin: 0 auto;
    padding-bottom: 80px;
}

.first-entry .entry-header h1 {
    font-size: 130px;
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.05;
    margin: 0 0 25px 0;
    letter-spacing: -2px;
}

.first-entry .entry-content {
    font-size: 24px;
    font-weight: 400;
    max-width: 650px;
    margin-bottom: 35px;
}

.first-entry .entry-content mark {
    line-height: 1.5;
    background-color: var(--body-bg);
}

/* --- Social Icons --- */
.social-icons {
    display: flex;
    gap: 20px;
    padding-top: 10px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--secondary);
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.15s ease;
}

.social-icons a:hover {
    transform: scale(1.15);
    color: #000;
}

.social-icons svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* --- Content Sections (Scrollable below the fold) --- */
.content-section {
    background-color: var(--body-bg);
    border-top: 1px solid var(--theme);
    position: relative;
    z-index: 2;
    padding: 80px 0;
    width: 100%;
}

.section-header {
    width: var(--main-width);
    max-width: 90%;
    margin: 0 auto 30px auto;
}

.section-header h1 {
    font-size: 36px;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.5px;
}

.section-content {
    width: var(--main-width);
    max-width: 90%;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.7;
}

.section-content blockquote {
    border-left: 3px solid var(--theme);
    padding-left: 20px;
    margin: 25px 0;
    font-style: normal;
    color: rgb(80, 80, 80);
}

.section-content blockquote p {
    margin: 8px 0;
}

.section-content code {
    background-color: var(--theme);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
    color: rgb(50, 50, 50);
}

.section-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 15px;
}

.section-content ul {
    padding-left: 20px;
}

.section-content li {
    margin-bottom: 20px;
}

.section-content a {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.section-content a:hover {
    color: #000;
}

/* --- Footer --- */
.footer {
    background-color: var(--body-bg);
    border-top: 1px solid var(--theme);
    padding: 40px 20px;
    text-align: center;
    font-size: 14px;
    color: rgb(120, 120, 120);
    position: relative;
    z-index: 2;
}

.footer a {
    color: rgb(120, 120, 120);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
    color: var(--secondary);
}

/* --- Go To Top Button --- */
.top-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    background-color: var(--theme);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--secondary);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s, transform 0.15s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.top-link:hover {
    background-color: #dcdcdc;
    transform: translateY(-2px);
}

.top-link svg {
    width: 14px;
    height: 7px;
    fill: currentColor;
}

/* --- Responsive Breakpoints --- */
@media screen and (max-width: 1024px) {
    .first-entry .entry-header h1 {
        font-size: 80px;
        letter-spacing: -1px;
    }
    .first-entry {
        min-height: calc(100vh - 70px);
    }
}

@media screen and (max-width: 768px) {
    .first-entry .entry-header h1 {
        font-size: 60px;
    }
    .first-entry .entry-content {
        font-size: 18px;
    }
    .section-header h1 {
        font-size: 28px;
    }
    .section-content {
        font-size: 16px;
    }
    .nav {
        padding: 15px 20px;
    }
}
