/* SSyn Lab site styles.
   Type scale: 56 (page title), 32 (section), 21 (lead and card titles), 17 (everything else).
   Color: one accent (logo navy) plus grays. Drawings add two lighter shades of the navy. Keep it that way.
   The home page hero is the only dark, glowing part. The drawings move a little (see "Motion inside the drawings").
   Breakpoints: 900 (menu button; hero and research figures stack), 640 (phone: stacked tables). */

:root {
  --text: #1D1D1F;
  --text-2: #424245;
  --muted: #6E6E73;
  --line: #E5E5EA;
  --line-2: #D2D2D7;
  --line-3: #F0F0F2;
  --bg: #FFFFFF;
  --bg-2: #F5F5F7;
  --bg-3: #E8E8ED;
  --navy: #172C68;
  --navy-dark: #0B1640;
  /* Two lighter shades of the navy, used only as fills and lines inside drawings (.ico). */
  --blue: #5B7FDE;
  --blue-2: #DDE5FA;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Noto Sans KR", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  /* Korean wraps between words, not inside them; very long strings may still break. */
  word-break: keep-all;
  overflow-wrap: break-word;
}
:lang(ko) body, body:lang(ko) { line-height: 1.7; }
a { color: var(--navy); transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
a:hover { color: var(--navy-dark); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
sub { line-height: 0; }
[id] { scroll-margin-top: 24px; }

h1, h2, h3 { margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 32px; line-height: 1.25; font-weight: 700; }
h3 { font-size: 21px; line-height: 1.35; font-weight: 600; }
:lang(ko) h1 { line-height: 1.15; }
:lang(ko) h2 { line-height: 1.3; }
p { margin: 0; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.lead { font-size: 21px; color: var(--text-2); max-width: 860px; margin-top: 24px; text-wrap: pretty; }
.muted { color: var(--muted); }
.body-text { color: var(--text-2); }
.body-text p + p { margin-top: 16px; }
.eyebrow { color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.stack-16 > * + * { margin-top: 16px; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px; padding-top: 14px; padding-bottom: 14px;
}
.site-header .logo { display: block; line-height: 0; }
/* logo.png is cropped close to the artwork, so this height is the height of the drawing itself. */
.site-header .logo img { height: 44px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.site-nav a { color: var(--text); text-decoration: none; padding: 10px 0; }
.site-nav a:hover { color: var(--navy); }
.site-nav a[aria-current="page"], .site-nav a.join { color: var(--navy); font-weight: 600; }
/* The menu button only appears on phones, and only when the script in header.html has run. */
.nav-toggle { display: none; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-top: 48px; padding-bottom: 64px; }
.site-footer strong { color: var(--text); font-weight: 600; }
.site-footer a { text-decoration: none; }

/* Sections */
/* Only top and bottom here: these classes sit on .container, whose side padding must stay. */
.page-head { padding-top: 48px; padding-bottom: 40px; }
.hero { padding-top: 120px; padding-bottom: 104px; }
.hero h1 { max-width: 920px; }
.section { padding: 72px 0; }
.section.short { padding: 64px 0; }
.section.tight-top { padding-top: 0; }
.section.gray { background: var(--bg-2); }
.section.ruled { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section-head a { text-decoration: none; font-weight: 500; padding: 10px 0; }
/* Bottom space under the last block of a page. Set another size with style="--pb: 80px"; phones cap it at 48. */
.pb { padding-bottom: var(--pb, 72px); }
/* A new block inside a section, such as the h2s on the Join page. */
.block-top { margin-top: 72px; }

/* Home hero: the dark band with the particle animation (assets/js/hero.js).
   This is the one place with a dark background, a gradient and glow. Keep the rest of the site plain. */
.hero-dark {
  position: relative; overflow: hidden; color: #FFFFFF;
  background: #0B1640 radial-gradient(85% 120% at 75% 46%, #1B3080 0%, #0B1640 55%, #060B24 100%);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.hero-grid {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px;
  align-items: center; min-height: 680px; padding-top: 80px; padding-bottom: 72px;
}
.hero-kicker { color: rgba(255, 255, 255, 0.72); font-weight: 500; margin-bottom: 20px; }
/* Each sentence of the headline keeps to its own line where there is room. */
.hero-copy h1 { font-size: clamp(36px, 4.4vw, 52px); }
.hero-copy h1 span { display: inline-block; }
.hero-dark .lead { color: rgba(255, 255, 255, 0.84); margin-top: 24px; }
.hero-dark .btn { background: #FFFFFF; color: var(--navy); }
.hero-dark .btn:hover { background: var(--bg-3); color: var(--navy-dark); }
.hero-dark .btn-outline { border-color: rgba(255, 255, 255, 0.6); color: #FFFFFF; }
.hero-dark .btn-outline:hover { background: #FFFFFF; border-color: #FFFFFF; color: var(--navy); }
.hero-dark a:focus-visible, .hero-dark button:focus-visible { outline-color: #FFFFFF; }
.hero-art { display: flex; flex-direction: column; align-self: stretch; min-width: 0; }
.hero-stage { flex: 1 1 auto; min-height: 400px; }
.hero-steps { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 24px; }
.hero-steps button {
  position: relative; min-height: 44px; padding: 8px 0 12px; border: 0; background: none;
  font: inherit; color: rgba(255, 255, 255, 0.62); cursor: pointer; transition: color 0.15s;
}
.hero-steps button:hover, .hero-steps button[aria-current] { color: #FFFFFF; }
.hero-steps button[aria-current] { font-weight: 600; }
/* The line under each step; the current one fills as its time runs (--p goes from 0 to 1, set by hero.js). */
.hero-steps button i { position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.hero-steps button i::after { content: ""; position: absolute; inset: 0; background: #FFFFFF; transform-origin: left; transform: scaleX(var(--p, 0)); }
.hero-steps .hero-pause {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%; margin-left: 4px;
}
.hero-pause svg { fill: currentColor; }
.hero-pause .when-paused, .paused .hero-pause .when-playing { display: none; }
.paused .hero-pause .when-paused { display: inline; }
/* No JavaScript: nothing would be drawn, so give the text the whole width. */
html:not(.js) .hero-grid { grid-template-columns: 1fr; min-height: 0; }
html:not(.js) .hero-art { display: none; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.btn, .btn-outline {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 26px;
  border-radius: 999px; text-decoration: none; font-weight: 500;
}
.btn { background: var(--navy); color: #FFFFFF; }
.btn:hover { background: var(--navy-dark); color: #FFFFFF; }
.btn-outline { border: 1px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #FFFFFF; }

/* Cards and grids */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 24px; }
.grid-3.snug { gap: 20px; }
.card { background: var(--bg); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.card.outline { border: 1px solid var(--line); padding: 28px; gap: 8px; }
a.card.outline:hover { border-color: var(--line-2); }
.card.step { padding: 32px; }
.card.step h3 + p, .card.step .h3 + p { margin-top: 4px; }
.card .grow { flex-grow: 1; color: var(--text-2); }
.card a.more { text-decoration: none; font-weight: 500; padding: 10px 0; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.banner > div { flex: 999 1 520px; min-width: 0; }
.banner p { margin-top: 12px; font-size: 21px; color: var(--text-2); }

/* Publication rows */
.rows { display: flex; flex-direction: column; }
.row-link { display: flex; flex-wrap: wrap; gap: 4px 32px; padding: 20px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.rows .row-link:last-child { border-bottom: 1px solid var(--line); }
.row-link .year { width: 64px; color: var(--muted); }
.row-link .what { flex: 999 1 480px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-link .title { font-weight: 600; transition: color 0.15s; }
.row-link:hover .title { color: var(--navy); }

.split { display: flex; flex-wrap: wrap; gap: 32px 64px; margin-top: 40px; }
.split > .main { flex: 999 1 480px; min-width: 0; }
.split > .side { flex: 1 1 360px; min-width: 0; }
.key-papers h3 { margin-bottom: 8px; }
.key-papers a { display: block; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.key-papers a:last-child { border-bottom: 1px solid var(--line); }
.key-papers a:hover { color: var(--navy); }
.gray .key-papers a { border-color: var(--line-2); }

/* Publications: year bars. One bar per year, as tall as that year's number of papers (--n out of --max).
   Gray at rest; navy when pointed at, chosen, or (strip stuck to the top) when that year is being read. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.year-strip { --bar-h: 52px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; padding: 10px 0; background: var(--bg); }
/* Each link fills its whole column (the space between bars is the link's padding), so a press between two bars still lands on one. */
.year-bars { --gap: 4px; position: relative; display: grid; grid-template-columns: repeat(var(--count), minmax(0, 1fr)); flex: 1 1 320px; max-width: 768px; margin: 0 calc(var(--gap) * -1); }
.year-bars::after { content: ""; position: absolute; left: var(--gap); right: var(--gap); top: var(--bar-h); height: 1px; background: var(--line-2); pointer-events: none; }
.year-bars a { display: flex; flex-direction: column; justify-content: flex-end; height: calc(var(--bar-h) + 31px); padding: 0 var(--gap); color: var(--muted); text-decoration: none; border-radius: 4px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.year-bars a:focus-visible { outline-offset: 0; }
.year-bars .bar { display: block; height: calc(var(--bar-h) * var(--n) / var(--max)); min-height: 3px; background: var(--line-2); border-radius: 4px 4px 0 0; transform-origin: bottom; transition: background-color 0.15s, opacity 0.2s; animation: bar-grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 45ms); }
.year-bars .yr { display: block; margin-top: 4px; line-height: 27px; text-align: center; white-space: nowrap; transition: color 0.15s; }
.year-bars a:hover .bar, .year-bars a:focus-visible .bar, .year-bars a.is-on .bar, .year-bars a.is-current .bar { background: var(--navy); }
.year-bars a:hover .yr, .year-bars a:focus-visible .yr, .year-bars a.is-on .yr, .year-bars a.is-current .yr { color: var(--text); }
.year-bars.filtered a:not(.is-on):not(:hover):not(:focus-visible) .bar { opacity: 0.45; }
.year-reset { min-height: 44px; margin-bottom: 31px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--bg-2); color: var(--text); font: inherit; cursor: pointer; }
.year-reset:hover { background: var(--bg-3); }
.year-reset[hidden] { display: none; }
.year-sentinel { height: 1px; }
.pub-year[hidden] { display: none; }
#pub-readout { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes bar-grow { from { transform: scaleY(0); } }
/* Wide and tall screens: the strip stays at the top while the list scrolls under it. */
@media (min-width: 900px) and (min-height: 700px) {
  .year-strip { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
  .year-strip.stuck { border-bottom-color: var(--line); }
  .pub-year { scroll-margin-top: 132px; }
}
/* Narrow screens: no room for twelve year labels at full size, so only the first and last year are written out.
   The year in hand is named in the sentence above the bars. */
@media (max-width: 760px) {
  .year-bars { --gap: 2px; }
  #pub-readout { display: block; }
  .year-bars .yr { visibility: hidden; }
  .year-bars a:first-child .yr, .year-bars a:last-child .yr { visibility: visible; display: flex; color: var(--muted); }
  .year-bars a:last-child .yr { justify-content: flex-end; }
  .year-reset { margin-bottom: 0; }
}
.pub-year { display: flex; flex-wrap: wrap; gap: 8px 48px; border-top: 1px solid var(--text); padding-top: 24px; margin-top: 36px; }
.pub-year > h2 { flex: 0 0 120px; }
.pub-year > .items { flex: 999 1 560px; min-width: 0; }
.pub { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.pub .t { font-weight: 600; color: var(--text); text-decoration: none; }
.pub a.t:hover { color: var(--navy); }
.pub .a { margin-top: 6px; color: var(--text-2); }
.pub .a b { color: var(--text); font-weight: 600; }
.pub .j { margin-top: 2px; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; min-width: 640px; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 24px; vertical-align: top; }
thead tr { background: var(--bg-2); }
th { font-weight: 600; }
tbody tr { border-top: 1px solid var(--line); }
tbody th[scope="row"] { background: var(--bg-2); width: 180px; }
td.date { color: var(--muted); width: 190px; white-space: nowrap; }
td.kind { color: var(--text-2); width: 190px; white-space: nowrap; }
td a { text-decoration: none; color: var(--text); }
td a:hover { color: var(--navy); }
/* Teaching: a firm line where a semester starts, a faint one between its courses. */
table.terms tbody tr { border-top-color: var(--line-3); }
table.terms tbody tr.term-start { border-top-color: var(--line-2); }

/* People */
.pi { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 40px; }
/* Photos are 3:4 portraits with slightly rounded corners, shown whole so no face is cut. A thin gray line frames them,
   because most are ID photos with a white background that would otherwise fade into the page. */
.pi img { width: 184px; height: auto; aspect-ratio: 3 / 4; border-radius: 12px; object-fit: cover; object-position: center top; flex: 0 0 184px; background: var(--bg-2); border: 1px solid var(--line-2); }
.pi .about { flex: 999 1 480px; min-width: 0; }
.pi .links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; }
.pi .links a { text-decoration: none; font-weight: 500; padding: 10px 0; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px; }
.member img, .member .initials { display: block; width: 100%; max-width: 160px; height: auto; aspect-ratio: 3 / 4; border-radius: 12px; object-fit: cover; object-position: center top; background: var(--bg-3); border: 1px solid var(--line-2); }
.member .initials { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.member .info { margin-top: 16px; min-width: 0; }
.member .name { font-weight: 600; }
.member .role { color: var(--text-2); }
.group-title { margin: 48px 0 24px; }
.group-title:first-child { margin-top: 0; }
/* Lab life: each photo is a figure with an optional date and title under it (from _data/gallery.yml). */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 28px 20px; }
.gallery figure { margin: 0; min-width: 0; }
.gallery figcaption { margin-top: 12px; }
.gallery figcaption span { display: block; }
.gallery figcaption .title { font-weight: 600; }
.gallery a { display: block; line-height: 0; border-radius: var(--radius); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--bg-2); }

/* Handbook (handbook.html), the one Korean page. */
.back { display: inline-block; margin-bottom: 20px; padding: 10px 0; text-decoration: none; font-weight: 500; }
.back::before { content: "\2190"; margin-right: 8px; }
.h3 { font-size: 21px; line-height: 1.35; font-weight: 600; }
.hb-toc { margin-top: 40px; }
.hb-toc .card { text-decoration: none; color: inherit; }
.hb-toc .card:hover .h3 { color: var(--navy); }
.hb-text { max-width: 860px; margin-top: 24px; color: var(--text-2); }
.hb-text p + p { margin-top: 16px; }
.hb-text b, .hb-quote b, .hb-list b, .hb-grid2 b, .table-wrap td b { color: var(--text); font-weight: 600; }
.hb-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 20px; margin-top: 32px; }
.hb-quote { max-width: 860px; margin-top: 24px; padding-left: 20px; border-left: 3px solid var(--navy); color: var(--text-2); }
.hb-h3 { margin: 44px 0 16px; }
.hb-list { margin: 0; padding-left: 1.4em; }
.hb-list li + li { margin-top: 10px; }
td .hb-list { margin-top: 8px; }
td .hb-list li + li { margin-top: 4px; }
.gray .table-wrap { background: var(--bg); }

/* Join: the link to the handbook as a navy block, made hard to miss on purpose (the owner's request, 2026-12-05).
   The whole block is one link; the white pill only looks like a button. */
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; margin-top: 32px; padding: 32px; border-radius: var(--radius); background: var(--navy); color: #FFFFFF; text-decoration: none; }
.callout:hover { background: var(--navy-dark); color: #FFFFFF; }
.callout .text { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.callout .kicker { font-weight: 600; color: rgba(255, 255, 255, 0.84); }
.callout .title { font-size: 32px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.callout .desc { color: rgba(255, 255, 255, 0.84); }
.callout .go { display: inline-flex; align-items: center; min-height: 48px; padding: 0 26px; border-radius: 999px; background: #FFFFFF; color: var(--navy); font-weight: 600; white-space: nowrap; }
/* A Korean block on an English page (Join) gets the same roomier lines as the Korean handbook page. */
section:lang(ko) { line-height: 1.7; }

/* Join: address and map links beside an embedded Google map */
.visit { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; margin-top: 64px; }
.visit > .where { flex: 1 1 340px; min-width: 0; }
.visit > .map { flex: 1.6 1 440px; min-width: 0; }
.visit .map iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radius); background: var(--bg-2); }
.visit .links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 12px; }
.visit .links a { text-decoration: none; font-weight: 500; padding: 10px 0; }

/* Drawings (svg.ico from _includes/icon.html). The classes on the shapes are listed in that file. */
.ico {
  display: block; flex: none; width: 96px; height: 96px; overflow: visible;
  fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ico.sm { width: 48px; height: 48px; stroke-width: 1.7; }
.ico .l { fill: var(--blue-2); }
.ico .w { fill: #FFFFFF; }
.ico .a { fill: var(--blue); }
.ico .k { fill: var(--navy); stroke: none; }
.ico .b { fill: var(--blue); stroke: none; }
.ico .ns { stroke: none; }
.ico .sa { stroke: var(--blue); }
.ico .q { opacity: 0.35; }
.ico .thin { stroke-width: 1.4; }
.ico.sm .thin { stroke-width: 1.2; }
.ico .dash { stroke-dasharray: 3 6; }
.ico .blk { stroke: var(--blue); stroke-width: 5; stroke-linecap: butt; }
.ico.sm .blk { stroke-width: 4.4; }
.ico .tube-o { stroke-width: 13; stroke-linecap: butt; }
.ico .tube-i { stroke: var(--blue-2); stroke-width: 9; stroke-linecap: butt; }

/* Motion inside the drawings: slow, small loops in the spirit of the home page animation.
   Dots that travel along a line are a dashed line with dashes of length zero and round ends; with
   pathLength="100" on the path, moving the dashes by 100 is one seamless lap whatever the dot count.
   The script at the end of _layouts/default.html adds "on" to a drawing while it is on screen. */
.ico .d1, .ico .d2, .ico .d3, .ico .d5, .ico .d8 {
  stroke: var(--blue); stroke-width: 4.4; animation: ico-flow var(--t, 3s) linear var(--d, 0s) infinite;
}
.ico.sm .d1, .ico.sm .d2, .ico.sm .d3, .ico.sm .d5, .ico.sm .d8 { stroke-width: 3.4; }
.ico .d1 { stroke-dasharray: 0 100; }
.ico .d2 { stroke-dasharray: 0 50; }
.ico .d3 { stroke-dasharray: 0 33.333; }
.ico .d5 { stroke-dasharray: 0 20; }
.ico .d8 { stroke-dasharray: 0 12.5; }
.ico .m-spin { transform-box: fill-box; transform-origin: center; animation: ico-spin var(--t, 24s) linear infinite; }
.ico .m-spin.vc { transform-box: view-box; }
.ico .m-spin.rev { animation-direction: reverse; }
.ico .m-pulse { animation: ico-pulse var(--t, 3s) ease-in-out var(--d, 0s) infinite; }
.ico .m-bob { animation: ico-bob var(--t, 4s) ease-in-out var(--d, 0s) infinite alternate; }
.ico .m-slide { animation: ico-slide var(--t, 4s) linear infinite; }
.ico .m-scan { animation: ico-slide var(--t, 4s) ease-in-out infinite alternate; }
.ico .m-draw { stroke-dasharray: 100; animation: ico-draw var(--t, 5s) ease-in-out var(--d, 0s) infinite; }
.ico .m-rise { animation: ico-rise var(--t, 3s) ease-in var(--d, 0s) infinite; }
@keyframes ico-flow { to { stroke-dashoffset: -100px; } }
@keyframes ico-spin { to { transform: rotate(360deg); } }
@keyframes ico-pulse { 0%, 100% { opacity: 0.12; } 50% { opacity: 1; } }
@keyframes ico-bob { from { transform: translateY(1.5px); } to { transform: translateY(-2.5px); } }
@keyframes ico-slide { to { transform: translateX(var(--x, 32px)); } }
@keyframes ico-draw {
  0% { stroke-dashoffset: 100px; opacity: 0; }
  6% { stroke-dashoffset: 100px; opacity: 1; }
  60%, 88% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes ico-rise {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(var(--y, -20px)); opacity: 0; }
}
.js .ico:not(.on) * { animation-play-state: paused; }

/* Research figures: drawings with labels, laid out with flex and grid so they restack on small screens.
   The labels are ordinary text, so they stay 17 px at every width.
   .fx     the gray panel around one figure
   .flow   steps from left to right with an .arr between them (top to bottom up to 900 px)
   .tile   one step: a drawing, a bold name, a line of text
   .group  a step that holds a short list of .mini items (small drawing + name)
   .ov     the overview: three foundations, the engineered cell, five applications */
.fx { margin-top: 32px; padding: 40px; background: var(--bg-2); border-radius: var(--radius); }
.gray .fx { background: var(--bg); }
.flow { display: flex; align-items: stretch; }
.flow > .tile, .flow > .group { flex: 1 1 0; min-width: 0; }
.tile, .group { background: var(--bg); border-radius: 16px; }
.gray .tile, .gray .group { background: var(--bg-2); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 28px 20px; text-align: center; }
.tile .ico { margin-bottom: 12px; }
.tile b, .mini b, .app b { font-weight: 600; }
.tile b, .tile span { display: block; }
.tile span { margin-top: 4px; color: var(--text-2); text-wrap: balance; }
.group { padding: 24px 20px; }
.grp-title { font-weight: 600; text-align: center; margin-bottom: 12px; }
.minis { display: grid; gap: 10px; }
.mini { display: flex; align-items: center; gap: 14px; }
.mini .ico:not(.sm) { width: 56px; height: 56px; stroke-width: 3; }
.mini .ico:not(.sm) .thin { stroke-width: 2.1; }

/* Arrow between two steps. A blue dot runs along it (--ax, --ay: how far, across and down). */
.arr { position: relative; flex: 0 0 44px; align-self: center; height: 2px; margin: 0 12px; background: var(--muted); --ax: 32px; --ay: 0px; }
.arr::before {
  content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); animation: arr-run 2.6s ease-in-out infinite;
}
@keyframes arr-run {
  0% { transform: translate(0, 0); opacity: 0; }
  25%, 65% { opacity: 1; }
  100% { transform: translate(var(--ax), var(--ay)); opacity: 0; }
}
.arr::after {
  content: ""; position: absolute; right: -2px; top: -4px;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid var(--muted);
}
.arr.down { flex: none; width: 2px; height: 26px; margin: 0; --ax: 0px; --ay: 15px; }
.arr.down::after {
  right: auto; left: -4px; top: auto; bottom: -2px;
  border: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--muted);
}
/* The word between two flows that are used together. */
.flow-link { display: flex; align-items: center; gap: 16px; margin: 16px 0; color: var(--muted); }
.flow-link::before, .flow-link::after { content: ""; flex: 1; border-top: 2px dashed var(--line-2); }

/* Overview figure */
.ov-row { display: grid; gap: 16px; }
.ov-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-row.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ov-arrows { display: grid; justify-items: center; padding: 14px 0 16px; }
.ov-arrows.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-arrows.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* The cell: two outlines with a gray band between them, like a double membrane. */
.cell { padding: 7px; border: 2.4px solid var(--navy); border-radius: 999px; background: var(--line-2); }
.cell-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 28px 9%; border: 2.4px solid var(--navy); border-radius: 999px; background: var(--bg); }
.layer { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 16px; text-align: center; }
.layer + .layer { border-left: 1px solid var(--line-2); }
.layer b { font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.app { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.app .disc { display: grid; place-items: center; width: 116px; height: 116px; border: 2.4px solid var(--navy); border-radius: 50%; background: var(--bg); }
.app .disc .ico { width: 78px; height: 78px; stroke-width: 2.4; }
.app .disc .ico .thin { stroke-width: 1.7; }
.figcaption { margin-top: 12px; color: var(--muted); }

/* Home: a drawing at the top of each "What we do" card. */
.card > .ico { margin-bottom: 8px; }

/* News posts */
.post-head { padding-top: 48px; padding-bottom: 40px; }
.post-head h1 { font-size: 32px; line-height: 1.3; }
.post-meta { margin-top: 16px; color: var(--muted); }
.post-body { max-width: 800px; padding-bottom: 72px; color: var(--text-2); }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 16px; }
.post-body li + li { margin-top: 8px; }
.post-body strong { color: var(--text); }
.post-body img { display: block; width: 100%; margin: 24px 0; border-radius: 16px; }
.back { display: inline-block; margin-top: 8px; text-decoration: none; font-weight: 500; padding: 10px 0; }

/* Visitors whose device asks for reduced motion: only page scrolling and hover fades follow that setting.
   The drawings (icons, arrows, the home animation, the year bars) play for everyone. The owner decided this
   on 2026-12-05: on many Windows PCs the setting is off for speed, and there the site just looked broken.
   Do not add rules here that stop a drawing. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, .row-link .title { transition: none; }
}

/* Tablets and phones: the animation sits above the text. */
@media (max-width: 900px) {
  /* Menu button and drop-down list (see _includes/header.html). Without the script the links simply wrap.
     It starts at this width because the seven links no longer fit beside the logo below it. */
  .js .nav-toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
    border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); color: var(--text);
    font: inherit; font-weight: 500; cursor: pointer;
  }
  .js .nav-toggle[aria-expanded="true"] { background: var(--bg-2); }
  .js .site-nav { display: none; flex: 0 0 100%; flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav.open { display: flex; }
  .js .site-nav a { padding: 12px 0; border-top: 1px solid var(--line); }

  .hero-dark { background: #0B1640 radial-gradient(120% 60% at 50% 22%, #1B3080 0%, #0B1640 60%, #060B24 100%); }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; min-height: 0; padding-top: 16px; padding-bottom: 64px; }
  .hero-art { order: -1; }
  .hero-stage { min-height: 300px; }

  /* Figures read from top to bottom. */
  .fx { padding: 24px; }
  .flow { flex-direction: column; }
  .flow > .tile, .flow > .group { flex: none; }
  .flow > .arr { flex: none; width: 2px; height: 26px; margin: 12px 0 14px; --ax: 0px; --ay: 15px; }
  .flow > .arr::after {
    right: auto; left: -4px; top: auto; bottom: -2px;
    border: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--muted);
  }
  .tile { flex-direction: row; justify-content: flex-start; gap: 4px 20px; padding: 20px; text-align: left; flex-wrap: wrap; }
  .tile .ico { width: 76px; height: 76px; margin: 0; stroke-width: 2.4; }
  .tile .ico .thin { stroke-width: 1.7; }
  .tile > div { flex: 1 1 160px; min-width: 0; }
  .grp-title { text-align: left; }
  .ov-row.three { grid-template-columns: 1fr; }
  .ov-row.five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .ov-arrows.three, .ov-arrows.five { grid-template-columns: 1fr; }
  .ov-arrows .arr + .arr { display: none; }
  .cell, .cell-in { border-radius: 40px; }
  .cell-in { grid-template-columns: 1fr; padding: 24px 16px; }
  .layer + .layer { border-left: 0; border-top: 1px solid var(--line-2); margin-top: 20px; padding-top: 24px; }
}

@media (max-width: 640px) {
  /* Sides only: .container shares elements with .page-head, .hero and .pb, which set top and bottom. */
  .container { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 72px; padding-bottom: 64px; }
  .hero-copy h1 { font-size: 32px; }
  .site-header .logo img { height: 40px; }
  .page-head, .post-head { padding-top: 36px; }
  .section, .section.short { padding: 48px 0; }
  .section.tight-top { padding-top: 0; }
  .pb { padding-bottom: min(var(--pb, 72px), 48px); }
  .block-top { margin-top: 48px; }
  .visit { margin-top: 48px; }
  .visit > .map { flex-basis: 100%; }
  .visit .map iframe { aspect-ratio: 4 / 3; }
  .pi { padding-top: 32px; }
  .pi img { width: 136px; flex-basis: 136px; }
  /* Phones: photo on the left, text beside it. */
  .members { grid-template-columns: 1fr; gap: 20px; }
  .member { display: flex; align-items: center; gap: 16px; }
  .member img, .member .initials { width: 88px; flex: 0 0 88px; border-radius: 8px; }
  .member .info { margin-top: 0; }
  .card, .card.step { padding: 24px; }
  .callout { padding: 24px; }
  .fx { padding: 16px; }
  .app .disc { width: 104px; height: 104px; }
  .app .disc .ico { width: 70px; height: 70px; }

  /* Tables: none needs sideways scrolling on a phone. Tables with class "stack" turn each row into a block. */
  .table-wrap table { min-width: 0 !important; }
  th, td { padding: 14px 16px; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: auto !important; }
  table.stack tr { padding: 16px; }
  table.stack tbody tr:first-child { border-top: 0; }
  table.stack th, table.stack td { padding: 0; white-space: normal; }
  table.stack td + td, table.stack th + td { margin-top: 4px; }
  table.stack td:empty { display: none; }
  table.stack td.main { font-weight: 600; }
  table.stack tbody th[scope="row"] { background: none; }
}
