:root {
    --bg: #03041f;
    --bg-alt: #080b38;
    --surface: #0d1147;
    --line: rgba(120, 150, 255, 0.18);
    --blue: #1a56ec;
    --blue-light: #6b95ff;
    --amber: #f5a742;
    --text: #e9edff;
    --muted: #9ba5d6;
    --paper: #f6f7ff;
    --ink: #0a0e3a;
    --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nav-brand { font-family: "Sora", "Inter", sans-serif; letter-spacing: -0.01em; }

a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* nav */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(3, 4, 31, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.nav-brand { color: var(--blue-light); font-weight: 700; letter-spacing: 0.08em; }
.nav-brand:hover { text-decoration: none; color: var(--text); }
.nav-links { display: flex; gap: 22px; font-size: 0.9rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* hero */
.hero {
    text-align: center;
    padding: 36px 0 20px;
    background:
        radial-gradient(ellipse 60% 50% at 50% 30%, rgba(26, 86, 236, 0.28), transparent 70%),
        var(--bg);
}
.hero-mark { width: min(190px, 48vw); margin: 0 auto 6px; filter: drop-shadow(0 0 40px rgba(26, 86, 236, 0.45)); }
.hero h1 {
    margin: 10px 0 6px;
    font-size: clamp(2.7rem, 9vw, 4.8rem);
    line-height: 1;
    font-weight: 700;
    color: var(--blue);
    text-shadow: 0 0 60px rgba(26, 86, 236, 0.5);
}
.hero-full {
    margin: 0 auto 22px;
    font-family: "Sora", sans-serif;
    font-weight: 500;
    font-size: clamp(0.82rem, 2.4vw, 1.1rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue-light);
}
.hero-niki {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 20px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--muted); font-size: 0.9rem;
}
.hero-niki:hover { border-color: var(--amber); text-decoration: none; color: var(--text); }
.hero-niki img { height: 42px; width: auto; }

/* sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-title {
    margin: 0 0 40px;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    display: flex; align-items: center; gap: 14px;
}
.section-title::before {
    content: ""; width: 36px; height: 6px; border-radius: 3px; background: var(--amber);
}

/* focus */
.focus-grid > * { min-width: 0; }
.focus-grid { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 36px; align-items: center; }
.focus-text p { margin: 0; color: #cfd6ff; }
.focus-lead { font-size: 1.08rem; color: var(--text) !important; }
.pillars { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 10px; }
.pillars li {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
    padding: 12px 16px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--blue);
}
.pillars li:nth-child(2) { border-left-color: var(--amber); }
.pillar-name { font-family: "Sora", sans-serif; font-weight: 600; font-size: 0.95rem; }
.pillar-brain { color: var(--amber); font-size: 0.82rem; align-self: center; }
.pillar-desc { grid-column: 1 / -1; font-size: 0.86rem; color: var(--muted); }

.arch-card {
    margin: 0; padding: 14px; border-radius: var(--radius);
    background: radial-gradient(ellipse 80% 70% at 60% 45%, rgba(26, 86, 236, 0.16), transparent 70%), linear-gradient(180deg, rgba(13, 17, 71, 0.75), rgba(8, 11, 56, 0.75));
    border: 1px solid var(--line);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.arch { display: block; width: 100%; height: auto; overflow: visible; }
.arch foreignObject div { font-family: "Inter", Helvetica, Arial, sans-serif !important; }
.arch foreignObject span { font-size: 13px !important; }
.arch .vec text { font-family: "Inter", sans-serif; font-size: 13px; fill: #ffe2b8; font-style: italic; }
/* hover linking between pillars and diagram parts */
.pillars li { transition: background 0.2s, border-color 0.2s, transform 0.2s; cursor: default; outline: none; }
.pillars li.is-hl, .pillars li:focus-visible { background: #141a66; transform: translateX(4px); box-shadow: 0 0 24px rgba(26, 86, 236, 0.35); }
.pillars li[data-part="sgw"].is-hl, .pillars li[data-part="sgw"]:focus-visible { box-shadow: 0 0 24px rgba(245, 167, 66, 0.35); }
.arch [data-part] { transition: opacity 0.25s; cursor: default; }
.arch[data-hl] [data-part] { opacity: 0.28; }
.arch[data-hl="cols"] [data-part="cols"], .arch[data-hl="sgw"] [data-part="sgw"],
.arch[data-hl="mem"] [data-part="mem"], .arch[data-hl="das"] [data-part="das"] { opacity: 1; }
.arch[data-hl="cols"] [data-part="cols"] path { stroke: #fff !important; stroke-width: 2.6 !important; filter: drop-shadow(0 0 6px #6b95ff); }
.arch[data-hl="sgw"] [data-part="sgw"] path { stroke: #ffd08a !important; stroke-width: 2.6 !important; filter: drop-shadow(0 0 8px #f5a742); }
.arch[data-hl="mem"] [data-part="mem"] path { stroke: #a9c2ff !important; stroke-width: 2.6 !important; filter: drop-shadow(0 0 7px #6b95ff); }
.arch[data-hl="das"] [data-part="das"] path { stroke: #fff !important; stroke-width: 2.4 !important; filter: drop-shadow(0 0 6px #aebfff); }
@media (prefers-reduced-motion: no-preference) {
    .arch .flow { animation: flow 1.6s linear infinite; }
}
@keyframes flow { to { stroke-dashoffset: -20; } }

/* team */
.team-row { display: flex; justify-content: center; align-items: flex-start; gap: 36px; }
.group { display: flex; flex-direction: column; align-items: center; }
.group-logo {
    position: relative; background: #fff; border-radius: 12px; height: 96px; padding: 8px 20px; box-sizing: border-box;
    display: grid; place-items: center; margin-bottom: 16px;
}
.group-logo::after { content: ""; position: absolute; left: 50%; bottom: -16px; width: 2px; height: 16px; background: rgba(107, 149, 255, 0.4); }
.group-logo img { height: 64px; width: auto; max-width: 210px; object-fit: contain; }
.group-logo img[src*="logo_bern"] { height: 80px; }
.group-logo img[src*="logo_hu"] { height: 72px; }

.hand { display: flex; justify-content: center; align-self: stretch; padding: 22px 0 8px; border-top: 2px solid rgba(107, 149, 255, 0.4); }
.pcard {
    position: relative; flex: none; width: 142px; padding: 8px 8px 12px;
    background: var(--paper); color: var(--ink); border-radius: 12px;
    border: 1px solid #fff; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin-left: -6px;
}
.pcard:first-child { margin-left: 0; }
.hand-2 .pcard:nth-child(1) { transform: rotate(-3deg) translateY(6px); }
.hand-2 .pcard:nth-child(2) { transform: rotate(3deg) translateY(6px); }
.hand-4 .pcard:nth-child(1) { transform: rotate(-5deg) translateY(10px); }
.hand-4 .pcard:nth-child(2) { transform: rotate(-1.5deg) translateY(2px); }
.hand-4 .pcard:nth-child(3) { transform: rotate(1.5deg) translateY(2px); }
.hand-4 .pcard:nth-child(4) { transform: rotate(5deg) translateY(10px); }
.pcard:hover { transform: rotate(0) translateY(-14px) !important; z-index: 5 !important; text-decoration: none; box-shadow: 0 26px 50px rgba(3, 4, 31, 0.7), 0 0 0 2px var(--blue); }
.pcard-corner {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff;
    display: grid; place-items: center; font-family: "Sora", sans-serif; font-size: 0.8rem; font-weight: 700;
    box-shadow: 0 0 0 3px var(--paper);
}
.pcard::after {
    content: ""; position: absolute; right: 16px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); z-index: 2;
}
.pcard-photo { aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: #dfe4ff; }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.pcard-photo.placeholder {
    display: grid; place-items: center;
    background: linear-gradient(145deg, var(--blue), #0a2a8f);
    font-family: "Sora", sans-serif; font-weight: 700; font-size: 2.1rem; color: rgba(255, 255, 255, 0.9);
}
.pcard-name { margin-top: 9px; font-family: "Sora", sans-serif; font-weight: 600; font-size: 0.76rem; line-height: 1.25; }
.pcard-role { font-size: 0.7rem; color: #5a6395; }

/* news: a hand of cards, newest on top at the left */
.section-news .section-title { margin-bottom: 12px; }
.section-news { padding-top: 24px; padding-bottom: 56px; }
.news-hand { --n: 6; --w: 252px; --h: 392px; position: relative; height: calc(var(--h) + 64px); margin-top: 6px; }
@media (min-width: 1160px) { .news-hand { margin-inline: -40px; } }
.ncard {
    position: absolute; top: 40px; width: var(--w); height: var(--h);
    left: calc((100% - var(--w)) / (var(--n) - 1) * var(--i)); z-index: calc(10 - var(--i));
    display: grid; grid-template-columns: 44px 1fr; overflow: hidden; cursor: pointer; outline: none;
    border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.10);
    background: radial-gradient(ellipse 80% 50% at 100% 0%, rgba(26, 86, 236, 0.22), transparent 70%), linear-gradient(165deg, #10175a, #080b38);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 1.3deg)); transform-origin: 50% 100%;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s;
}
.ncard:hover, .ncard:focus-visible {
    z-index: 30; transform: translateY(-22px) rotate(0) scale(1.06);
    border-color: rgba(107, 149, 255, 0.6); box-shadow: 0 30px 64px rgba(0, 0, 0, 0.65), 0 0 0 2px var(--blue);
}
.ncard::after { content: ""; position: absolute; top: 16px; right: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }

/* spine: the strip covered by the neighbouring card, carries the tag */
.nspine {
    display: grid; place-items: center; background: rgba(26, 86, 236, 0.28); border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--blue-light);
}
.nspine.tag-release { background: rgba(245, 167, 66, 0.2); color: var(--amber); }
.nspine span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }

.nmain { display: flex; flex-direction: column; min-width: 0; padding: 14px 14px 14px 14px; gap: 10px; }
.nface { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding-right: 18px; }
.nface h3 { margin: 2px 0 0; font-size: 1rem; line-height: 1.3; }
.nface p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.5; }
.nthumb { position: relative; overflow: hidden; margin-top: auto; height: 150px; border-radius: 10px; background: #0a0e46; display: grid; place-items: center; flex: none; }
.nthumb img { width: 100%; height: 100%; object-fit: cover; }
.nthumb-poster img { object-position: top center; }
.nthumb-release { background: #fff; }
.nthumb-release img { object-fit: contain; }
.nthumb-aigrid img { object-position: 60% 30%; }
.nthumb-meeting img { object-position: 50% 30%; transform: scale(1.3); transform-origin: 50% 40%; }
.nthumb-talk { background: linear-gradient(160deg, #0a66c2, #06356b); }
.nthumb-embed { position: absolute; top: 0; left: 0; width: 504px; height: 628px; border: 0; background: #fff; transform-origin: 0 0; transform: scale(0.357); pointer-events: none; }
.nthumb-txt { font-family: "Sora", sans-serif; font-weight: 700; font-size: 2.6rem; color: #fff; }
.nthumb-launch { background: radial-gradient(circle at 50% 50%, rgba(46, 230, 200, 0.16), #080b38 78%); }
.nthumb-launch img { width: auto; height: 136px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(26, 86, 236, 0.6)); }
.ncard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-details { display: none; }

/* playing-card corner index (date) */
.idx { display: inline-grid; justify-items: center; padding: 4px 9px; border-radius: 8px; background: var(--blue); color: #fff; font-family: "Sora", sans-serif; line-height: 1.1; box-shadow: 0 0 0 3px rgba(26, 86, 236, 0.22); white-space: nowrap; }
.idx b { font-size: 0.72rem; letter-spacing: 0.08em; }
.idx span { font-size: 0.66rem; opacity: 0.85; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.news-tag {
    display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; background: rgba(26, 86, 236, 0.22); color: var(--blue-light);
}
.tag-release { background: rgba(245, 167, 66, 0.18); color: var(--amber); }

/* enlarged card (click) */
.nmodal {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
    background: rgba(3, 4, 31, 0.82); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.nmodal.open { opacity: 1; pointer-events: auto; }
.nmodal-card {
    position: relative; width: min(780px, 100%); max-height: 90vh; overflow: auto; padding: 30px 30px 32px;
    border-radius: 20px; border: 1px solid rgba(107, 149, 255, 0.4);
    background: radial-gradient(ellipse 70% 40% at 0% 0%, rgba(26, 86, 236, 0.24), transparent 70%), linear-gradient(165deg, #10175a, #080b38);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7);
    transform: translateY(14px) scale(0.97); transition: transform 0.25s ease;
}
.nmodal.open .nmodal-card { transform: none; }
.nmodal-close {
    position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.nmodal-close:hover { background: var(--blue); border-color: var(--blue); }
.ndetail { display: flex; flex-direction: column; gap: 12px; }
.ndetail .ncard-head { padding-right: 48px; }
.ndetail h3 { margin: 6px 0 0; font-size: 1.5rem; line-height: 1.25; }
.ndetail p { margin: 0; color: #cfd6ff; font-size: 1rem; line-height: 1.6; }

.fig1 { margin: 6px 0 0; max-width: 680px; }
.fig1 figcaption { margin-top: 12px; font-size: 0.92rem; line-height: 1.6; color: #d5dbff; }
.fig1 figcaption strong { color: #fff; }
.fig1 em { font-style: normal; }
.kw-skip { color: #fff; border-bottom: 1px dashed #d5dbff; }
.kw-keep { color: #e879f9; font-weight: 600; }
.kw-repeat { color: #4ade80; font-weight: 600; }
.poster-link { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.poster-link img { width: min(280px, 70%); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); transition: transform 0.2s; }
.poster-link:hover { text-decoration: none; color: var(--text); }
.poster-link:hover img { transform: translateY(-4px); }
.credit-fig { position: relative; margin: 0; line-height: 0; }
.credit-fig figcaption {
    position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px; line-height: 1.3;
    font-size: 0.7rem; color: rgba(255, 255, 255, 0.92); background: rgba(8, 11, 56, 0.62); backdrop-filter: blur(4px);
}
.team-photo { width: 100%; max-height: 420px; object-fit: cover; object-position: center 30%; border-radius: 12px; }
.launch-mark { width: auto; height: 110px; align-self: flex-start; filter: drop-shadow(0 0 18px rgba(26, 86, 236, 0.4)); }
.embed { width: 100%; max-width: 504px; margin: 6px auto 0; border-radius: 12px; overflow: hidden; background: #fff; }
.embed iframe { display: block; width: 100%; border: 0; }

/* publications */
.pub { padding: 26px 28px; margin-bottom: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.pub h3 { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.35; }
.pub-badge { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: 0.72rem; vertical-align: middle; }
.pub-authors { margin: 0 0 4px; color: #cfd6ff; }
.pub-venue { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }
.pub-links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
    font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer;
    padding: 7px 18px; border-radius: 999px; background: var(--blue); color: #fff; border: 1px solid var(--blue);
}
.btn:hover { background: #3a6cf0; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--blue-light); border-color: var(--line); }
.btn-ghost:hover { background: rgba(26, 86, 236, 0.15); }
.bib { position: relative; margin-top: 16px; }
.bib pre { margin: 0; padding: 16px; overflow-x: auto; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 0.8rem; color: #cfd6ff; }
.bib .btn-copy { position: absolute; top: 8px; right: 8px; padding: 3px 12px; font-size: 0.78rem; }

/* footer */
.footer { padding: 56px 0 40px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.ack { max-width: 44rem; margin: 0 auto 24px; }
.funders { display: inline-flex; flex-wrap: wrap; gap: 36px; justify-content: center; align-items: center; background: var(--paper); border-radius: 14px; padding: 20px 36px; }
.funders img { height: 100px; width: auto; }
.copy { margin-top: 28px; }

/* responsive */
@media (max-width: 1100px) {
    .team-row { flex-wrap: wrap; gap: 44px 36px; }
}

/* news on small screens: compact tappable cards, stacked, instead of the overlapping hand */
@media (max-width: 900px) {
    .news-hand { height: auto; display: flex; flex-direction: column; gap: 12px; margin-top: 0; }
    .ncard { position: relative; top: auto; left: auto; width: auto; height: auto; transform: none; grid-template-columns: 8px 1fr; }
    .ncard:hover, .ncard:focus-visible { transform: none; }
    .ncard::after { display: none; }
    .nspine span { display: none; }
    .nmain { display: grid; grid-template-columns: 1fr 92px; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; }
    .nface { padding-right: 0; }
    .nface p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .nthumb { width: 92px; height: 92px; margin-top: 0; }
    .nthumb-launch img { height: 82px; }
    .nthumb-embed { display: none; }
    .nthumb-release img { object-fit: cover; object-position: 8% center; }
}

@media (max-width: 820px) {
    .focus-grid { grid-template-columns: 1fr; }
    .arch-card { overflow-x: auto; }
    .arch { min-width: 580px; }
    .nav-links { gap: 14px; font-size: 0.82rem; }
    .section { padding: 64px 0; }

    /* team: groups stack vertically, cards as a 2-column grid under their logo */
    .team-row { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 40px; }
    .group { width: 100%; }
    .hand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-top: 22px; }
    .hand .pcard { width: auto; margin-left: 0; transform: none !important; }
    .hand .pcard:only-child { grid-column: 1 / -1; width: calc(50% - 7px); justify-self: center; }
    .pcard-photo { aspect-ratio: 1 / 1; }
    .pcard-photo img { object-position: center 0%; }
    .pcard-name { font-size: 0.86rem; }
    .pcard-role { font-size: 0.74rem; }
}
