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

/* Typography */
body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    line-height: 1.7;
    color: #2c3e50;
    background: #f8f9fa;
}

h1, h2, h3, h4, h5, h6 {
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-stretch: condensed;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Title bar */
.title-bar {
    background: #ffffff;
    border-bottom: 1px solid #e0e6ed;
}

.title-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.title-text {
    flex: 1;
    padding: 36px 32px 24px 20px;
}

.title-bar h1 {
    font-size: 2.8em;
    color: #2a6496;
    margin-bottom: 4px;
}

.contact-info {
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.contact-info a {
    color: #5a6d7e;
    text-decoration: none;
}

.contact-info a:hover {
    color: #2a6496;
    text-decoration: underline;
}

.contact-sep {
    color: #b0bec5;
    margin: 0 6px;
}

.tagline {
    color: #2c3e50;
    font-size: 1.1em;
    font-style: italic;
    margin-bottom: 10px;
    line-height: 1.5;
}

.bio {
    color: #5a6d7e;
    font-size: 1em;
    margin-bottom: 10px;
}

/* Profile photo */
.profile-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    flex-shrink: 0;
    align-self: center;
    margin: 20px 20px 20px 0;
}

/* Contact links */
.contact-links {
    padding-top: 14px;
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-stretch: condensed;
    font-weight: 500;
    font-size: 0.9em;
    letter-spacing: 0.03em;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
}

.contact-links a {
    color: #2a6496;
    text-decoration: none;
    margin-right: 20px;
    white-space: nowrap;
}

.contact-links a:hover {
    color: #1e3a54;
    text-decoration: underline;
}

/* Project strip */
.project-strip {
    background: #1e3a54;
}

.project-strip-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 24px;
}

.project-strip-header {
    padding: 18px 0 10px;
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
}

.project-cards-row {
    display: flex;
}

.project-card {
    flex: 1;
    display: flex;
    flex-direction: row;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.project-card:last-child {
    border-right: none;
}

.card-vertical {
    flex-direction: column-reverse;
}

.card-vertical .project-card-img {
    width: 100%;
    height: 110px;
    background-size: contain;
    background-position: center;
}

.project-card:hover {
    background: rgba(255,255,255,0.07);
}

.project-card-img {
    width: 130px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
}

.project-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card-placeholder span {
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-size: 0.75em;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.2);
    writing-mode: vertical-rl;
}

.project-card-text {
    flex: 1;
    padding: 22px 20px 22px 18px;
    display: flex;
    flex-direction: column;
    justify-content: top;
}

.project-card-text h4 {
    font-size: 1.2em;
    color: #ffffff;
    margin: 0 0 7px;
    text-transform: none;
    letter-spacing: 0.01em;
}

.project-card-text p {
    font-size: 0.97em;
    color: rgba(255,255,255,0.55);
    margin: 0;
    line-height: 1.5;
}

/* Research strip */
.research-strip {
    background: #eef1f4;
    border-top: 1px solid #dce4ec;
    border-bottom: 1px solid #dce4ec;
}

.research-card {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 0 0 24px;
}

.research-card-text {
    flex: 1;
}

.research-download {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    width: 120px;
}

.research-download img {
    width: 120px;
    border-radius: 6px;
    display: block;
}

.research-download span {
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    color: #2a6496;
    text-align: center;
}

.research-download:hover span {
    color: #1e3a54;
    text-decoration: underline;
}

.research-card-text h4 {
    font-size: 1.05em;
    color: #1e3a54;
    margin: 0 0 7px;
    text-transform: none;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.research-card-text p {
    font-size: 0.9em;
    color: #5a6d7e;
    margin: 0;
    line-height: 1.5;
}

.research-heading {
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 12px;
}

.research-card-links {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

.research-link {
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    color: #2a6496;
    text-decoration: none;
    white-space: nowrap;
}

.research-link:hover {
    color: #1e3a54;
    text-decoration: underline;
}

/* Main content */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Links */
a { color: #2a6496; }
a:hover { color: #1e3a54; }

/* Headings in content */
main h1 {
    font-size: 1.8em;
    color: #1e3a54;
}

main h2 {
    font-size: 1.4em;
    color: #1e3a54;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 6px;
    border-bottom: 1px solid #dce4ec;
}

main h3 {
    font-size: 1.15em;
    color: #2c3e50;
    margin-bottom: 8px;
}

main h4 {
    font-size: 0.95em;
    color: #2a6496;
    margin-top: 18px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

main h6 {
    font-size: 0.95em;
    color: #7f8c8d;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Paragraphs */
main p {
    margin-bottom: 14px;
}

/* Code */
pre {
    background: #eaf0f6;
    border-left: 3px solid #2a6496;
    padding: 16px;
    border-radius: 3px;
    overflow-x: auto;
    margin-bottom: 16px;
    font-size: 0.9em;
}

code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    background: #eaf0f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.88em;
}

pre code {
    background: none;
    padding: 0;
}

/* Images */
main img, .post-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

/* Lists */
main ul, main ol {
    margin-bottom: 16px;
    padding-left: 1.5em;
    list-style-position: outside;
}

main li {
    margin-bottom: 6px;
}

/* Two-column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 8px;
}

/* Education entries */
.edu-entry {
    margin-bottom: 16px;
    font-size: 0.95em;
    line-height: 1.6;
}

.edu-entry strong {
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-weight: 500;
    color: #1e3a54;
}

.edu-detail {
    display: block;
    margin-top: 4px;
    color: #5a6d7e;
    font-size: 0.93em;
}

/* Skills grid */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.95em;
}

.skill-label {
    display: block;
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-weight: 500;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #2a6496;
    margin-bottom: 1px;
}

/* Job entries */
.job-entry {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid #dce4ec;
}

.job-entry:last-of-type {
    border-bottom: none;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
}

.job-header h3 {
    margin-top: 0;
    margin-bottom: 2px;
}

.job-note {
    font-size: 0.8em;
    color: #7f8c8d;
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    display: block;
    margin-bottom: 4px;
}

.job-meta {
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-size: 0.85em;
    color: #5a6d7e;
    white-space: nowrap;
    padding-top: 4px;
    flex-shrink: 0;
}

.job-section {
    margin-top: 14px;
}

/* Post list */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.post-entry {
    padding: 32px 0;
    border-bottom: 1px solid #dce4ec;
}

.post-entry:first-child {
    padding-top: 0;
}

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

.post-preview {
    max-height: 300px;
}

.post-entry.truncated {
    overflow: hidden;
}

.read-more {
    display: none;
    position: relative;
    z-index: 1;
    margin-top: 0;
    padding-top: 8px;
    background: #f8f9fa;
    font-family: Futura, 'Trebuchet MS', Arial, sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    color: #2a6496;
    text-decoration: none;
}

.post-entry.truncated .read-more {
    display: block;
    padding-bottom: 32px;
    margin-bottom: -32px;
}

.post-entry.truncated .read-more::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #f8f9fa);
    pointer-events: none;
}

.read-more:hover {
    color: #1e3a54;
    text-decoration: underline;
}

/* Footer */
footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 20px;
    border-top: 1px solid #dce4ec;
    font-size: 0.8em;
    color: #7f8c8d;
}

footer a {
    color: #7f8c8d;
}

footer a:hover {
    color: #2a6496;
}

/* Screenshot row (e.g. How You Doin') */
.screenshot-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.screenshot-item {
    width: calc(25% - 12px);
    border-radius: 8px;
    max-width: 100%;
}

/* ── Responsive: narrow screens ───────────────────────────── */
@media (max-width: 680px) {

    /* Title bar: stack text then photo vertically */
    .title-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .title-text {
        padding: 24px 20px 8px;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
        margin: 0 0 20px;
        align-self: center;
    }

    .contact-links {
        justify-content: center;
    }

    /* Project cards: stack vertically with spacing between */
    .project-cards-row {
        flex-direction: column;
        gap: 12px;
    }

    /* iLog card: switch from stacked (image below) to image-left in narrow mode */
    .card-vertical {
        flex-direction: row-reverse;
    }

    .card-vertical .project-card-img {
        width: 110px;
        height: auto;
        min-height: 90px;
    }

    /* Research card: stack vertically */
    .research-card {
        flex-direction: column;
        gap: 16px;
    }

    .research-download {
        flex-direction: row;
        width: 100%;
        align-items: center;
        justify-content: flex-start;
        gap: 16px;
    }

    .research-download img {
        width: 72px;
    }

    /* Two-column grid: single column */
    .two-col {
        grid-template-columns: 1fr;
    }

    /* Job header: stack company and date */
    .job-header {
        flex-direction: column;
        gap: 2px;
    }

    .job-meta {
        white-space: normal;
        padding-top: 0;
    }

    /* Screenshot rows: two per row on narrow screens */
    .screenshot-item {
        width: calc(50% - 8px);
    }
}
