/* ============================================================
   Radu Calinescu — personal homepage
   Clean-academic single-page style. No dependencies, no build.
   ============================================================ */

:root {
    --ink:       #17202a;   /* primary text            */
    --muted:     #5a6675;   /* secondary text          */
    --faint:     #8a94a3;   /* tertiary / captions     */
    --accent:    #0b3d66;   /* deep York-ish blue      */
    --accent-2:  #1d6fb8;   /* lighter blue for links  */
    --bg:        #ffffff;
    --surface:   #f5f7fa;   /* cards / panels          */
    --surface-2: #eef2f7;
    --border:    #e2e8f0;
    --accent-soft: #e8f0f8;

    --maxw: 1080px;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(23,32,42,.04), 0 8px 24px rgba(23,32,42,.06);
    --shadow-hover: 0 2px 4px rgba(23,32,42,.06), 0 14px 34px rgba(23,32,42,.10);

    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

a {
    color: var(--accent-2);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; color: var(--ink); }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* section rhythm */
section { padding: 44px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }
:target { scroll-margin-top: 84px; }

.kicker {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .74rem;
    font-weight: 700;
    color: var(--accent-2);
    margin: 0 0 8px;
}
.section-title { font-size: 1.9rem; margin: 0 0 8px; }
.section-intro { color: var(--muted); max-width: 62ch; margin: 0 0 20px; }
.section-intro.wide { max-width: none; }

/* ---------- header / nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}
.nav-brand {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
    display: flex;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.nav-links a {
    color: var(--muted);
    font-size: .95rem;
    font-weight: 500;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 44px 0 36px; border-top: none; }
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 36px;
    align-items: center;
}
.hero h1 { font-size: 2.9rem; margin: 0 0 6px; letter-spacing: -.01em; }
.hero .role { font-size: 1.18rem; color: var(--accent); font-weight: 600; margin: 0 0 4px; }
.hero .affil { color: var(--muted); margin: 0 0 12px; }
.hero .lede { font-size: 1.08rem; color: var(--ink); max-width: 58ch; margin: 0 0 12px; }

.hero-photo {
    width: 200px; height: 200px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;   /* portrait crop biased upward so the top of the head isn't cut */
    box-shadow: var(--shadow);
    border: 4px solid #fff;
}

/* profile / external links */
.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.profile-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
    transition: border-color .15s, background .15s, transform .15s;
}
.profile-links a:hover {
    text-decoration: none;
    border-color: var(--accent-2);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

/* ---------- research strands ---------- */
.strand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.strand {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 20px;
    box-shadow: var(--shadow);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.strand:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #cfd8e3; }
.strand .num {
    font-family: var(--serif);
    font-size: 1.1rem;
    color: #fff;
    background: var(--accent);
    width: 34px; height: 34px;
    border-radius: 9px;
    display: grid; place-items: center;
    margin-bottom: 14px;
}
.strand h3 { font-size: 1.16rem; margin: 0 0 10px; }
.strand p { color: var(--muted); font-size: .96rem; margin: 0 0 14px; }

.keypubs {
    list-style: none;
    margin: 14px 0 0;
    padding: 14px 0 0;
    border-top: 1px dashed var(--border);
}
.keypubs .label {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--faint); font-weight: 700; margin-bottom: 8px;
}
.keypubs li { font-size: .82rem; color: var(--ink); margin-bottom: 8px; line-height: 1.45; }
.keypubs li:last-child { margin-bottom: 0; }
.keypubs .venue { color: var(--muted); font-style: italic; }
.keypubs a { font-weight: 600; }

/* "show more" link that opens the overflow publications in a modal dialog */
.morelink {
    margin-top: 14px;
    display: inline-block;
    background: none; border: none; padding: 0;
    font-family: var(--sans);
    font-size: .82rem; font-weight: 700;
    color: var(--accent-2); cursor: pointer;
}
.morelink::before { content: "\002B\00a0"; }   /* + */
.morelink:hover { text-decoration: underline; }

.pub-dialog {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 660px;
    width: calc(100% - 40px);
    max-height: 80vh;
    overflow: auto;
    color: var(--ink);
    box-shadow: var(--shadow-hover);
}
.pub-dialog::backdrop { background: rgba(23,32,42,.5); }
.pub-dialog-head {
    position: sticky; top: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 24px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.pub-dialog-head h4 { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.pub-dialog-close {
    background: none; border: none;
    font-size: 1.7rem; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 0 4px;
}
.pub-dialog-close:hover { color: var(--ink); }
.dialog-pubs { list-style: none; margin: 0; padding: 20px 24px; }
.dialog-pubs li { font-size: .9rem; color: var(--ink); margin-bottom: 13px; line-height: 1.5; }
.dialog-pubs li:last-child { margin-bottom: 0; }
.dialog-pubs .venue { color: var(--muted); font-style: italic; }
.dialog-pubs a { font-weight: 600; }

/* featured applications strand (full width, media) */
.strand--feature {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, #fff, var(--surface));
    padding: 24px 24px;
    margin-top: 18px;
}
.strand--feature .num { background: var(--accent-2); }
.strand--feature h3 { font-size: 1.16rem; }
.strand--feature > p { max-width: none; font-size: 1.02rem; }

.media-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 16px;
}
.media-tile {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    aspect-ratio: 4 / 3;
    box-shadow: var(--shadow);
}
.media-tile img,
.media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-tile figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 10px 12px;
    font-size: .82rem; color: #fff;
    background: linear-gradient(0deg, rgba(0,0,0,.66), rgba(0,0,0,0));
}
/* placeholder tile appearance */
.media-tile.placeholder {
    display: grid; place-items: center;
    color: var(--faint); font-size: .85rem; text-align: center;
    border-style: dashed;
    aspect-ratio: 4 / 3;
    padding: 12px;
}

/* project cards: media (embedded video or photo) with text beneath */
.project-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: box-shadow .18s, transform .18s;
}
.project-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.project-media { position: relative; aspect-ratio: 16 / 9; background: #0f2a44; }
.project-media iframe,
.project-media img,
.project-media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.project-media img,
.project-media video { object-fit: cover; }
.project-media.contain img,
.project-media.contain video { object-fit: contain; }
.project-media.triptych { display: flex; gap: 3px; }
.project-media.triptych img { position: static; width: calc(33.333% - 2px); height: 100%; object-fit: cover; }
.project-media.facade { cursor: pointer; }
.project-media .play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 58px; height: 58px; border-radius: 50%;
    background: rgba(11,61,102,.82); border: 2px solid rgba(255,255,255,.92);
    display: grid; place-items: center;
    transition: background .2s, transform .2s;
    pointer-events: none;
}
.project-media.facade:hover .play { background: rgba(29,111,184,.95); transform: translate(-50%, -50%) scale(1.08); }
.project-media .play::after {
    content: ""; width: 0; height: 0;
    border-style: solid; border-width: 10px 0 10px 17px;
    border-color: transparent transparent transparent #fff; margin-left: 3px;
}
.project-body { padding: 14px 16px 16px; }
.project-body .domain {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--accent-2); font-weight: 700; margin: 0 0 4px;
}
.project-body h5 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.12rem; }
.project-body p { margin: 0 0 10px; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.project-body .more { font-size: .8rem; font-weight: 700; }
.project-body .more:hover { text-decoration: underline; }

/* ---------- professional activities ---------- */
.activities {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.activity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.activity-card h3 { font-size: 1.1rem; margin: 0 0 10px; }
.activity-card ul { margin: 0; padding-left: 0; list-style: none; }
.activity-card li { position: relative; padding-left: 20px; margin-bottom: 8px; font-size: .96rem; }
.activity-card li:last-child { margin-bottom: 0; }
.activity-card li::before {
    content: ""; position: absolute; left: 2px; top: 10px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2);
}
.year { color: var(--faint); font-variant-numeric: tabular-nums; }

/* highlight banner (NHS AI Champion) */
.highlight {
    grid-column: 1 / -1;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    padding: 26px 30px;
    display: flex;
    gap: 22px;
    align-items: center;
}
.highlight .badge {
    flex: 0 0 auto;
    font-family: var(--serif);
    font-weight: 700;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.3);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: .9rem;
    text-align: center;
}
.highlight h3 { color: #fff; margin: 0 0 6px; font-size: 1.15rem; }
.highlight p { margin: 0; color: rgba(255,255,255,.9); font-size: .96rem; }
.highlight a { color: #fff; text-decoration: underline; }

/* ---------- grants ---------- */
.grants { list-style: none; margin: 0; padding: 0; }
.grants li {
    position: relative;
    padding: 5px 0 5px 20px;          /* compact rows, no rules between entries */
    font-size: .95rem;
    line-height: 1.5;
}
.grants li::before {                  /* small accent marker instead of a bullet */
    content: "";
    position: absolute;
    left: 3px;
    top: .68em;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--accent-2);
    opacity: .4;
    transition: opacity .15s ease;
}
.grants li:hover::before { opacity: 1; }
.grants a { color: var(--ink); }
.grants a:hover { color: var(--accent-2); }
.grants .acr {                        /* acronym: bold, accent-coloured, never wraps */
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}
.grants .acr::after { content: ":\00a0"; }
.grants a:hover .acr { color: var(--accent-2); }
.grants .also { color: var(--muted); font-size: .9rem; }
.grants .funder { color: var(--faint); font-size: .88rem; }
.role-tag {
    display: inline-block; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--accent); background: var(--accent-soft);
    padding: 2px 8px; border-radius: 6px; margin-left: 8px; vertical-align: middle;
}

/* ---------- team ---------- */
.team-group h3 { font-size: 1.12rem; margin: 0 0 14px; }
.people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px 24px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}
.people li { padding: 6px 0; font-size: .96rem; border-bottom: 1px solid var(--border); }
.people .sub { color: var(--faint); font-size: .84rem; display: block; }

details.alumni {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0 22px;
}
details.alumni > summary {
    cursor: pointer;
    padding: 18px 0;
    font-weight: 600;
    font-family: var(--serif);
    font-size: 1.08rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
details.alumni > summary::-webkit-details-marker { display: none; }
details.alumni > summary::after {
    content: "＋"; color: var(--accent-2); font-weight: 400; font-size: 1.3rem;
}
details.alumni[open] > summary::after { content: "－"; }
details.alumni[open] > summary { border-bottom: 1px solid var(--border); }
.alumni-body { padding: 18px 0 22px; }
.alumni-body .people { margin-bottom: 0; }

/* ---------- PhD call to action ---------- */
.cta {
    background: linear-gradient(135deg, var(--accent), #114a7a);
    color: #fff;
    border-radius: var(--radius);
    padding: 30px 30px;
    text-align: center;
}
.cta h2 { color: #fff; font-size: 1.7rem; margin: 0 0 12px; }
.cta p { color: rgba(255,255,255,.92); max-width: 58ch; margin: 0 auto 24px; }
.btn {
    display: inline-block;
    background: #fff;
    color: var(--accent);
    font-weight: 700;
    padding: 12px 26px;
    border-radius: 999px;
    transition: transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.22); }

/* ---------- contact / footer ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}
.contact address { font-style: normal; color: var(--muted); line-height: 1.9; }
.contact strong { color: var(--ink); }

.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    color: var(--faint);
    font-size: .86rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* editorial note for the site owner — hidden visual flag */
.todo {
    background: #fff8e1;
    border: 1px dashed #e0b000;
    color: #7a5c00;
    font-size: .8rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--sans);
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; text-align: left; }
    .hero-photo { width: 180px; height: 180px; order: -1; margin-bottom: 8px; }
    .strand-grid { grid-template-columns: 1fr 1fr; }
    .activities { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    body { font-size: 16px; }
    .nav-links { display: none; }          /* keep header to brand only on small screens */
    .hero h1 { font-size: 2.2rem; }
    .strand-grid { grid-template-columns: 1fr; }
    .media-gallery { grid-template-columns: 1fr; }
    .highlight { flex-direction: column; align-items: flex-start; }
    .grants .funder { display: block; }    /* funder on its own line on narrow screens */
    section { padding: 34px 0; }
}
