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

html {
    --accent: #A55704;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scrollbar-gutter: stable;
}

body {
    /* font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; */
    font-family: "Lora", Georgia, serif;
    font-size: 20px;
    line-height: 1.6;
    background-color: #ffffff;
    padding: 2em;
    /* side margins at 2/3 of a centered 880px column */
    max-width: calc(100vw / 3 + 587px);
    margin: 0 auto;
    color: #000;
    padding-bottom: 0;
}

article {
    margin-bottom: 1.2em;
}

.main-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2rem;
}

.site-nav {
    display: flex;
    gap: 2rem;
    width: 100%;
    margin: 0;
    padding: 0 1rem;
}

a,
u {
    text-decoration-color: var(--accent);
    text-underline-offset: 3px;
}

.pub {
    margin-bottom: 1.75rem;
}

.pub-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.3rem;
}

.pub-authors,
.pub-venue {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #444;
}

.pub-venue a {
    color: var(--accent);
    text-decoration: none;
}

.pub-venue a:hover {
    text-decoration: underline;
}

.nav-star {
    color: var(--accent);
}

.me {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 3px;
}

.site-nav a {
    color: #1A1A1A;
    text-decoration: none;
    font-size: 0.95rem;
}

.site-nav a:hover {
    text-decoration: underline;
}

h2 {
    width: 100%;
    margin: 0 0 2rem;
    padding: 0 1rem;
    font-size: 1.8rem;
}

.profile-row {
    width: 100%;
    margin: 0 0 2rem;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

#profile-pic {
    flex-shrink: 0;
    width: 200px;
    height: 250px;
    object-fit: cover;
    border-radius: 0.25rem;
    display: block;
}

.contact-info {
    flex: 1;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.icon-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1A1A1A;
    text-decoration: none;
}

.icon-link:hover {
    text-decoration: underline;
}

.icon-img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--accent);
}

.link-text {
    flex: 1;
    line-height: 1.4;
    font-size: 0.9rem;
}

.intro-text {
    width: 100%;
    margin: 0 0 2rem;
    padding: 0 1rem;
}

.intro-text p {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.intro-text a {
    color: #1A1A1A;
}

.intro-divider {
    width: 100%;
    border: none;
    border-top: 1px solid #d0d0d0;
    margin: 1.5rem 0;
}

.posts-list {
    list-style: none;
    padding-left: 0;
    width: 100%;
    margin: 0;
    padding: 0 1rem;
}

.reads-note {
    width: 100%;
    padding: 0 1rem;
}

.posts-list li {
    margin-bottom: 0.9em;
}

.post-link {
    color: #1A1A1A;
    text-decoration: none;
    font-size: 1.05rem;
}

.post-link:visited {
    color: #1A1A1A;
}

.post-link:hover {
    text-decoration: underline;
}

main {
    width: 100%;
    margin: 2rem 0;
    padding: 0 1rem;
}

.lead {
    font-size: 1rem;
    line-height: 1.7;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #111;
}

.post-content p {
    margin-bottom: 1.1em;
}

.firefly-section { margin: 0rem 0 1rem; }
#firefly-canvas {
    display: block;
    width: 100%;
    height: 140px;
    margin: 0.5rem 0;
    cursor: crosshair;
    border-radius: 4px;
    touch-action: manipulation;
}
#firefly-canvas:focus-visible { outline: 1px dashed var(--accent); outline-offset: 4px; }
.firefly-hint { font-size: 0.75rem; color: #797366; line-height: 1.6; }

pre {
    background: #f5f5f5;
    padding: 0.8em;
    overflow-x: auto;
    border-radius: 4px;
    margin: 1em 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
    font-size: 0.8rem;
    line-height: 1.35;
}

pre[class*="language-"] {
    background: #f5f5f5;
    padding: 0.8em;
    overflow-x: auto;
    border-radius: 4px;
    margin: 1em 0;
}

code {
    font-family: inherit;
    white-space: pre;
}

code[class*="language-"] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
    font-size: 0.8rem;
    line-height: 1.35;
}

.post-title {
    width: 100%;
    margin: 2rem 0;
    padding: 0 1rem;
    font-size: 2rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    body {
        padding: 1.5em;
    }

    .profile-row {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    #profile-pic {
        width: 180px;
        height: 225px;
    }

    .contact-info {
        width: 100%;
        gap: 1.2rem;
    }

    .link-text {
        font-size: 0.85rem;
    }

    .icon-img {
        width: 18px;
        height: 18px;
    }

    .post-title {
        font-size: 1.5rem;
    }

    #o {
        font-size: 12px;
        min-height: 350px;
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1em;
        font-size: 18px;
    }

    .profile-row {
        flex-direction: column;
        gap: 1rem;
        padding: 0 0.75rem;
        align-items: flex-start;
    }

    #profile-pic {
        width: 160px;
        height: 200px;
    }

    .contact-info {
        width: 100%;
        gap: 1rem;
    }

    .link-text {
        font-size: 0.75rem;
        word-break: break-word;
    }

    .icon-img {
        width: 18px;
        height: 18px;
    }

    .icon-link {
        gap: 0.5rem;
    }

    .intro-text {
        padding: 0 0.75rem;
    }

    .intro-text p {
        font-size: 0.9rem;
    }

    h2 {
        font-size: 1.3rem;
        padding: 0 0.75rem;
    }

    .posts-list {
        padding: 0 0.75rem;
    }

    .post-title {
        font-size: 1.2rem;
        padding: 0 0.75rem;
    }

    main {
        padding: 0 0.75rem;
    }

    pre {
        font-size: 0.85rem;
        padding: 0.6em;
    }
}
