/* ============================================
   GLOBAL
   ============================================ */

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

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --muted: #666666;
    --line: #eeeeee;
    --sky: #4A90E2;
    --name-color: #2c2e7b;
    --logo-underline: #000000;
    --paragraph-size: clamp(1.40rem, 1.14vw, 1.525rem);
    --project-paragraph-size: 16px;
    --code-bg: #f3f3f3;
    --code-border: #e8e8e8;
    --icon-filter: grayscale(1) brightness(0);
}

[data-theme="dark"] {
    --bg: #0f0f10;
    --surface: #151518;
    --text: #f5f5f5;
    --name-color: #ffffff;
    --logo-underline: #ffffff;
    --muted: #b4b4b4;
    --line: #2a2a2e;
    --sky: #8ab4ff;
    --code-bg: #1d1d22;
    --code-border: #303039;
    --icon-filter: brightness(0) invert(1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.72;
    font-size: 17px;
    font-weight: 400;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    width: 100%;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.nav-container {
    width: 100%;
    max-width: none;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    line-height: 1;
}

.logo-mark {
    position: relative;
    display: inline-block;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1.2px;
}

.logo-mark::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 2px;
    background: var(--logo-underline);
    border-radius: 999px;
}

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

.nav-links a {
    text-decoration: none;
    color: #666666;
    font-size: 15px;
    font-weight: 400;
}

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

/* ============================================
   PAGE LAYOUT
   ============================================ */

.container,
.projects-container,
.footer-content {
    width: 100%;
    max-width: none;
}

.container {
    padding: 34px 32px 20px;
}

.projects-container {
    padding: 48px 32px 24px;
}

/* ============================================
   HOME
   ============================================ */

.hero {
    width: 100%;
}

.hero-header {
    margin-bottom: 20px;
}

.hero-header h1 {
    font-size: clamp(2.8rem, 4.4vw, 4rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.06em;
    color: var(--name-color);
}

.name-initial {
    font-weight: 900;
}

.name-last {
    font-weight: 900;
}

.hero-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 44px;
    width: 100%;
}

.hero-text {
    flex: 1 1 0;
    min-width: 0;
    max-width: 980px;
}

.bio {
    font-size: var(--paragraph-size);
    line-height: 1.4;
    color: var(--text);
    max-width: 980px;
    margin-bottom: 4px;
}

.tagline {
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--name-color);
    font-style: italic;
}

.bio code,
.tagline code,
.project-description code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 0.08em 0.35em;
}

.bio a,
.tagline a,
.project-description a {
    color: var(--sky);
    text-decoration: none;
}

.bio a:hover,
.tagline a:hover,
.project-description a:hover {
    text-decoration: underline;
}

.profile-image {
    flex: 0 0 370px;
    align-self: flex-start;
}

.profile-image img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    object-position: center;
    transform: scale(1.08);
    border-radius: 28px;
    overflow: hidden;
    background: var(--surface);
}

.projects-preview {
    display: none;
}

/* ============================================
   PROJECTS PAGE
   ============================================ */

.page-title {
    font-size: clamp(2.4rem, 4.4vw, 3.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.06em;
    margin-bottom: 48px;
    text-align: center;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 72px;
}

.project-card {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.project-image {
    flex: 0 0 360px;
}

.project-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 18px;
    background: #f5f5f5;
}

.project-info {
    flex: 1 1 0;
    min-width: 0;
}

.project-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.04em;
    margin-bottom: 14px;
}

.project-description {
    font-size: var(--project-paragraph-size);
    line-height: 1.45;
    color: var(--muted);
    max-width: 760px;
    margin-bottom: 18px;
}

.view-project {
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.view-project:hover {
    color: var(--sky);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    border-top: 1px solid var(--line);
    margin-top: 36px;
    padding: 24px 32px 32px;
    background: var(--surface);
}

.footer-content {
    text-align: center;
}

.social-links {
    margin-bottom: 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.social-links a {
    text-decoration: none;
    color: #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.social-links a img {
    width: 18px;
    height: 18px;
    display: block;
    opacity: 0.95;
    filter: var(--icon-filter);
}

.social-links a:hover {
    color: var(--sky);
}

.separator {
    display: none;
}

.email {
    font-size: 14px;
    color: var(--muted);
}

.theme-toggle {
    position: fixed;
    top: 76px;
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    display: grid;
    place-items: center;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.theme-toggle:hover {
    box-shadow: 0 0 0 1px var(--line), 0 14px 28px rgba(0, 0, 0, 0.12);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1100px) {
    .hero-content {
        gap: 40px;
    }

    .profile-image {
        flex-basis: 330px;
    }

    .project-card {
        gap: 28px;
    }

    .project-image {
        flex-basis: 320px;
    }
}

@media (max-width: 820px) {
    .nav-container,
    .container,
    .projects-container,
    .footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav-links {
        gap: 16px;
    }

    .hero-content {
        flex-direction: column;
        gap: 24px;
    }

    .hero-header {
        margin-bottom: 24px;
    }

    .profile-image {
        width: min(100%, 320px);
    }

    .profile-image img {
        height: 360px;
        object-position: center 34%;
    }

    .project-card {
        flex-direction: column;
    }

    .project-image {
        width: min(100%, 420px);
        flex-basis: auto;
    }

    .project-image img {
        height: 240px;
    }
}

@media (max-width: 520px) {
    .nav-container {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .logo-mark {
        font-size: 24px;
    }

    .nav-links a {
        font-size: 14px;
    }

    .theme-toggle {
        top: 66px;
        right: 12px;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .hero-header h1 {
        font-size: 2.8rem;
    }

    .bio {
        font-size: calc(var(--paragraph-size) - 2px);
    }

    .tagline,
    .email,
    .social-links {
        font-size: 13px;
    }

    .profile-image img {
        height: 330px;
        object-position: center 36%;
        border-radius: 18px;
    }

    .project-title {
        font-size: 21px;
    }

    .project-description {
        font-size: calc(var(--project-paragraph-size) - 2px);
    }
}
