/* ==========================================================================
   DESIGN SYSTEM — ERIC HANSEN
   Editorial, light, serif-led. Warm paper background, ink text, hairline rules,
   a single restrained accent. Typography does the work; effects stay minimal.
   ========================================================================== */

:root {
    --bg-primary: #f7f4ee;
    /* Warm paper */
    --bg-elevated: #fbf9f5;
    /* Slightly lifted panels */
    --text-primary: #211f1b;
    /* Warm near-black ink */
    --text-secondary: #524c43;
    /* Muted ink */
    --text-muted: #8b8478;
    /* Soft warm gray */
    --border-color: rgba(33, 31, 27, 0.13);
    /* Hairline rules */
    --accent-hover: rgba(33, 31, 27, 0.30);
    --accent: #7c4a32;
    /* Bookish sienna, used sparingly */
    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-sans: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    /* Guard against any element forcing the page wider than the screen, which
       makes mobile browsers shrink-to-fit and show stray scrollbars. */
    overflow-x: hidden;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-serif);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* CONTAINER ARCHITECTURE */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 1.5rem;
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.container-landing {
    max-width: 540px;
}

.container-detail {
    max-width: 700px;
    justify-content: flex-start;
    padding-top: 5rem;
}

/* NAV / BACK LINK */
.back-nav {
    margin-bottom: 3rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-style: italic;
    transition: color 0.2s ease;
}

.back-link svg {
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
}

.back-link:hover svg {
    transform: translateX(-3px);
}

/* LANDING PAGE HERO */
.landing-hero {
    margin-bottom: 2.75rem;
}

.landing-title {
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.005em;
}

.landing-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.6;
}

/* Structured "currently / previously" bio — mono keys, serif values */
.landing-bio {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem 1.25rem;
    align-items: baseline;
    margin-top: 0.5rem;
}

.bio-key {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.bio-key::after {
    content: ":";
}

.bio-val {
    font-size: 1.15rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.bio-org {
    color: var(--accent);
    font-style: italic;
    white-space: nowrap;
}

@media (max-width: 580px) {
    .landing-bio {
        grid-template-columns: 1fr;
        gap: 0.25rem 0;
    }

    .landing-bio .bio-val {
        margin-bottom: 0.85rem;
    }

    .landing-bio .bio-val:last-child {
        margin-bottom: 0;
    }
}

/* NAVIGATION LIST (LANDING PAGE) — an editorial index, ruled not boxed */
.landing-nav {
    display: flex;
    flex-direction: column;
    margin-bottom: 3.5rem;
    border-top: 1px solid var(--border-color);
}

.landing-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 0.25rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 400;
    transition: padding-left 0.2s ease, color 0.2s ease;
}

.landing-nav-item svg {
    color: var(--text-muted);
    flex: 0 0 auto;
    transition: transform 0.2s ease, color 0.2s ease;
}

.landing-nav-item:hover {
    padding-left: 0.75rem;
    color: var(--accent);
}

.landing-nav-item:hover svg {
    transform: translateX(3px);
    color: var(--accent);
}

/* Email copy-to-clipboard button (styled like a nav row, but not a link) */
.landing-nav-button {
    width: 100%;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    flex-wrap: wrap; /* hint drops below the address on narrow screens */
    min-width: 0;
}

.email-address {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-primary);
    min-width: 0;
    overflow-wrap: anywhere; /* wrap rather than push the page wider than the screen */
}

.email-hint {
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.landing-nav-button:hover {
    padding-left: 0; /* the address is monospace; shifting it looks off */
    color: var(--text-primary);
}

.landing-nav-button:hover .email-hint {
    color: var(--accent);
}

.landing-nav-button.copied .email-hint {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

/* SUBPAGE HEADER */
.page-header {
    margin-bottom: 3.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.75rem;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 0.6rem;
    letter-spacing: -0.005em;
}

.page-subtitle {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-muted);
}

/* SECTIONS */
.section {
    margin-bottom: 3.25rem;
}

.page-intro {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.page-intro a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(124, 74, 50, 0.35);
    transition: border-color 0.2s ease;
}

.page-intro a:hover {
    border-bottom-color: var(--accent);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    font-weight: 500;
}

/* WORK EXPERIENCE TIMELINE */
.timeline {
    position: relative;
    border-left: 1px solid var(--border-color);
    padding-left: 1.75rem;
    margin-left: 0.25rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.75rem;
}

.timeline-item:last-child {
    margin-bottom: 1rem;
}

.timeline-marker {
    position: absolute;
    left: calc(-1.75rem - 4.5px);
    top: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 2px solid var(--bg-primary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.job-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.job-company {
    color: var(--text-secondary);
    font-weight: 400;
    font-style: italic;
}

.job-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.job-bullets {
    list-style-type: none;
}

.job-bullets li {
    font-size: 1.05rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.job-bullets li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* EDUCATION LIST */
.education-item {
    margin-bottom: 2.25rem;
}

.education-item:last-child {
    margin-bottom: 0;
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}

.edu-degree {
    font-weight: 600;
    font-size: 1.2rem;
}

.edu-school {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-style: italic;
    margin-bottom: 0.5rem;
    display: block;
}

.edu-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.edu-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* SKILLS & READABILITY */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.skills-category {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.skills-category:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
}

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

.tag-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    background-color: rgba(33, 31, 27, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.7rem;
    border-radius: 2px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.readability-r {
    margin-left: 0.4rem;
    background-color: var(--accent);
    color: var(--bg-elevated);
    font-weight: 600;
    padding: 0.02rem 0.32rem;
    border-radius: 2px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
}

.category-note {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

.category-note span {
    font-weight: 600;
    font-style: normal;
}

/* GITHUB SHOWCASE */
.github-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border-color);
}

.repo-card {
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1.5rem 0.25rem;
    text-decoration: none;
    color: inherit;
    transition: padding-left 0.2s ease;
}

.repo-card:hover {
    padding-left: 0.75rem;
}

.repo-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
}

.repo-name {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.repo-lang {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.repo-desc {
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.repo-desc code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(33, 31, 27, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    color: var(--text-primary);
}

/* FOOTER */
.footer {
    margin-top: auto;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE LAYOUT */
@media (max-width: 580px) {
    .container {
        padding: 2rem 1.25rem;
    }

    .landing-title {
        font-size: 2.4rem;
    }

    .landing-desc {
        font-size: 1.1rem;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }

    .job-date {
        margin-bottom: 0.25rem;
    }
}

/* PRINT — clean paper resume; hide the terminal entirely */
@media print {

    .term-bar,
    .term-panel {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .container {
        animation: none;
        opacity: 1;
        padding: 0;
    }
}
