/* ============================================================
   New site theme — deep space + thin lines of light.
   Layered over reset.css + index.css. Loaded after index.css so
   these rules win. Drives article typography + the shared chrome.
   ============================================================ */

:root {
    --text-color: #c9c9cc;
    --text-color-alt: #8a8a8f;
    --background-color: #070708;
    --background-color-alt: #101012;
    --bh-accent: #e9e9ec;
    --bh-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bh-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

html {
    background-color: #070708;
    color: var(--text-color);
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    position: relative;
    z-index: 0;
    font-family: var(--bh-sans);
    padding-top: calc(var(--line-height) + 3.4rem) !important;
}

/* ---------- starfield + nebula (behind everything) ---------- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-image:
        radial-gradient(70% 55% at 84% 6%, rgba(255, 255, 255, .07), transparent 62%),
        radial-gradient(62% 52% at 6% 90%, rgba(200, 200, 210, .06), transparent 62%),
        radial-gradient(42% 36% at 32% 22%, rgba(255, 255, 255, .035), transparent 60%),
        radial-gradient(1.3px 1.3px at 12% 18%, #ffffff, transparent),
        radial-gradient(1px 1px at 27% 42%, rgba(255,255,255,.9), transparent),
        radial-gradient(1.1px 1.1px at 38% 9%, #fff, transparent),
        radial-gradient(1px 1px at 44% 66%, rgba(255,255,255,.8), transparent),
        radial-gradient(1.4px 1.4px at 52% 24%, #fff, transparent),
        radial-gradient(1px 1px at 58% 78%, rgba(255,255,255,.85), transparent),
        radial-gradient(1px 1px at 63% 38%, #fff, transparent),
        radial-gradient(1.2px 1.2px at 69% 12%, rgba(255,255,255,.9), transparent),
        radial-gradient(1px 1px at 74% 58%, #fff, transparent),
        radial-gradient(1px 1px at 81% 33%, rgba(255,255,255,.8), transparent),
        radial-gradient(1.3px 1.3px at 88% 71%, #fff, transparent),
        radial-gradient(1px 1px at 93% 46%, rgba(255,255,255,.85), transparent),
        radial-gradient(1px 1px at 7% 55%, #fff, transparent),
        radial-gradient(1.1px 1.1px at 18% 73%, rgba(255,255,255,.8), transparent),
        radial-gradient(1px 1px at 33% 88%, #fff, transparent),
        radial-gradient(1.2px 1.2px at 47% 49%, rgba(255,255,255,.85), transparent),
        radial-gradient(1px 1px at 61% 94%, #fff, transparent),
        radial-gradient(1px 1px at 79% 90%, rgba(255,255,255,.8), transparent),
        radial-gradient(1.1px 1.1px at 96% 22%, #fff, transparent),
        radial-gradient(1px 1px at 22% 6%, #fff, transparent),
        radial-gradient(1px 1px at 41% 31%, rgba(255,255,255,.75), transparent),
        radial-gradient(1px 1px at 67% 68%, #fff, transparent),
        radial-gradient(1px 1px at 86% 18%, rgba(255,255,255,.8), transparent);
}

/* ---------- the hero itself: a real render of the homepage black hole ---------- */
body::after {
    content: "";
    position: fixed;
    top: -16vmin;
    right: -20vmin;
    width: min(112vmin, 1150px);
    height: min(112vmin, 1150px);
    z-index: -1;
    pointer-events: none;
    background: url("public/bh-hero.png") center / contain no-repeat;
    mix-blend-mode: screen;
    opacity: .52;
    -webkit-mask-image: radial-gradient(closest-side, #000 48%, transparent 90%);
    mask-image: radial-gradient(closest-side, #000 48%, transparent 90%);
    transform: translateZ(0);
}

@media (max-width: 720px) {
    body::after {
        top: -8vmin;
        right: -34vmin;
        width: 132vmin;
        height: 132vmin;
        opacity: .4;
    }
}

/* old left sidebar retired in favour of the top-right nav */
.site-sidebar { display: none !important; }
.site-layout { max-width: none !important; justify-content: center; gap: 0 !important; }
.main-content { max-width: min(78ch, 100%); margin: 0 auto; }

/* index.css applies `* + * { margin-top: var(--line-height) }` for vertical
   rhythm. Inside flex/grid containers that margin is unwanted: it stretches
   chips into tall empty pills and warps card/timeline spacing. Neutralise it
   for the containers we control; gaps handle the spacing instead. */
.site-layout > *,
.chips > *,
.project-tags > *,
.project-card > *,
.project-card-noimg > *,
.project-card-noimg-tall > *,
.timeline-head > *,
.timeline-item > *,
.iss-coords > *,
.book-list > *,
.book-list li > *,
.widgets-grid > *,
.intro-container > *,
.entry-list > li > *,
.page-head > *,
.page-head-meta > *,
.page-head-meta-item > * {
    margin-top: 0;
}

/* ---------- typography ---------- */
.main-content p,
.main-content li,
.main-content dd,
.main-content dt {
    font-family: var(--bh-sans);
    font-size: 1.02rem;
    line-height: 1.78;
    color: #c6c6c9;
}
.main-content strong { color: #fff; font-weight: 650; }
.main-content em { color: #e0e0e2; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--bh-sans);
    font-weight: 650;
    letter-spacing: -.01em;
    color: #fff;
}

h2 {
    position: relative;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    text-transform: none;
    margin: 2.8rem 0 .9rem;
    padding-bottom: .6rem;
}
h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .1) 55%, transparent);
}
h3 { font-size: 1.12rem; margin: 2rem 0 .6rem; color: #eeeef0; }

a:link, a:visited {
    color: #e6e6ea;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .28);
}
a:hover { color: #fff; border-color: #fff; }

blockquote {
    position: relative;
    border-left: none;
    margin: 2rem 0;
    padding: .1rem 0 .1rem 1.3rem;
    color: #d7d7da;
    font-style: italic;
}
blockquote::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .08));
}

hr {
    height: 1px;
    border: none;
    margin: 2.6rem 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
}

code, pre, kbd, samp {
    font-family: var(--bh-mono);
}
pre {
    background: #0e0e14;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    overflow: auto;
    font-size: .86rem;
}
:not(pre) > code {
    background: rgba(255, 255, 255, .07);
    border-radius: 4px;
    padding: .12em .38em;
    font-size: .88em;
}

img {
    max-width: 100%;
    border-radius: 8px;
}

figure { margin: 2rem 0; }
figcaption { font-size: .78rem; color: var(--text-color-alt); margin-top: .6rem; letter-spacing: .04em; }

/* ---------- article masthead ---------- */
.page-head {
    position: relative;
    margin: 0 0 3rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
}
.page-head::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 3.2rem;
    height: 2px;
    background: #fff;
}
.page-head-title {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -.03em;
    margin: 0;
    text-transform: none;
    color: #fff;
}
.page-head-subtitle {
    margin: .85rem 0 0;
    max-width: 48ch;
    font-size: 1rem;
    line-height: 1.6;
    color: #9a9a9e;
}
.page-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.9rem;
}
.page-head-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: .5rem;
    padding: .5em .8em;
    border: 1px solid rgba(255, 255, 255, .14);
}
.page-head-meta-label {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: #7a7a7e;
    font-weight: 600;
}
.page-head-meta-value {
    font-size: .8rem;
    color: #e6e6ea;
}
.page-head-meta-value time { white-space: nowrap; }

/* generic content tables */
.main-content table:not(.header) {
    width: 100%;
    border-collapse: collapse;
}
.main-content table:not(.header) th,
.main-content table:not(.header) td {
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    padding: .5em .7em;
    text-align: left;
}

/* small screens */
@media (max-width: 520px) {
    .page-head-title { font-size: 1.9rem; }
    .page-head-meta { gap: .4rem; }
}

/* ---------- project cards: never inherit the link colour ---------- */
.projects-container a,
.project-card,
.project-card:hover,
.project-card-noimg,
.project-card-noimg-tall {
    color: #c6c6c9;
    border-bottom: none;
    text-decoration: none;
}
.project-card .project-title,
.project-card-noimg .project-title,
.project-card-noimg-tall .project-title { color: #fff; }
.project-card .project-description,
.project-card-noimg .project-description,
.project-card-noimg-tall .project-description { color: #aaaaae; }
.project-card,
.project-card-noimg,
.project-card-noimg-tall {
    border-color: rgba(255, 255, 255, .12) !important;
    background: rgba(255, 255, 255, .025);
    box-shadow: none;
}
.project-card:hover,
.project-card-noimg:hover,
.project-card-noimg-tall:hover { transform: translateY(-2px); }
.project-tags { align-items: center; gap: .4rem; }
.project-tag { color: #e7e7ea; }

/* ---------- interactive cosmic objects (bh-cosmos.js) ---------- */
canvas[data-cosmos] {
    position: absolute;
    top: -8vmin;
    right: -9vmin;
    width: min(64vmin, 700px);
    height: min(64vmin, 700px);
    z-index: 0;
    pointer-events: none;
}

/* ---------- resume (profile) ---------- */
.resume { margin: 1.8rem 0 2.8rem; }
.resume > h2 { margin-top: 0; }

.resume-section {
    font-size: .72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .22em;
    color: #dcdce0;
    margin: 2.6rem 0 1.2rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

/* experience timeline */
.timeline {
    position: relative;
    padding: 0 0 0 1.3rem;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 3px;
    top: .55rem;
    bottom: .55rem;
    width: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .04));
}
.timeline-item {
    position: relative;
    padding: 0 0 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.3rem;
    top: .5rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e9e9ec;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .1), 0 0 12px rgba(255, 255, 255, .5);
}
.timeline-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .2rem 1rem;
}
.timeline-role {
    color: #fff;
    font-weight: 650;
    font-size: 1.02rem;
    line-height: 1.4;
}
.timeline-dates {
    font-family: var(--bh-sans);
    font-size: .7rem;
    letter-spacing: .04em;
    color: #9a9a9e;
    white-space: nowrap;
}
.timeline-org {
    margin-top: .1rem;
    font-family: var(--bh-sans);
    font-size: .74rem;
    letter-spacing: .05em;
    color: #cfcfd4;
}
.timeline-desc {
    margin: .5rem 0 0;
    color: #c6c6c9;
}

/* education card */
.edu-card {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 1.2rem 1.3rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
}
.edu-school { color: #fff; font-weight: 650; font-size: 1.05rem; }
.edu-degree { margin-top: .3rem; color: #c6c6c9; line-height: 1.6; }

/* chips: education stats + technical skills */
.chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    margin-top: .95rem;
}
.chip {
    font-family: var(--bh-sans);
    font-size: .68rem;
    letter-spacing: .04em;
    color: #d0d0d3;
    padding: .32em .72em;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .03);
}
.chip.accent {
    color: #fff;
    border-color: rgba(255, 255, 255, .34);
    background: rgba(255, 255, 255, .07);
}

/* generic entry list: patents, projects, activities */
.entry-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.entry-list > li {
    padding: 1.05rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, .08);
}
.entry-list > li:first-child { padding-top: 0; }
.entry-list > li:last-child { padding-bottom: 0; border-bottom: none; }
.entry-title { color: #fff; font-weight: 600; line-height: 1.5; }
.entry-year {
    font-family: var(--bh-sans);
    font-size: .7rem;
    font-weight: 500;
    color: #9a9a9e;
    margin-left: .3rem;
}
.entry-meta {
    margin-top: .15rem;
    font-family: var(--bh-sans);
    font-size: .7rem;
    letter-spacing: .04em;
    color: #8a8a8f;
}
.entry-list > li p {
    margin: .5rem 0 0;
    color: #c6c6c9;
    line-height: 1.7;
}

/* ---------- reading list ---------- */
.reading-list { margin: 1.4rem 0 0; }
.book-list {
    list-style: none;
    margin: .9rem 0 2.4rem;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .15rem 2.2rem;
}
.book-list li {
    display: flex;
    align-items: baseline;
    gap: .65rem;
    padding: .42rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, .07);
}
.book-list input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.book-list li::before {
    content: "";
    flex: 0 0 auto;
    width: .58em;
    height: .58em;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 2px;
    transform: translateY(-.02em);
}
.book-list li:has(input:checked)::before {
    background: var(--bh-accent);
    border-color: var(--bh-accent);
}
.book-list label { color: #c6c6c9; font-size: .92rem; }
.book-list li:has(input:checked) label { color: #8a8a8f; }
@media (max-width: 680px) { .book-list { grid-template-columns: 1fr; } }
