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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #f8f9fa;
    font-family: Arial, sans-serif;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.content > .container {
    padding-left: 0;
    padding-right: 0;
}

.card-title {
    color: #0d6efd;
    font-weight: bold;
}

.display-4 {
    font-weight: bold;
}

.resume-viewer {
    display: block;
    width: 100%;
    height: min(78vh, 1100px);
    min-height: 560px;
    border: 1px solid #dee2e6;
    background-color: #fff;
}

#page-footer {
    margin-top: 50px;
    text-align: center;
}

.simple-home {
    --home-paper: #fbfbf9;
    --home-ink: #22252a;
    --home-muted: #555c63;
    --home-link: #244a8f;
    --home-rule: #d8dadd;
    --home-focus: #244a8f;
    --home-intro-bg: #eaf0f7;
    --home-projects-bg: #edf1ea;
    --home-website-bg: #f3eee5;
    --home-portrait-bg: #dce5ef;
    --home-portrait-rule: #bccbdc;
    min-height: 100vh;
    background: var(--home-paper);
    color: var(--home-ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.7;
}

html[data-home-theme='dark'] {
    color-scheme: dark;
}

html[data-home-theme='light'] {
    color-scheme: light;
}

html[data-home-theme='dark'] .simple-home {
    --home-paper: #191b1e;
    --home-ink: #f0efeb;
    --home-muted: #c0c2c4;
    --home-link: #a8bdff;
    --home-rule: #464a50;
    --home-focus: #c0ceff;
    --home-intro-bg: #242c36;
    --home-projects-bg: #252d28;
    --home-website-bg: #302d27;
    --home-portrait-bg: #303b48;
    --home-portrait-rule: #526173;
}

.simple-home a {
    color: var(--home-link);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.simple-home a:hover {
    color: var(--home-ink);
}

.simple-home a:focus-visible,
.simple-home button:focus-visible {
    outline: 3px solid var(--home-focus);
    outline-offset: 3px;
}

.home-skip-link {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 8px;
    padding: 8px 12px;
    transform: translateY(-160%);
    background: var(--home-paper);
}

.home-skip-link:focus {
    transform: translateY(0);
}

.reading-column {
    width: min(860px, calc(100% - 48px));
    margin-inline: auto;
}

.reading-header {
    border-bottom: 1px solid var(--home-rule);
}

.reading-header__inner {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 18px 24px;
}

.simple-home .reading-brand {
    flex: 0 0 auto;
    color: var(--home-ink);
    font-size: 17px;
    font-weight: bold;
    text-decoration: none;
}

.reading-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 20px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.simple-home .reading-nav a[aria-current='page'] {
    color: var(--home-ink);
    text-decoration-thickness: 2px;
}

.theme-switch {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--home-ink);
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.theme-switch:hover {
    color: var(--home-link);
}

.theme-switch__icon {
    font-size: 17px;
    line-height: 1;
}

.home-content {
    padding-block: 34px 42px;
}

.simple-home .home-content h1,
.simple-home .home-content h2,
.simple-home .home-content h3 {
    color: var(--home-ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.3;
}

.simple-home .home-content h1 {
    margin: 0 0 22px;
    font-size: clamp(36px, 5vw, 46px);
    line-height: 1.08;
}

.simple-home .home-content h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.simple-home .home-content h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.simple-home .home-projects h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.home-kicker {
    margin: 0 0 17px;
    color: var(--home-muted);
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.11em;
}

.home-kicker span {
    padding-inline: 5px;
    color: var(--home-link);
}

.content-module {
    margin: 0;
    padding: 24px;
    background: var(--home-projects-bg);
}

.content-module + .content-module {
    margin-top: 14px;
}

.content-module--intro {
    background: var(--home-intro-bg);
}

.content-module--website {
    background: var(--home-website-bg);
}

.content-module p {
    margin: 0 0 14px;
}

.content-module p:last-child {
    margin-bottom: 0;
}

.simple-home .home-lead {
    margin-bottom: 0;
    color: var(--home-ink);
    font-size: 18px;
}

.home-about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
    align-items: center;
    gap: 36px;
}

.home-about-copy h2 {
    margin-bottom: 10px;
}

.home-portrait {
    width: 100%;
    margin: 0;
}

.home-portrait__slot {
    display: grid;
    width: 100%;
    min-height: 210px;
    aspect-ratio: 4 / 3;
    place-items: center;
    border: 1px solid var(--home-portrait-rule);
    background: var(--home-portrait-bg);
    color: var(--home-muted);
    text-align: center;
}

.home-portrait__slot span {
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.8;
}

.home-portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.home-portrait figcaption {
    margin-top: 7px;
    color: var(--home-muted);
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.home-projects {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--home-rule);
    counter-reset: project-number;
    list-style: none;
}

.home-projects li {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 17px 10px 18px 0;
    border-bottom: 1px solid var(--home-rule);
    counter-increment: project-number;
    text-align: justify;
}

.home-projects li > div::before {
    display: block;
    margin-bottom: 5px;
    color: var(--home-link);
    content: '0' counter(project-number);
    font-family: Arial, sans-serif;
    font-size: 11px;
}

.home-projects li:hover {
    background: color-mix(in srgb, var(--home-ink) 4%, transparent);
}

.simple-home .home-projects h3 a {
    color: var(--home-ink);
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.simple-home .home-projects h3 a:hover {
    color: var(--home-link);
    text-decoration-color: currentColor;
}

.home-projects p {
    margin: 0;
    color: var(--home-muted);
    font-size: 15px;
    line-height: 1.6;
}

.home-project-type {
    align-self: center;
    color: var(--home-muted);
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    text-align: right;
}

.home-section-link {
    margin: 13px 0 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.home-link-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--home-rule);
    list-style: none;
}

.home-link-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-block: 11px;
    border-bottom: 1px solid var(--home-rule);
}

.home-link-list li > span {
    color: var(--home-muted);
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.home-link-list li > a {
    text-align: right;
}

.contact-email {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.copy-email {
    padding: 3px 8px;
    border: 1px solid var(--home-rule);
    background: transparent;
    color: var(--home-link);
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.copy-email:hover {
    border-color: var(--home-link);
}

.home-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-block: 17px 28px;
    color: var(--home-muted);
    font-family: Arial, sans-serif;
    font-size: 13px;
}

@media (max-width: 720px) {
    .reading-header__inner {
        min-height: 0;
        flex-wrap: wrap;
        justify-content: space-between;
        padding-block: 14px;
    }

    .reading-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 8px 18px;
    }

    .home-about-layout {
        grid-template-columns: minmax(0, 1fr) minmax(190px, 0.8fr);
        gap: 24px;
    }

    .home-projects li {
        grid-template-columns: minmax(0, 1fr) 125px;
        gap: 14px;
    }
}

@media (max-width: 420px) {
    .reading-column {
        width: calc(100% - 32px);
    }

    .simple-home {
        font-size: 16px;
    }

    .simple-home .home-lead {
        font-size: 17px;
    }

    .content-module {
        padding: 19px;
    }

    .home-about-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .home-portrait {
        max-width: 340px;
    }

    .home-portrait__slot {
        min-height: 0;
    }

    .home-projects li {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-right: 4px;
    }

    .home-project-type {
        padding-left: 25px;
        text-align: left;
    }

    .home-link-list {
        grid-template-columns: 1fr;
    }

    .contact-email {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .home-content {
        padding-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .simple-home *,
    .simple-home *::before,
    .simple-home *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Restore nested lists inside project content */
.home-projects li ul,
.home-projects li ol {
    margin: 10px 0;
    padding-left: 24px;
}

.home-projects li ul {
    list-style-type: disc;
}

.home-projects li ol {
    list-style-type: decimal;
}

/* Nested lists */
.home-projects li ul ul {
    list-style-type: circle;
}

.home-projects li ul ul ul {
    list-style-type: square;
}

.home-projects li li {
    display: list-item;
    padding: 2px 0;
    border-bottom: none;
    counter-increment: none;
}

/* Keep the outer project numbering separate */
.home-projects > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 20px;
}

/* Style nested ordered-list numbers */
.home-projects li ol {
    list-style: none;
    counter-reset: nested-item;
}

.home-projects li ol > li {
    counter-increment: nested-item;
    position: relative;
    padding-left: 28px;
}

.home-projects li ol > li::before {
    content: "0" counter(nested-item);
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--home-link);
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: inherit;
    letter-spacing: 0;
}


/* Fix project content width */
.home-projects > li {
    grid-template-columns: minmax(0, 1fr) auto;
}

.home-projects > li > div {
    min-width: 0;
    width: 100%;
}

.home-projects > li > div p,
.home-projects > li > div ul,
.home-projects > li > div ol {
    max-width: none;
    width: 100%;
}

/* Nested list items should not inherit the project grid */
.home-projects > li li {
    display: list-item;
    width: auto;
}