/* ALCYON — Athens · Istanbul */
:root {
  /* Solarized light: base3 background, base02/base01 text */
  --paper: #fdf6e3;          /* base3 */
  --surface: #fffcf2;
  --ink: #073642;            /* base02 */
  --muted: #586e75;          /* base01 */
  --line: #e6dfc8;           /* between base2 and base1 */
  --brand: #dc322f;          /* red: the kingfisher */
  --athens: #1f74b5;         /* blue, darkened for text contrast */
  --athens-soft: #e4eef0;
  --istanbul: #8f6c00;       /* yellow, darkened for text contrast */
  --istanbul-soft: #f6eccb;
  --associate: #657b83;      /* base00 */
  --online: #6c7a00;         /* green */
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 6px 24px rgba(20, 20, 30, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #002b36; --surface: #073642; --ink: #eee8d5; --muted: #93a1a1; --line: #124552;
    --brand: #e5504d; --athens: #3a9be0; --athens-soft: #08394b; --istanbul: #c99a14; --istanbul-soft: #233a28;
    --associate: #93a1a1; --online: #9cb000;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --paper: #002b36; --surface: #073642; --ink: #eee8d5; --muted: #93a1a1; --line: #124552;
    --brand: #e5504d; --athens: #3a9be0; --athens-soft: #08394b; --istanbul: #c99a14; --istanbul-soft: #233a28;
    --associate: #93a1a1; --online: #9cb000;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--sans); overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin-top: 2.2em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .85em; letter-spacing: -.01em; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin: .25em 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.eyebrow {
  font: 500 .75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin-bottom: .8em; display: flex; align-items: center; gap: .5em; flex-wrap: wrap;
}
.native { font-family: var(--serif); text-transform: none; letter-spacing: 0; font-style: italic; color: var(--muted); font-weight: 400; }
.count { font: 500 .9rem var(--mono); color: var(--muted); vertical-align: middle; margin-left: .3em; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 62ch; }

/* node colours */
.dot { width: .62em; height: .62em; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.athens { background: var(--athens); }
.dot.istanbul { background: var(--istanbul); }
.dot.associate { background: var(--associate); }
.dot.online { background: var(--online); }
.node-athens { --node: var(--athens); --node-soft: var(--athens-soft); }
.node-istanbul { --node: var(--istanbul); --node-soft: var(--istanbul-soft); }
.node-associate, .node-online { --node: var(--associate); --node-soft: var(--line); }
.node-tag {
  display: inline-flex; align-items: center; gap: .4em; font: 500 .72rem/1 var(--mono);
  text-transform: uppercase; letter-spacing: .08em; padding: .4em .65em; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface);
}
.node-tag.athens { color: var(--athens); border-color: color-mix(in srgb, var(--athens) 35%, transparent); }
.node-tag.istanbul { color: var(--istanbul); border-color: color-mix(in srgb, var(--istanbul) 35%, transparent); }
.node-tag.alumni { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4em; padding: .7em 1.2em; border-radius: 99px;
  background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none; border: 1px solid var(--ink);
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.cta-row, .links { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--paper) 86%, transparent); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font: 700 1.25rem var(--serif); letter-spacing: .06em; }
.brand-nodes { font: 500 .68rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; align-items: center; gap: .35em; }
.brand-nodes .sep { opacity: .5; }
.site-nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink); text-decoration: none; padding: .45em .75em; border-radius: 99px; font-size: .94rem;
}
.site-nav a:hover { background: var(--line); }
.site-nav a[aria-current] { background: var(--ink); color: var(--paper); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }
@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 16px 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .7em .8em; }
}

/* hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 600; }
.node-link { font-weight: 600; text-decoration-color: currentColor; }
.node-link.athens { color: var(--athens); }
.node-link.istanbul { color: var(--istanbul); }
.hero-figure { width: 100%; height: auto; display: block; }
.hero-figure .lat-dot { fill: var(--muted); opacity: .35; }
.hero-figure .poly { fill: color-mix(in srgb, var(--brand) 5%, transparent); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; opacity: .55; }
.hero-figure .poly-inner { fill: none; stroke-dasharray: 3 5; opacity: .35; }
.hero-figure .arc { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.8s .3s ease forwards; }
.hero-figure .arc-shadow { fill: none; stroke: var(--brand); stroke-width: 10; opacity: .08; }
.hero-figure .pin.athens circle { fill: var(--athens); }
.hero-figure .pin.istanbul circle { fill: var(--istanbul); }
.hero-figure .halo { opacity: .2; transform-box: fill-box; transform-origin: center; animation: pulse 3s ease-in-out infinite; }
.hero-figure .pin.istanbul .halo { animation-delay: 1.5s; }
.hero-figure .lbl { font: 600 13px var(--mono); letter-spacing: .14em; fill: var(--ink); }
.hero-figure .lbl-sub { font: 400 11px var(--mono); fill: var(--muted); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero-figure .arc { animation: none; stroke-dashoffset: 0; }
  .hero-figure .halo { animation: none; }
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 1.5rem; } .hero-art { max-width: 460px; } }

/* two-node split */
.nodes-split { padding-bottom: 1rem; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.node-panel {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.4rem; box-shadow: var(--shadow); overflow: hidden;
}
.node-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--node, var(--brand)); }
.node-both::before { background: linear-gradient(90deg, var(--athens) 50%, var(--istanbul) 50%); }
.node-panel h2 { margin-top: 0; font-size: 1.45rem; }
.panel-link { font-weight: 500; color: var(--node); text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
@media (max-width: 760px) { .split-grid { grid-template-columns: 1fr; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem 1.5rem; margin: 1.5rem 0 0; }
.facts dt { font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facts dd { margin: .15em 0 0; }
.facts.compact { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 1.1rem 0 1.2rem; font-size: .93rem; }

/* sections */
.section { padding: 2rem 0 3rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-top: 2.2em; }
.section-head h2 { margin: 0 0 .6em; }
.section-head a { font-size: .93rem; font-weight: 500; }
.band { background: var(--surface); border-block: 1px solid var(--line); padding: 1rem 0 2.5rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 0; } }

.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.area { border-top: 2px solid var(--ink); padding: 1rem .2rem 0; }
.area-icon { font: 400 1.7rem/1 var(--serif); color: var(--brand); display: block; margin-bottom: .6rem; }
.area p { color: var(--muted); font-size: .95rem; }
.software-grid, .project-grid, .topic-grid, .join-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.software, .topic { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.software h3 { font-family: var(--mono); font-size: 1.05rem; }
.software p:last-child, .topic p:last-child { margin-bottom: 0; }

.cta-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  border-radius: var(--radius); padding: 2rem; color: #fff;
  background: linear-gradient(120deg, #073642 0%, #1f6fa8 50%, #a17c00 100%);
}
.cta-banner h2 { margin: 0 0 .3em; color: #fff; }
.cta-banner p { margin: 0; max-width: 60ch; opacity: .9; }
.cta-banner .btn { background: #fdf6e3; color: #073642; border-color: #fdf6e3; }

/* news */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.news time { color: var(--muted); padding-top: .15em; }
.news p { margin: .2em 0 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 520px) { .news li { grid-template-columns: 1fr; gap: .2rem; } }

/* publications */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.pub[hidden] { display: none; }
.pub p { margin: 0; }
.pub-title { font-weight: 500; }
.pub-title a { color: var(--ink); text-decoration-color: var(--line); }
.pub-title a:hover { text-decoration-color: var(--brand); }
.pub-authors, .pub-venue { color: var(--muted); font-size: .92rem; }
.pubs.compact .pub { grid-template-columns: 1fr; gap: .3rem; }
.pubs.compact .pub-type { justify-self: start; }
@media (max-width: 520px) { .pub { grid-template-columns: 1fr; gap: .3rem; } .pub-type { justify-self: start; } }
.tag {
  display: inline-block; font: 500 .68rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  padding: .4em .6em; border-radius: 6px; background: var(--line); color: var(--ink); text-decoration: none;
  align-self: start; text-align: center; margin-right: .3em;
}
.tag-journal { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.tag-conference, .tag-cs { background: var(--athens-soft); color: var(--athens); }
.tag-book, .tag-math { background: var(--istanbul-soft); color: var(--istanbul); }
.year-group { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; }
.year { font-family: var(--mono); font-weight: 500; font-size: 1.1rem; color: var(--muted); margin: 1.1rem 0 0; }
@media (max-width: 640px) { .year-group { grid-template-columns: 1fr; gap: 0; } .year { margin-top: 2rem; } }
.year-group:has(.pub:not([hidden])) { display: grid; }
.year-group:not(:has(.pub:not([hidden]))) { display: none; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.chip {
  font: 500 .88rem var(--sans); padding: .45em .95em; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.chip span { font-family: var(--mono); color: var(--muted); font-size: .8em; margin-left: .2em; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .7; }

/* page head */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; border-bottom: 1px solid var(--line); position: relative; }
.page-head[class*="node-"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--node); }
.page-body { padding: 1rem 0 4rem; }
.page-body > h2:first-child { margin-top: 1.4em; }
.prose { max-width: 70ch; }
.callout { background: var(--surface); border-left: 3px solid var(--brand); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin-top: 2rem; }

/* people */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.member-card {
  display: flex; gap: .9rem; align-items: center; padding: .9rem 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.member-card:hover { border-color: var(--node, var(--ink)); transform: translateY(-1px); }
.avatar {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font: 600 1rem var(--serif); color: var(--node, var(--muted)); background: var(--node-soft, var(--line));
  border: 1.5px solid var(--node, var(--line));
}
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }
.member-meta { display: flex; flex-direction: column; min-width: 0; }
.member-name { font-weight: 600; line-height: 1.3; }
.member-role { font-size: .88rem; color: var(--node, var(--muted)); }
.member-aff { font-size: .82rem; color: var(--muted); }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lead-card { display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.lead-card .member-card { width: 100%; padding: 1.3rem; }
.lead-card .avatar { width: 64px; height: 64px; font-size: 1.35rem; }
@media (max-width: 640px) { .lead-grid { grid-template-columns: 1fr; } }
.profile-head { display: flex; gap: 1.8rem; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin-top: .4em; }
.muted-title { color: var(--muted); font-weight: 400; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.alumni { width: 100%; border-collapse: collapse; font-size: .93rem; }
.alumni th { text-align: left; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.alumni td { padding: .65rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.alumni tr:last-child td { border-bottom: 0; }
.alumni td a:first-child { color: var(--ink); font-weight: 500; text-decoration: none; }
.alumni td a:first-child:hover { color: var(--brand); }
@media (max-width: 640px) {
  .alumni thead { display: none; }
  .alumni tr { display: block; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
  .alumni td { display: block; padding: .1rem 0; border: 0; }
  .alumni td:empty { display: none; }
}

/* projects */
.project-card {
  display: flex; flex-direction: column; gap: .35rem; padding: 1.3rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--node);
  text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: var(--muted); margin-bottom: .4rem; }
.acronym { font: 700 1.5rem var(--serif); color: var(--node); letter-spacing: .02em; }
.project-title { font-weight: 600; line-height: 1.35; }
.project-meta { font-size: .86rem; color: var(--muted); }
.status { font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: .3em .6em; border-radius: 6px; background: var(--line); }
.status-ongoing { background: color-mix(in srgb, var(--online) 18%, transparent); color: var(--online); }
.project-list, .event-list { list-style: none; padding: 0; }
.project-list li, .event-list li { padding: .7rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.event-list li { flex-direction: row; gap: .8rem; flex-wrap: wrap; align-items: baseline; }

/* node page */
.node-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2.5rem; background: linear-gradient(180deg, var(--node-soft), transparent); border-bottom: 3px solid var(--node); }
.node-hero h1 .native { font-size: .5em; }
.node-hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; align-items: start; }
.node-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.node-card .member-card { border: 0; padding: 0; background: none; }
@media (max-width: 860px) { .node-hero-grid { grid-template-columns: 1fr; } }

/* events timeline */
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; }
.tl-item { display: grid; grid-template-columns: 5rem 1fr; gap: 1.2rem; }
.tl-year { color: var(--muted); padding-top: 1.35rem; font-size: 1rem; }
.tl-body { border-left: 2px solid var(--line); padding: 1.1rem 0 1.4rem 1.5rem; position: relative; }
.tl-body::before { content: ""; position: absolute; left: -7px; top: 1.6rem; width: 12px; height: 12px; border-radius: 50%; background: var(--node, var(--online)); box-shadow: 0 0 0 4px var(--paper); }
.node-online .tl-body::before { background: var(--online); }
.tl-body h3 { margin: .6rem 0 .2rem; font-size: 1.3rem; }
@media (max-width: 520px) { .tl-item { grid-template-columns: 1fr; gap: 0; } .tl-year { padding-top: .8rem; } }

/* SCIM talks */
.talks { display: flex; flex-direction: column; gap: .5rem; }
.talk { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.talk summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; display: grid; grid-template-columns: 8rem 1fr; gap: .2rem 1rem; }
.talk summary::-webkit-details-marker { display: none; }
.talk-date { grid-row: span 2; color: var(--muted); padding-top: .2em; }
.talk-title { font-weight: 600; }
.talk-speaker { font-size: .92rem; }
.talk[open] summary { border-bottom: 1px solid var(--line); }
.talk-abstract { padding: 1rem 1.2rem .3rem; font-size: .95rem; color: var(--muted); }
@media (max-width: 560px) { .talk summary { grid-template-columns: 1fr; } .talk-date { grid-row: auto; } }

/* topics */
.topic[hidden] { display: none; }
.topic-tags { margin-bottom: .6rem; }
.join-grid { margin-top: 1rem; }
.join-grid .node-panel h3 { margin-top: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 3rem 0 1.5rem; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2rem; }
.footer-logo { width: 48px; height: auto; }
.footer-title { font: 700 1.1rem var(--serif); margin: .4rem 0 .2rem; }
.footer-node .eyebrow { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* small fixes */
.hero-figure .lbl, .hero-figure .lbl-sub { paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; }
.facts dd.mono, .footer-node .mono { white-space: nowrap; }

/* students */
.level-jump { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1.5rem 0 2rem; }
.level-card {
  display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--node); text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.level-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.level-card .eyebrow { margin: 0 0 .3rem; }
.level-title { font: 600 1.15rem/1.25 var(--serif); }
.level-count { color: var(--muted); }
.node-both { --node: linear-gradient(90deg, var(--athens), var(--istanbul)); }
.level-card.node-both, .level-section.node-both .level-head { border-image: linear-gradient(90deg, var(--athens) 50%, var(--istanbul) 50%) 1; }
.level-card.node-both { border-width: 3px 0 0; border-style: solid; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 900px) { .level-jump { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .level-jump { grid-template-columns: 1fr; } }
.sticky-filters { position: sticky; top: 69px; z-index: 2; padding: .6rem 0; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); }
.chip .dot { margin-right: .15em; }
.level-section { scroll-margin-top: 140px; padding-top: .5rem; }
.level-head { display: grid; grid-template-columns: minmax(220px, 1fr) 1.6fr; gap: .5rem 2rem; align-items: end; border-bottom: 3px solid var(--node, var(--line)); padding-bottom: .9rem; margin: 2.5rem 0 1.2rem; }
.level-head h2 { margin: 0; }
.level-head .eyebrow { margin-bottom: .4rem; }
.level-head > p { margin: 0; font-size: .95rem; }
@media (max-width: 720px) { .level-head { grid-template-columns: 1fr; } }
.topic { border-left: 3px solid var(--node, var(--line)); display: flex; flex-direction: column; }
.topic.node-both { border-left: 3px solid; border-image: linear-gradient(180deg, var(--athens) 50%, var(--istanbul) 50%) 1; border-radius: 0 var(--radius) var(--radius) 0; }
.topic-tags { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.topic-tags .tag { margin: 0; }
.topic h3 { margin-top: .2rem; }
.topic p { font-size: .95rem; }
.topic-sup { margin-top: auto; padding-top: .4rem; }
.empty-state { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1.3rem; color: var(--muted); margin: 0; }
.empty-state[hidden] { display: none; }
[data-active]:not([data-active="all"]) .level-section:not(:has(.topic:not([hidden]), .empty-state:not([hidden]))) { display: none; }
.level-section.node-both .level-head { border-bottom: 0; border-image: none; background: linear-gradient(90deg, var(--athens) 50%, var(--istanbul) 50%) bottom / 100% 3px no-repeat; padding-bottom: calc(.9rem + 3px); }
.profile-facts { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; padding: 1rem 1.2rem; margin: 2rem 0 1.5rem; }
.alumni td a { color: var(--ink); }

/* topic cards & pages */
.topic h3 a { color: var(--ink); text-decoration: none; }
.topic h3 a:hover { color: var(--brand); }
.topic-sup { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.topic-sup .more { font-weight: 500; white-space: nowrap; margin-left: auto; }
.tag-diff { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.diff-difficult { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.diff-easy, .diff-introductory { color: var(--online); border-color: color-mix(in srgb, var(--online) 40%, transparent); }
.ongoing { list-style: none; padding: 0; margin: 0; }
.ongoing li { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.ongoing a { font-weight: 600; }
.topic-body { padding-top: 2rem; }
.topic-body h2 { font-size: 1.4rem; margin-top: 1.8em; }
.topic-body table { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 1rem 0 1.5rem; display: block; overflow-x: auto; }
.topic-body th, .topic-body td { text-align: left; padding: .5rem .8rem; border-bottom: 1px solid var(--line); }
.topic-body th { font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.topic-body ol li, .topic-body ul li { margin: .35em 0; }
.topic-body code { font-family: var(--mono); font-size: .88em; background: var(--line); padding: .1em .35em; border-radius: 4px; }
.topic-body mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; }
.back { margin-top: 2.5rem; }

/* software */
.soft-index { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.2rem 0; }
.soft-index a { font-size: .88rem; padding: .35em .8em; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); text-decoration: none; background: var(--surface); }
.soft-index a:hover { border-color: var(--ink); }
.soft-group { scroll-margin-top: 90px; }
.soft-head { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: .5rem 2rem; align-items: start; margin: 2.8rem 0 1.1rem; padding-top: 1.2rem; border-top: 2px solid var(--ink); }
.soft-head h2 { margin: 0; font-size: 1.5rem; }
.soft-head p { margin: 0; font-size: .95rem; }
@media (max-width: 720px) { .soft-head { grid-template-columns: 1fr; } }
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; }
.repo-card {
  display: flex; flex-direction: column; gap: .45rem; padding: 1.1rem 1.2rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.repo-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.repo-name { display: flex; align-items: center; gap: .45rem; font-family: var(--mono); font-size: .92rem; word-break: break-word; }
.repo-name svg { color: var(--muted); flex: none; }
.repo-lab .repo-name svg { color: var(--brand); }
.repo-owner { color: var(--muted); }
.repo-note { font-size: .86rem; font-weight: 500; color: var(--brand); }
.repo-desc { font-size: .9rem; color: var(--muted); }
.repo-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: auto; padding-top: .3rem; color: var(--muted); font-size: .76rem; }
.repo-meta > span { display: inline-flex; align-items: center; gap: .35em; }
.lang-dot { width: .7em; height: .7em; border-radius: 50%; background: var(--muted); display: inline-block; }
.lang-julia { background: #9558b2; } .lang-python { background: #3572a5; } .lang-maple { background: #c0392b; }
.lang-tex { background: #3d6117; } .lang-javascript { background: #e0c341; }

/* students board: two node columns, one row per level */
.row-jump { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.2rem 0 1.5rem; }
.row-jump a { font-size: .88rem; padding: .35em .85em; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); text-decoration: none; background: var(--surface); }
.row-jump a:hover { border-color: var(--ink); }
.board-heads, .board-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.board-heads { position: sticky; top: 68px; z-index: 2; padding: .6rem 0; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); }
.board-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding: .75rem 1rem; border-radius: 10px; background: var(--node-soft); border-bottom: 3px solid var(--node); }
.board-head strong { font: 600 1.15rem var(--serif); }
.board-count { margin-left: auto; color: var(--node); }
.board-row { scroll-margin-top: 140px; }
.row-title { display: flex; align-items: center; gap: 1rem; margin: 2.6rem 0 1rem; font-size: 1.6rem; }
.row-title::after { content: ""; flex: 1; height: 2px; background: var(--ink); opacity: .85; }
.board-cell { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.cell-head { padding: 0 .2rem .6rem; border-bottom: 2px solid var(--node); }
.cell-head h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.cell-head .eyebrow { margin-bottom: .35rem; }
.cell-head p:last-child { margin: 0; }
.cell-topics { display: flex; flex-direction: column; gap: .7rem; }
.cell-topics .topic { padding: 1rem 1.1rem; }
.cell-topics .topic h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.cell-topics .topic p { font-size: .9rem; margin-bottom: .6rem; }
.cell-topics .topic p:last-child { margin-bottom: 0; }
.node-tag.both { color: var(--ink); }
.board-cell .ongoing li { padding: .6rem 0; }
@media (max-width: 820px) {
  .board-heads { display: none; }
  .board-cols { grid-template-columns: 1fr; gap: 2rem; }
}
.tag-preprint { background: color-mix(in srgb, var(--online) 15%, transparent); color: var(--online); }
.repo-name { align-items: flex-start; } .repo-name svg { margin-top: .2em; } .repo-path { min-width: 0; overflow-wrap: anywhere; }

/* theme switch */
.theme-toggle {
  order: 3; display: grid; place-items: center; width: 38px; height: 38px; flex: none; margin-left: .3rem;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
.site-nav { order: 2; margin-left: auto; }
.nav-toggle { order: 4; }
.icon-moon { display: block; } .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}
@media (max-width: 1100px) { .theme-toggle { margin-left: auto; } }

/* people: two node columns */
.people-heads { margin-top: 1.5rem; }
.people-cols { margin-top: 1rem; align-items: start; }
.people-cols .lead-card { padding-bottom: 1rem; border-bottom: 2px solid var(--node); margin-bottom: .4rem; }
.people-cols .lead-card .member-card { padding: 1.2rem; }
.role-group { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; }
.role-group .eyebrow { margin: 0; }
.cell-members { display: flex; flex-direction: column; gap: .5rem; }
.mobile-only { display: none; }
@media (max-width: 820px) { .mobile-only { display: flex; } .people-cols .board-cell + .board-cell { margin-top: 1.5rem; } }

/* random node order: the head script sets data-first on <html> */
html[data-first="istanbul"] .node-order > .node-istanbul { order: -1; }
html[data-first="istanbul"] .brand-nodes .sep { order: -1; }
html[data-first="istanbul"] .brand-nodes .node-istanbul { order: -2; }
.brand-nodes > span { display: inline-flex; align-items: center; gap: .35em; }
.footer-grid.node-order > :first-child { order: -3; }
.footer-grid.node-order > :last-child { order: 3; }

/* logo: light and dark artwork */
.brand img.logo { width: 46px; height: auto; }
.footer-logo { width: 64px; height: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
.area-icon { font: italic 400 1.05rem/1.3 var(--serif); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intro p { font-size: 1.1rem; }
.archive-section { scroll-margin-top: 90px; }
