/* ElectroSim / UVic Electron Microscopy Research Group
   Style direction: sciemo.ai (framed nav, mono labels, grey panels with a dark
   top edge, square corners, circle-and-dashed-line diagrams) combined with the
   type scale and restraint of catalystbehavioral.com (large, tight, medium-weight
   grotesk headings; small calm body text; generous white space).
   Catalyst uses the commercial NB Akademie; a neutral grotesk stack stands in. */

:root {
  --bg: #fcfcfc;
  --panel: #e4e5e3;
  --panel-2: #efefed;
  --text: #262626;
  --muted: #5c5f5a;
  --faint: #60655d;              /* 4.7:1 on --panel (WCAG AA) */
  --line: #c8c8c8;
  --accent: #ef5b3b;
  --accent-ink: #1b0b06;
  --dark: #262626;
  --dark-ink: #fcfcfc;
  --logo: #002e5d;               /* exact colour of the group's logo */
  --grotesk: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
  --maxw: 1320px;
  color-scheme: light dark;
}
/* Theme: follows the system unless the visitor picks one (html[data-theme]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616;
    --panel: #232422;
    --panel-2: #1d1e1c;
    --text: #ededeb;
    --muted: #b4b7b1;
    --faint: #9a9e96;
    --line: #3a3b39;
    --accent: #ff7556;
    --accent-ink: #1b0b06;
    --dark: #ededeb;
    --dark-ink: #161616;
    --logo: #dfe7f1;
  }
}
:root[data-theme="dark"] {
    --bg: #161616;
    --panel: #232422;
    --panel-2: #1d1e1c;
    --text: #ededeb;
    --muted: #b4b7b1;
    --faint: #9a9e96;
    --line: #3a3b39;
    --accent: #ff7556;
    --accent-ink: #1b0b06;
    --dark: #ededeb;
    --dark-ink: #161616;
    --logo: #dfe7f1;
  }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--grotesk); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
main:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--dark); color: var(--dark-ink); font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.label { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0; }
.label .plus { color: var(--accent); margin-right: 6px; }

/* framed navigation (sciemo) */
.nav-frame { position: sticky; top: 0; z-index: 10; padding: 14px 0 0; background: var(--bg); }
.nav-box { display: flex; align-items: center; gap: 28px; min-height: 54px; padding: 0 6px 0 16px; border: 1px solid var(--text); background: var(--bg); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font-family: var(--grotesk); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; color: var(--text); white-space: nowrap; }
.wordmark .wm-desc { color: var(--faint); font-weight: 400; margin-left: -2px; font-size: 14px; letter-spacing: 0; }
/* group logo, used as a stencil so it keeps its exact shapes and takes --logo as colour */
.brand-mark { flex: none; display: inline-block; width: 36px; height: 36px; background-color: var(--logo); -webkit-mask: url("emgroup-logo.png") center / contain no-repeat; mask: url("emgroup-logo.png") center / contain no-repeat; }
.footer .brand-mark { width: 52px; height: 52px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 24px; margin-left: auto; padding: 6px 0; } /* wraps instead of clipping with enlarged text spacing (WCAG 1.4.12) */
.nav-links a { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: var(--text); }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* buttons: square, mono, uppercase */
.btn { display: inline-flex; align-items: center; height: 42px; padding: 0 16px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; border: 1px solid var(--text); transition: background-color .15s ease, color .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-dark { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.btn-dark:hover { background: color-mix(in srgb, var(--dark) 85%, var(--bg)); }
.btn-line { background: transparent; color: var(--text); }
.btn-line:hover { background: var(--panel); }
.nav-links .btn { height: 40px; }
.nav-links .btn-accent { color: var(--accent-ink); }
.nav-links .btn:hover { text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* type scale (catalyst) */
h1, h2, h3 { font-family: var(--grotesk); font-weight: 400; margin: 0; color: var(--text); }
h1 { font-size: clamp(42px, 4.9vw, 72px); line-height: 1.03; letter-spacing: -0.025em; }
h2 { font-size: clamp(34px, 4.2vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
.lede { font-size: 17px; color: var(--muted); max-width: 46ch; }

section { padding: 120px 0; }

/* hero: text left, hologram -> phase circles right */
.hero { padding: 96px 0 104px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; }
.hero h1 { max-width: 14ch; margin-bottom: 26px; }
.hero .label { margin-bottom: 28px; }
.hero .lede { margin-bottom: 30px; }

.pair { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; margin-left: auto; }
.pair svg.link { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pair .node { position: absolute; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; border: 1px solid var(--text); background: #fff; }
.pair .node img { width: 100%; height: 100%; object-fit: cover; }
.pair .n1 { width: 54%; left: 0; top: 0; }
.pair .n1 img { transform: scale(1.08); }
.pair .n2 { width: 44%; right: 0; bottom: 4%; }
.pair .n2 img { transform: scale(1.08); }
.pair .tag { position: absolute; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--bg); padding: 2px 6px; }
.pair .t1 { left: 4%; top: 57%; }
.pair .t2 { right: 2%; bottom: 0; transform: translateY(130%); }
.pair .dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.hero-fig { margin: 0; }
.hero-caption { margin-top: 44px; font-size: 13.5px; color: var(--faint); max-width: 52ch; margin-left: auto; }
.hero-caption a { color: var(--muted); text-underline-offset: 3px; }
.hero-caption a:hover { color: var(--text); }

/* objectives: grey panels with dark top edge, asymmetric (sciemo cards) */
.obj-head { margin-bottom: 48px; }
.obj-head h2 { max-width: 16ch; margin-top: 16px; }
.obj-grid { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.panel { background: var(--panel); border-top: 6px solid var(--dark); padding: 26px 26px 30px; }
.panel h3 { margin: 18px 0 10px; }
.panel p { color: var(--muted); font-size: 15.5px; }
.panel.feature { grid-row: span 2; display: flex; flex-direction: column; }
.panel.feature figure { margin: 26px 0 0; max-width: 380px; }
.panel.feature figure img { width: 100%; border: 1px solid var(--line); background: #fff; }
.panel.feature figcaption { margin-top: 10px; font-size: 13px; color: var(--faint); }

/* instruments: two columns of plain spec lists, no cards */
.inst-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; margin-top: 56px; }
.inst h3 { font-size: 30px; letter-spacing: -0.02em; margin: 12px 0 18px; }
.inst ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.inst li { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; padding: 12px 0; font-size: 15.5px; color: var(--muted); }
.inst li + li { border-top: 1px solid var(--line); }
.inst li b { font-family: var(--mono); font-weight: 400; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text); padding-top: 2px; }

/* HF3300V 3D model: full-width stage under the instrument lists, loaded on click */
.model3d { margin: 72px 0 0; }
.model3d .label { margin-left: -1px; }
.model3d-stage { position: relative; margin-top: 18px; height: clamp(560px, 72vh, 820px); background: #04060f; border-top: 6px solid var(--dark); overflow: hidden; }
.model3d-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.model3d-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 12px; padding: 32px; background: linear-gradient(180deg, rgba(4,6,15,0) 55%, rgba(4,6,15,.7)); }
.model3d-start .btn-dark { background: #fcfcfc; color: #262626; }
.model3d-note { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #d6dbe8; }
.model3d-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.model3d figcaption { margin-top: 14px; font-size: 13.5px; color: var(--faint); max-width: 80ch; }
.model3d figcaption a { color: var(--muted); text-underline-offset: 3px; }
.model3d figcaption a:hover { color: var(--text); }

/* platform: node-and-dashed-line pipeline (sciemo motif, real architecture) */
.platform { background: var(--panel-2); }
.platform h2 { max-width: 15ch; margin: 16px 0 20px; }
.pipeline { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 64px 0 0; padding: 0; list-style: none; }
.pipeline::before { content: ""; position: absolute; left: 7px; right: calc((100% - 64px) / 3 - 7px); top: 7px; border-top: 1.5px dashed var(--faint); }
.stage { position: relative; padding-top: 34px; }
.stage .dot { position: absolute; top: 0; left: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); }
.stage.planned .dot { background: var(--panel-2); border: 1.5px solid var(--accent); }
.stage h3 { margin: 0 0 8px; }
.stage p { color: var(--muted); font-size: 15px; }
.stage .label { margin-top: 14px; }

/* people: catalyst-style plain list */
#people h2 { margin: 16px 0 56px; }
/* principal investigator: larger, first */
.pi { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; padding: 28px 0 0; border-top: 1px solid var(--text); max-width: 980px; }
.pi img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--panel); filter: grayscale(1) contrast(1.04); transition: filter .5s ease; }
.pi:hover img { filter: none; }
.pi h3 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.02em; line-height: 1.1; margin: 16px 0 18px; }
.pi-roles { list-style: none; margin: 0 0 18px; padding: 0; font-size: 16px; color: var(--text); }
.pi-roles li { padding: 2px 0; }
.pi-bio { color: var(--muted); font-size: 15.5px; max-width: 58ch; }
.pi-contact { margin-top: 14px; font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.pi-contact a { color: var(--text); text-underline-offset: 4px; }
#people h3.sub { font-family: var(--mono); font-weight: 400; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 72px 0 18px; }
.past-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }
.names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; border-top: 1px solid var(--text); }
.names.one { grid-template-columns: 1fr; }
.names li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.names li b { font-weight: 400; }
.names li span { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); text-align: right; padding-top: 3px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 32px; row-gap: 40px; }
.people li { padding: 16px 0 0; border-top: 1px solid var(--line); }
/* portraits: one grey treatment so three different photos read as a set; colour on hover */
.people li img { display: block; width: 100%; max-width: 200px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 16px; background: var(--panel); filter: grayscale(1) contrast(1.04); transition: filter .5s ease; }
.people li:hover img { filter: none; }
.people li b { display: block; font-weight: 500; font-size: 20px; letter-spacing: -0.01em; }
.people li span { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }

/* access: big closing statement */
.access { border-top: 1px solid var(--line); }
.access h2 { max-width: 14ch; margin-bottom: 26px; }
.access .lede { margin-bottom: 30px; }
.access .note { margin-top: 22px; font-size: 13.5px; color: var(--faint); max-width: 60ch; }

/* footer */
.footer { border-top: 1px solid var(--text); padding: 40px 0 56px; }
.footer-marks { display: flex; align-items: center; gap: 28px; margin-bottom: 36px; }
.uvic-mark { display: inline-block; line-height: 0; padding: 8px 10px; margin: -8px -10px; }
.uvic-mark img { width: 128px; height: auto; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 32px; font-size: 14.5px; color: var(--muted); }
.footer-grid .fh { margin: 0 0 10px; line-height: 1.4; font-family: var(--mono); font-weight: 400; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.footer-grid p { margin: 0 0 4px; }
.footer-grid .f-links { margin-top: 12px; }
#accessibility p { max-width: 52ch; margin-bottom: 8px; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--text); }

/* responsive */
@media (max-width: 1000px) {
  .wordmark .wm-desc { display: none; }
  .hero-grid, .inst-grid, .past-grid { grid-template-columns: 1fr; }
  .people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pair { max-width: 440px; margin: 24px auto 0; }
  .hero-caption { margin-left: 0; }
  .obj-grid { grid-template-columns: 1fr; }
  .panel.feature { grid-row: auto; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  section { padding: 72px 0; }
  .hero { padding: 48px 0 64px; }
  .nav-links a:not(.btn) { display: none; }
  .pipeline { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; row-gap: 0; }
  .people li { display: grid; grid-template-columns: 88px 1fr; column-gap: 18px; align-content: start; padding: 16px 0; }
  .people li img { grid-row: span 2; margin: 0; }
  .inst li { grid-template-columns: 1fr; gap: 2px; }
  .model3d { margin-top: 56px; }
  .model3d-start { padding: 20px; }
  .pi { grid-template-columns: 1fr; gap: 20px; }
  .pi img { max-width: 200px; }
  .names { grid-template-columns: 1fr; }
  .pipeline::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .btn, .people li img, .pi img { transition: none; } }

/* ---------- label pills (catalyst "subtitle": pill grows, then text) ---------- */
.label { position: relative; display: inline-block; padding: 5px 9px; isolation: isolate; }
.label::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--panel); transform-origin: 0 50%; }
.panel .label { align-self: flex-start; }
.panel .label::before { background: var(--bg); }
.platform .label::before { background: var(--panel); }
.hero .label, .inst .label { margin-left: -1px; }

/* ---------- motion states (only when motion.js runs and motion is allowed) ---------- */
html.motion {
  --ease-out: cubic-bezier(.215, .61, .355, 1);      /* power3.out */
  --ease-catalyst: cubic-bezier(.22, -.01, .13, .99);
}
/* header drops in */
html.motion .nav-box { opacity: 0; transform: translateY(-30px); transition: opacity 1.6s var(--ease-out) .45s, transform 1.6s var(--ease-out) .45s; }
html.motion .nav-box.in { opacity: 1; transform: none; }
/* headings: words rise from behind a mask with a slight 3D turn */
html.motion .w-mask { display: inline-block; overflow: clip; overflow-clip-margin: 0.12em; vertical-align: top; perspective: 700px; }
html.motion .w { display: inline-block; transform: translateY(120%) rotateY(-20deg); transform-origin: 50% 100%; transition: transform 1.2s var(--ease-out); will-change: transform; }
html.motion .in > .w-mask > .w { transform: none; }
/* paragraphs rise one line with a soft tilt */
html.motion .lede, html.motion .note, html.motion .reveal { opacity: 0; transform: translateY(1.1em) rotateY(-8deg); transform-origin: 0 100%; transition: opacity 1.8s var(--ease-out) .15s, transform 1.8s var(--ease-out) .15s; }
html.motion .lede.in, html.motion .note.in, html.motion .reveal.in { opacity: 1; transform: none; }
/* grouped items appear in sequence */
html.motion .rise { opacity: 0; transform: translateY(28px) scale(.975); transition: opacity .8s var(--ease-catalyst), transform .8s var(--ease-catalyst); }
html.motion .rise.in { opacity: 1; transform: none; }
/* label pills grow, then the text appears */
html.motion .label::before { transform: scaleX(0); transition: transform .6s var(--ease-out); }
html.motion .label.in::before { transform: none; }
html.motion .label { color: transparent; transition: color .5s ease .3s; }
html.motion .label .plus { color: transparent; transition: color .5s ease .3s; }
html.motion .label.in { color: var(--muted); }
html.motion .label.in .plus { color: var(--accent); }
/* figures settle in */
html.motion figure:not(.hero-fig) { opacity: 0; transform: translateY(4%) scale(.96); transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out); }
html.motion figure:not(.hero-fig).in { opacity: 1; transform: none; }
/* hero nodes: circles scale in, dashed link draws, accent node pops */
html.motion .pair .node { opacity: 0; transform: scale(.9); transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out); }
html.motion .pair .n2 { transition-delay: .25s; }
html.motion .pair svg.link { clip-path: inset(0 100% 100% 0); transition: clip-path 1.2s var(--ease-out) .5s; }
html.motion .pair .dot { transform: scale(0); transition: transform .6s cubic-bezier(.34, 1.56, .64, 1) 1.1s; }
html.motion .pair .tag { opacity: 0; transition: opacity .8s ease 1.2s; }
html.motion .pair.in .node, html.motion .pair.in .dot { opacity: 1; transform: none; }
html.motion .pair.in svg.link { clip-path: inset(0 0 0 0); }
html.motion .pair.in .tag { opacity: 1; }
/* hero: the dashed link flows slowly from hologram to phase (paused off-screen) */
html.motion .pair.in svg.link line.flow { animation: dash-flow 1.6s linear 1.8s infinite; }
html.motion .pair.idle svg.link line.flow { animation-play-state: paused; }
@keyframes dash-flow { to { stroke-dashoffset: -7; } }
/* dashed connectors draw in once when they enter the view */
html.motion .pipeline::before { clip-path: inset(0 100% 0 0); transition: clip-path 1.8s var(--ease-out) .2s; }
html.motion .pipeline.in::before { clip-path: inset(0); }
/* hover details */
.panel { transition: background-color .3s ease; }
.panel:hover { background: color-mix(in srgb, var(--panel) 88%, var(--text)); }
.people li b { transition: transform .4s var(--ease-catalyst, ease); }
.people li:hover b { transform: translateX(6px); }
/* printing always shows the final state */
@media print {
  html.motion .nav-box, html.motion .w, html.motion .lede, html.motion .note, html.motion .reveal, html.motion .rise,
  html.motion figure, html.motion .pair .node, html.motion .pair .dot, html.motion .pair .tag { opacity: 1 !important; transform: none !important; }
  html.motion .label { color: var(--muted) !important; }
  html.motion .label::before { transform: none !important; }
  html.motion .pair svg.link { clip-path: none !important; }
  html.motion .pair svg.link line.flow { animation: none !important; }
  html.motion .pipeline::before { clip-path: none !important; }
}

/* theme switch (sciemo-style mono text button) */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: transparent; color: var(--text); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.theme-toggle:hover { border-color: var(--text); }
.theme-toggle .swatch { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--text); background: linear-gradient(90deg, var(--text) 50%, var(--bg) 50%); }
@media (max-width: 640px) { .theme-toggle .tt-text { display: none; } .theme-toggle { padding: 0 10px; } }

/* paused or no JS motion: nothing waits on a stagger delay */
html:not(.motion) .rise { transition: none !important; }

/* motion toggle (WCAG 2.2.2): pauses every animation, smooth scrolling and the lens */
.motion-toggle { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: transparent; color: var(--text); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.motion-toggle:hover { border-color: var(--text); }
.motion-toggle .mt-icon { width: 10px; height: 10px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; box-sizing: border-box; }
.motion-toggle.is-paused .mt-icon { border: 0; width: 0; height: 0; border-left: 9px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none; } }
@media (max-width: 640px) { .motion-toggle .mt-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .motion-toggle { padding: 0 13px; } }
@media (max-width: 1180px) { .wordmark .wm-desc { display: none; } }

/* UVic mark keeps its own colours; in dark mode it sits on a light plate */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .uvic-mark { background: #fcfcfc; margin: 0; } }
:root[data-theme="dark"] .uvic-mark { background: #fcfcfc; margin: 0; }

/* Windows high-contrast / forced colours: keep stencilled logo and nodes visible */
@media (forced-colors: active) {
  .brand-mark, .pair .dot, .stage .dot { forced-color-adjust: none; background-color: CanvasText; }
  .label::before { display: none; }
  .btn, .theme-toggle, .motion-toggle { border: 1px solid ButtonText; }
}

/* small phones (down to 320 px): logo only, tighter bar */
@media (max-width: 480px) {
  .nav-box { gap: 10px; padding: 0 6px 0 10px; }
  .nav-links { gap: 6px; }
  .wordmark .wm-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-links .btn { padding: 0 12px; }
  .theme-toggle, .motion-toggle { padding: 0 11px; }
}
