* {
    box-sizing: border-box;
}

:root {
    --orange: #f56600;
    --orange-dark: #c94f00;
    --navy: #1f2937;
    --gray: #6b7280;
    --light: #fffaf5;
    --white-glass: rgba(255, 255, 255, 0.88);
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--navy);
    background-color: #fff7ed;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 40px;
    position: relative;

    background-color: #fff7ed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='350' viewBox='0 0 500 350'%3E%3Cg fill='%23f56600' fill-opacity='0.16' font-family='Georgia, serif'%3E%3Ctext x='35' y='60' font-size='34'%3E%E2%88%AB f(x) dx%3C/text%3E%3Ctext x='300' y='65' font-size='38'%3E%CF%80%3C/text%3E%3Ctext x='405' y='90' font-size='32'%3E%E2%88%9E%3C/text%3E%3Ctext x='90' y='160' font-size='30'%3E%E2%88%91 a%E2%82%99%3C/text%3E%3Ctext x='290' y='165' font-size='30'%3Ex%C2%B2 + y%C2%B2%3C/text%3E%3Ctext x='25' y='265' font-size='32'%3E%E2%88%9Ax%3C/text%3E%3Ctext x='180' y='275' font-size='27'%3Edet(A)%3C/text%3E%3Ctext x='385' y='270' font-size='36'%3E%CE%BB%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 500px 350px;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 50px;
    position: relative;
    z-index: 1;
}

/* LEFT SIDE */

.profile {
    text-align: center;
    background: var(--white-glass);
    border-radius: 28px;
    padding: 35px 30px;
    border: 1px solid rgba(245, 102, 0, 0.14);
    box-shadow: 0 10px 35px rgba(31, 41, 55, 0.10);
    backdrop-filter: blur(6px);
}

.headshot {
    width: 230px;
    height: 230px;
    object-fit: cover;
    border-radius: 50%;
    border: 7px solid white;
    outline: 4px solid var(--orange);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.profile h1 {
    margin-top: 28px;
    margin-bottom: 7px;
    font-size: 2rem;
    color: var(--navy);
}

.profile h2 {
    margin-top: 0;
    font-size: 1rem;
    font-weight: normal;
    color: var(--orange-dark);
    letter-spacing: 0.04em;
}

.bio {
    margin-top: 25px;
    line-height: 1.65;
    text-align: left;
    color: #444;
}

/* RIGHT SIDE */

.tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-content: center;
}

.tile {
    background: var(--white-glass);
    border-radius: 20px;
    padding: 35px 30px;
    text-decoration: none;
    color: var(--navy);
    border: 1px solid rgba(245, 102, 0, 0.12);
    border-left: 6px solid var(--orange);
    box-shadow: 0 6px 18px rgba(31, 41, 55, 0.08);
    backdrop-filter: blur(6px);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-left-color 0.2s ease,
        background-color 0.2s ease;
}

.tile:hover {
    transform: translateY(-6px);
    box-shadow:
        0 12px 28px rgba(31, 41, 55, 0.14),
        0 0 0 1px rgba(245, 102, 0, 0.08);
    border-left-color: var(--orange-dark);
    background-color: white;
}

.tile h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.45rem;
    color: var(--orange-dark);
}

.tile p {
    margin: 0;
    line-height: 1.55;
    color: var(--gray);
}

/* SHARED CV AND RESEARCH HEADER */

.cv-page-simple {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 3px solid #f56600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.cv-topbar h1 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.cv-topbar a {
    color: #c94f00;
    text-decoration: none;
    font-weight: bold;
}

.cv-topbar a:hover {
    text-decoration: underline;
}

.cv-topbar a:focus-visible { outline: 3px solid var(--orange-dark); outline-offset: 5px; }
@media (max-width: 700px) {
    .cv-topbar { padding: 12px 15px; }
    .cv-topbar h1 { font-size: 1rem; }
}

/* RESEARCH PAGE */

.research-page { align-items: flex-start; min-height: 0; flex: 1; }
.research-container { width: 100%; max-width: 1120px; min-width: 0; }
.research-container a { color: #a84200; text-underline-offset: 5px; }
.research-container a:focus-visible { outline: 3px solid var(--orange-dark); outline-offset: 5px; }
.research-collection-label { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 16px; font-size: .78rem; color: #5c554e; }
.research-collection-label span:first-child { font-weight: bold; color: var(--navy); }
.paper-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.paper { min-width: 0; background: rgba(255,255,255,.96); border: 1px solid #e8ddd2; border-radius: 14px; padding: 30px; box-shadow: 0 5px 18px #30241808; }
.paper-featured { grid-column: 1 / -1; border-top: 3px solid var(--orange); display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 36px; padding: 36px; }
.paper-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.paper-kind { display: inline-block; padding: 7px 10px; background: #fff2e6; color: #8a3b07; border-radius: 5px; font-size: .7rem; line-height: 1.4; font-weight: bold; }
.paper-meta time { color: #65615b; font-size: .85rem; font-variant-numeric: tabular-nums; }
.paper-featured .paper-meta { flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; gap: 18px; margin: 0; border-right: 1px solid #eee2d8; padding-right: 24px; }
.paper-featured time { font: normal 2.8rem/1 Georgia, serif; color: #a84200; }
.paper h2 { margin: 0 0 16px; font: normal 1.45rem/1.35 Georgia, serif; letter-spacing: -.015em; color: #202d3b; overflow-wrap: break-word; }
.paper-featured h2 { font-size: clamp(1.6rem, 3vw, 2rem); max-width: 32ch; }
.paper p { font-size: .9rem; line-height: 1.7; color: #565656; margin: 10px 0; }
.paper p:first-of-type { color: #343c43; }
.paper .paper-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; padding: 10px 16px; border: 1px solid #dfb89a; border-radius: 6px; font-size: .8rem; font-weight: bold; text-decoration: none; background: #fffaf5; }
.paper .paper-link:hover { background: #fff0e1; border-color: #a84200; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 0 12px; }
.paper .paper-download { background: #a84200; border-color: #a84200; color: white; gap: 14px; }
.paper .paper-download:hover { background: #873600; border-color: #873600; }
.research-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 32px; padding: 24px 0 0; border-top: 1px solid #dbcabc; font-size: .8rem; line-height: 1.6; color: #625d57; }
@media (max-width: 800px) {
    .paper-featured { grid-template-columns: 120px minmax(0,1fr); gap: 24px; }
}
@media (max-width: 600px) {
    .paper-grid { grid-template-columns: 1fr; gap: 18px; }
    .paper, .paper-featured { padding: 26px; display: block; }
    .paper-featured .paper-meta { flex-direction: row; align-items: center; justify-content: space-between; border: 0; padding: 0; margin-bottom: 22px; }
    .paper-featured time { font: normal .85rem Arial, sans-serif; color: #65615b; }
}

/* MOBILE */

@media (max-width: 800px) {
    .page {
        padding: 30px 20px;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .profile {
        max-width: 500px;
        margin: 0 auto;
    }

    .tiles {
        grid-template-columns: 1fr;
    }
}
