/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Colour palette ---------- */
:root {
  --accent:        #00766b;       /* deep teal (refined version of original #00A79F) */
  --accent-soft:   #d9ebe8;
  --accent-dark:   #004f48;
  --sidebar-bg:    #f1ede4;       /* warm cream, distinct from page background */
  --sidebar-text:  #2b3540;       /* near-black for body text */
  --sidebar-link:  #00564f;       /* dark teal, high contrast on cream */
  --sidebar-muted: #6b7484;       /* for "On this page" label */
  --rule:          #d9d6cd;
  --muted:         #5a6573;
  --card-bg:       #ffffff;
  --highlight-bg:  #fff8e5;       /* soft cream for callouts */
  --highlight-bd:  #e6c84d;

  /* added so every colour can be swapped for dark mode */
  --bg:            #f7f6f2;       /* warm off-white -- easy on the eyes */
  --text:          #1f2933;       /* near-black, softer than pure #000 */
  --heading:       #0f1722;
  --body-text:     #2b3540;
  --badge-text:    #8a5a00;
  --gold:          #a9782f;       /* "earlier collaboration" marker */
  --land:          #e3ddcf;
  --land-stroke:   #cfc7b5;
  --marker-stroke: #ffffff;
  --legend-bg:     #ffffff;
  --on-accent:     #ffffff;       /* text drawn on top of teal/gold dots */
  --link-underline: rgba(0,118,107,0.25);
  --shadow:        rgba(0,0,0,0.05);
  --vine-art:      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 320'%3E%3Cg fill='none' stroke='%2300766b' stroke-linecap='round' opacity='0.35'%3E%3Cpath stroke-width='2.2' d='M60 0C95 40 95 120 60 160C25 200 25 280 60 320'/%3E%3Cpath stroke-width='1.3' d='M60 160c-10-6-22 0-19 10c2 7 11 6 11 0c0-4-5-5-6-2'/%3E%3Cpath stroke-width='1.3' d='M60 0c10 6 22 0 19-10M60 320c10 6 22 0 19-10c-2-7-11-6-11 0c0 4 5 5 6 2'/%3E%3Cpath stroke-width='1.2' d='M86 80c8 14 14 22 16 30M34 240c-8-14-14-22-16-30'/%3E%3Cpath stroke-width='1.2' d='M85 98C74 92 66 90 58 89M35 222C46 230 56 233 62 234'/%3E%3Cpath stroke-width='1.2' d='M73 20C82 14 90 11 97 9M47 180C38 174 30 171 23 169'/%3E%3Cpath stroke-width='1.2' d='M62 156C72 152 80 150 88 151M49 300C40 297 34 296 28 297'/%3E%3C/g%3E%3Cg fill='%232f8a6e' opacity='0.39'%3E%3Cpath transform='translate(80 36) rotate(200)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(86 80) rotate(-25)' d='M0 0C7-9 22-9 30 0C22 9 7 9 0 0Z'/%3E%3Cpath transform='translate(80 124) rotate(160)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(40 196) rotate(-20)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(34 240) rotate(205)' d='M0 0C7-9 22-9 30 0C22 9 7 9 0 0Z'/%3E%3Cpath transform='translate(40 284) rotate(20)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3C/g%3E%3Cg fill='%238a5a9e' opacity='0.70'%3E%3Ccircle cx='102' cy='111' r='3.4'/%3E%3Ccircle cx='97' cy='117' r='2.8'/%3E%3Ccircle cx='106' cy='118' r='2.6'/%3E%3Ccircle cx='18' cy='209' r='3.4'/%3E%3Ccircle cx='23' cy='203' r='2.8'/%3E%3Ccircle cx='14' cy='202' r='2.6'/%3E%3C/g%3E%3Cg fill='%23d07a93' opacity='0.64'%3E%3Cpath transform='translate(97 9) rotate(-20)' d='M0 0C2-6 11-7 15 0C11 7 2 6 0 0Z'/%3E%3Cpath transform='translate(23 169) rotate(200)' d='M0 0C2-6 11-7 15 0C11 7 2 6 0 0Z'/%3E%3C/g%3E%3Cg transform='translate(42 88)'%3E%3Cg fill='%23d07a93' opacity='0.4'%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(10)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(82)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(154)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(226)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(298)'/%3E%3C/g%3E%3Cg fill='%23e3a0b2' opacity='0.4'%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(10)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(82)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(154)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(226)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(298)'/%3E%3C/g%3E%3Ccircle r='3.8' fill='%23d9a441' opacity='0.6'/%3E%3C/g%3E%3Cg transform='translate(78 236)'%3E%3Cg fill='%23d07a93' opacity='0.4'%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(-8)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(64)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(136)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(208)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(280)'/%3E%3C/g%3E%3Cg fill='%23e3a0b2' opacity='0.4'%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(-8)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(64)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(136)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(208)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(280)'/%3E%3C/g%3E%3Ccircle r='3.8' fill='%23d9a441' opacity='0.6'/%3E%3C/g%3E%3Cg transform='translate(97 151)'%3E%3Cg fill='%23d07a93' opacity='0.4'%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(20)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(92)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(164)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(236)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(308)'/%3E%3C/g%3E%3Cg fill='%23e3a0b2' opacity='0.4'%3E%3C/g%3E%3Ccircle r='2.4' fill='%23d9a441' opacity='0.6'/%3E%3C/g%3E%3Cg transform='translate(18 297)'%3E%3Cg fill='%23d07a93' opacity='0.4'%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(-15)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(57)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(129)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(201)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(273)'/%3E%3C/g%3E%3Cg fill='%23e3a0b2' opacity='0.4'%3E%3C/g%3E%3Ccircle r='2.4' fill='%23d9a441' opacity='0.6'/%3E%3C/g%3E%3C/svg%3E");
  --bird-art:      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 960'%3E%3Cg opacity='0.5'%3E%3Cpath fill='%236aa893' opacity='.75' d='M21 43C21 32 25 24 32 18C30 29 27 37 23 45Z'/%3E%3Cpath fill='%232e8b6a' d='M13 40L2 35L8 40L4 31Z'/%3E%3Cellipse cx='19' cy='45' rx='10' ry='4.8' transform='rotate(35 19 45)' fill='%232e8b6a'/%3E%3Ccircle cx='27.5' cy='51' r='4.3' fill='%232e8b6a'/%3E%3Cellipse cx='25' cy='52' rx='3' ry='2.2' transform='rotate(35 25 52)' fill='%23c4506e'/%3E%3Cpath stroke='%232e8b6a' stroke-width='1.1' stroke-linecap='round' d='M30.5 53.5L41 61'/%3E%3Cpath fill='%236aa893' d='M18 43C12 32 10 25 12 16C18 24 22 33 22 42Z'/%3E%3Ccircle cx='28.6' cy='49.8' r='0.9' fill='%23f7f6f2'/%3E%3C/g%3E%3Cg transform='translate(0 640)'%3E%3Cpath fill='none' stroke='%238a6a45' stroke-width='1.6' stroke-linecap='round' opacity='0.80' d='M55 305C70 302 90 300 115 301'/%3E%3Cpath fill='%232f8a6e' opacity='0.39' transform='translate(108 301) rotate(25)' d='M0 0C3-4 9-4 12 0C9 4 3 4 0 0Z'/%3E%3Cg opacity='0.5'%3E%3Cpath fill='%233c5f88' d='M88 291L76 297L78 301L90 295Z'/%3E%3Cellipse cx='96' cy='290' rx='11' ry='7.5' transform='rotate(-15 96 290)' fill='%234f78a8'/%3E%3Cellipse cx='101' cy='293' rx='6' ry='4.6' transform='rotate(-15 101 293)' fill='%23d4824a'/%3E%3Ccircle cx='106' cy='282' r='5.6' fill='%234f78a8'/%3E%3Cpath fill='%23d9a441' d='M110.5 280.6L116.5 282.4L110.5 284.2Z'/%3E%3Cellipse cx='93' cy='288.5' rx='7.5' ry='4' transform='rotate(-15 93 288.5)' fill='%233c5f88'/%3E%3Ccircle cx='107.6' cy='281' r='1' fill='%23f7f6f2'/%3E%3Cpath stroke='%238a6a45' stroke-width='1' d='M95 297V300.5M98 296.5V300.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

/* ---------- Dark palette: soft charcoal + muted teal, low glare ---------- */
:root[data-theme="dark"] {
  --bg:            #1b1e22;       /* soft charcoal, not pure black */
  --text:          #d5d1c9;       /* warm off-white, not pure white */
  --heading:       #ebe6dc;
  --body-text:     #cbc6bd;
  --accent:        #6dbcb0;       /* muted teal */
  --accent-soft:   #24403c;
  --accent-dark:   #8fcfc4;       /* used for accent headings: lighter in dark mode */
  --sidebar-bg:    #23272c;
  --sidebar-text:  #d0cbc2;
  --sidebar-link:  #86c7bc;
  --sidebar-muted: #8c939c;
  --rule:          #363b42;
  --muted:         #9aa1a9;
  --card-bg:       #23272c;
  --highlight-bg:  #3a3222;
  --highlight-bd:  #8c7638;
  --badge-text:    #e2c27c;
  --gold:          #c9a263;
  --land:          #353b42;
  --land-stroke:   #474e56;
  --marker-stroke: #1b1e22;
  --legend-bg:     #1f2327;
  --on-accent:     #10201d;
  --link-underline: rgba(134,199,188,0.3);
  --shadow:        rgba(0,0,0,0.35);
  --vine-art:      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 320'%3E%3Cg fill='none' stroke='%236dbcb0' stroke-linecap='round' opacity='0.29'%3E%3Cpath stroke-width='2.2' d='M60 0C95 40 95 120 60 160C25 200 25 280 60 320'/%3E%3Cpath stroke-width='1.3' d='M60 160c-10-6-22 0-19 10c2 7 11 6 11 0c0-4-5-5-6-2'/%3E%3Cpath stroke-width='1.3' d='M60 0c10 6 22 0 19-10M60 320c10 6 22 0 19-10c-2-7-11-6-11 0c0 4 5 5 6 2'/%3E%3Cpath stroke-width='1.2' d='M86 80c8 14 14 22 16 30M34 240c-8-14-14-22-16-30'/%3E%3Cpath stroke-width='1.2' d='M85 98C74 92 66 90 58 89M35 222C46 230 56 233 62 234'/%3E%3Cpath stroke-width='1.2' d='M73 20C82 14 90 11 97 9M47 180C38 174 30 171 23 169'/%3E%3Cpath stroke-width='1.2' d='M62 156C72 152 80 150 88 151M49 300C40 297 34 296 28 297'/%3E%3C/g%3E%3Cg fill='%236dbcb0' opacity='0.30'%3E%3Cpath transform='translate(80 36) rotate(200)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(86 80) rotate(-25)' d='M0 0C7-9 22-9 30 0C22 9 7 9 0 0Z'/%3E%3Cpath transform='translate(80 124) rotate(160)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(40 196) rotate(-20)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(34 240) rotate(205)' d='M0 0C7-9 22-9 30 0C22 9 7 9 0 0Z'/%3E%3Cpath transform='translate(40 284) rotate(20)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3C/g%3E%3Cg fill='%23b48cc4' opacity='0.56'%3E%3Ccircle cx='102' cy='111' r='3.4'/%3E%3Ccircle cx='97' cy='117' r='2.8'/%3E%3Ccircle cx='106' cy='118' r='2.6'/%3E%3Ccircle cx='18' cy='209' r='3.4'/%3E%3Ccircle cx='23' cy='203' r='2.8'/%3E%3Ccircle cx='14' cy='202' r='2.6'/%3E%3C/g%3E%3Cg fill='%23d98ea3' opacity='0.45'%3E%3Cpath transform='translate(97 9) rotate(-20)' d='M0 0C2-6 11-7 15 0C11 7 2 6 0 0Z'/%3E%3Cpath transform='translate(23 169) rotate(200)' d='M0 0C2-6 11-7 15 0C11 7 2 6 0 0Z'/%3E%3C/g%3E%3Cg transform='translate(42 88)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(10)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(82)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(154)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(226)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(298)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(10)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(82)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(154)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(226)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(298)'/%3E%3C/g%3E%3Ccircle r='3.8' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3Cg transform='translate(78 236)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(-8)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(64)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(136)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(208)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(280)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(-8)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(64)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(136)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(208)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(280)'/%3E%3C/g%3E%3Ccircle r='3.8' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3Cg transform='translate(97 151)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(20)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(92)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(164)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(236)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(308)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3C/g%3E%3Ccircle r='2.4' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3Cg transform='translate(18 297)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(-15)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(57)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(129)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(201)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(273)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3C/g%3E%3Ccircle r='2.4' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3C/svg%3E");
  --bird-art:      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 960'%3E%3Cg opacity='0.4'%3E%3Cpath fill='%2393cdb8' opacity='.75' d='M21 43C21 32 25 24 32 18C30 29 27 37 23 45Z'/%3E%3Cpath fill='%236cc0a0' d='M13 40L2 35L8 40L4 31Z'/%3E%3Cellipse cx='19' cy='45' rx='10' ry='4.8' transform='rotate(35 19 45)' fill='%236cc0a0'/%3E%3Ccircle cx='27.5' cy='51' r='4.3' fill='%236cc0a0'/%3E%3Cellipse cx='25' cy='52' rx='3' ry='2.2' transform='rotate(35 25 52)' fill='%23e07a95'/%3E%3Cpath stroke='%236cc0a0' stroke-width='1.1' stroke-linecap='round' d='M30.5 53.5L41 61'/%3E%3Cpath fill='%2393cdb8' d='M18 43C12 32 10 25 12 16C18 24 22 33 22 42Z'/%3E%3Ccircle cx='28.6' cy='49.8' r='0.9' fill='%231b1e22'/%3E%3C/g%3E%3Cg transform='translate(0 640)'%3E%3Cpath fill='none' stroke='%23b0906a' stroke-width='1.6' stroke-linecap='round' opacity='0.56' d='M55 305C70 302 90 300 115 301'/%3E%3Cpath fill='%236dbcb0' opacity='0.30' transform='translate(108 301) rotate(25)' d='M0 0C3-4 9-4 12 0C9 4 3 4 0 0Z'/%3E%3Cg opacity='0.4'%3E%3Cpath fill='%236f93c0' d='M88 291L76 297L78 301L90 295Z'/%3E%3Cellipse cx='96' cy='290' rx='11' ry='7.5' transform='rotate(-15 96 290)' fill='%2386a9d4'/%3E%3Cellipse cx='101' cy='293' rx='6' ry='4.6' transform='rotate(-15 101 293)' fill='%23e3a070'/%3E%3Ccircle cx='106' cy='282' r='5.6' fill='%2386a9d4'/%3E%3Cpath fill='%23e0b45c' d='M110.5 280.6L116.5 282.4L110.5 284.2Z'/%3E%3Cellipse cx='93' cy='288.5' rx='7.5' ry='4' transform='rotate(-15 93 288.5)' fill='%236f93c0'/%3E%3Ccircle cx='107.6' cy='281' r='1' fill='%231b1e22'/%3E%3Cpath stroke='%23b0906a' stroke-width='1' d='M95 297V300.5M98 296.5V300.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #1b1e22;       /* soft charcoal, not pure black */
    --text:          #d5d1c9;       /* warm off-white, not pure white */
    --heading:       #ebe6dc;
    --body-text:     #cbc6bd;
    --accent:        #6dbcb0;       /* muted teal */
    --accent-soft:   #24403c;
    --accent-dark:   #8fcfc4;       /* used for accent headings: lighter in dark mode */
    --sidebar-bg:    #23272c;
    --sidebar-text:  #d0cbc2;
    --sidebar-link:  #86c7bc;
    --sidebar-muted: #8c939c;
    --rule:          #363b42;
    --muted:         #9aa1a9;
    --card-bg:       #23272c;
    --highlight-bg:  #3a3222;
    --highlight-bd:  #8c7638;
    --badge-text:    #e2c27c;
    --gold:          #c9a263;
    --land:          #353b42;
    --land-stroke:   #474e56;
    --marker-stroke: #1b1e22;
    --legend-bg:     #1f2327;
    --on-accent:     #10201d;
    --link-underline: rgba(134,199,188,0.3);
    --shadow:        rgba(0,0,0,0.35);
    --vine-art:      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 320'%3E%3Cg fill='none' stroke='%236dbcb0' stroke-linecap='round' opacity='0.29'%3E%3Cpath stroke-width='2.2' d='M60 0C95 40 95 120 60 160C25 200 25 280 60 320'/%3E%3Cpath stroke-width='1.3' d='M60 160c-10-6-22 0-19 10c2 7 11 6 11 0c0-4-5-5-6-2'/%3E%3Cpath stroke-width='1.3' d='M60 0c10 6 22 0 19-10M60 320c10 6 22 0 19-10c-2-7-11-6-11 0c0 4 5 5 6 2'/%3E%3Cpath stroke-width='1.2' d='M86 80c8 14 14 22 16 30M34 240c-8-14-14-22-16-30'/%3E%3Cpath stroke-width='1.2' d='M85 98C74 92 66 90 58 89M35 222C46 230 56 233 62 234'/%3E%3Cpath stroke-width='1.2' d='M73 20C82 14 90 11 97 9M47 180C38 174 30 171 23 169'/%3E%3Cpath stroke-width='1.2' d='M62 156C72 152 80 150 88 151M49 300C40 297 34 296 28 297'/%3E%3C/g%3E%3Cg fill='%236dbcb0' opacity='0.30'%3E%3Cpath transform='translate(80 36) rotate(200)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(86 80) rotate(-25)' d='M0 0C7-9 22-9 30 0C22 9 7 9 0 0Z'/%3E%3Cpath transform='translate(80 124) rotate(160)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(40 196) rotate(-20)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3Cpath transform='translate(34 240) rotate(205)' d='M0 0C7-9 22-9 30 0C22 9 7 9 0 0Z'/%3E%3Cpath transform='translate(40 284) rotate(20)' d='M0 0C8-11 26-11 36 0C26 11 8 11 0 0Z'/%3E%3C/g%3E%3Cg fill='%23b48cc4' opacity='0.56'%3E%3Ccircle cx='102' cy='111' r='3.4'/%3E%3Ccircle cx='97' cy='117' r='2.8'/%3E%3Ccircle cx='106' cy='118' r='2.6'/%3E%3Ccircle cx='18' cy='209' r='3.4'/%3E%3Ccircle cx='23' cy='203' r='2.8'/%3E%3Ccircle cx='14' cy='202' r='2.6'/%3E%3C/g%3E%3Cg fill='%23d98ea3' opacity='0.45'%3E%3Cpath transform='translate(97 9) rotate(-20)' d='M0 0C2-6 11-7 15 0C11 7 2 6 0 0Z'/%3E%3Cpath transform='translate(23 169) rotate(200)' d='M0 0C2-6 11-7 15 0C11 7 2 6 0 0Z'/%3E%3C/g%3E%3Cg transform='translate(42 88)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(10)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(82)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(154)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(226)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(298)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(10)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(82)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(154)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(226)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(298)'/%3E%3C/g%3E%3Ccircle r='3.8' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3Cg transform='translate(78 236)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(-8)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(64)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(136)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(208)'/%3E%3Cellipse cx='11.4' cy='0' rx='9.9' ry='6.5' transform='rotate(280)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(-8)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(64)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(136)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(208)'/%3E%3Cellipse cx='7.2' cy='0' rx='5.7' ry='3.4' transform='rotate(280)'/%3E%3C/g%3E%3Ccircle r='3.8' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3Cg transform='translate(97 151)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(20)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(92)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(164)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(236)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(308)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3C/g%3E%3Ccircle r='2.4' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3Cg transform='translate(18 297)'%3E%3Cg fill='%23d98ea3' opacity='0.28'%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(-15)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(57)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(129)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(201)'/%3E%3Cellipse cx='7.2' cy='0' rx='6.2' ry='4.1' transform='rotate(273)'/%3E%3C/g%3E%3Cg fill='%23e8b3c2' opacity='0.28'%3E%3C/g%3E%3Ccircle r='2.4' fill='%23e0b45c' opacity='0.38'/%3E%3C/g%3E%3C/svg%3E");
    --bird-art:      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 960'%3E%3Cg opacity='0.4'%3E%3Cpath fill='%2393cdb8' opacity='.75' d='M21 43C21 32 25 24 32 18C30 29 27 37 23 45Z'/%3E%3Cpath fill='%236cc0a0' d='M13 40L2 35L8 40L4 31Z'/%3E%3Cellipse cx='19' cy='45' rx='10' ry='4.8' transform='rotate(35 19 45)' fill='%236cc0a0'/%3E%3Ccircle cx='27.5' cy='51' r='4.3' fill='%236cc0a0'/%3E%3Cellipse cx='25' cy='52' rx='3' ry='2.2' transform='rotate(35 25 52)' fill='%23e07a95'/%3E%3Cpath stroke='%236cc0a0' stroke-width='1.1' stroke-linecap='round' d='M30.5 53.5L41 61'/%3E%3Cpath fill='%2393cdb8' d='M18 43C12 32 10 25 12 16C18 24 22 33 22 42Z'/%3E%3Ccircle cx='28.6' cy='49.8' r='0.9' fill='%231b1e22'/%3E%3C/g%3E%3Cg transform='translate(0 640)'%3E%3Cpath fill='none' stroke='%23b0906a' stroke-width='1.6' stroke-linecap='round' opacity='0.56' d='M55 305C70 302 90 300 115 301'/%3E%3Cpath fill='%236dbcb0' opacity='0.30' transform='translate(108 301) rotate(25)' d='M0 0C3-4 9-4 12 0C9 4 3 4 0 0Z'/%3E%3Cg opacity='0.4'%3E%3Cpath fill='%236f93c0' d='M88 291L76 297L78 301L90 295Z'/%3E%3Cellipse cx='96' cy='290' rx='11' ry='7.5' transform='rotate(-15 96 290)' fill='%2386a9d4'/%3E%3Cellipse cx='101' cy='293' rx='6' ry='4.6' transform='rotate(-15 101 293)' fill='%23e3a070'/%3E%3Ccircle cx='106' cy='282' r='5.6' fill='%2386a9d4'/%3E%3Cpath fill='%23e0b45c' d='M110.5 280.6L116.5 282.4L110.5 284.2Z'/%3E%3Cellipse cx='93' cy='288.5' rx='7.5' ry='4' transform='rotate(-15 93 288.5)' fill='%236f93c0'/%3E%3Ccircle cx='107.6' cy='281' r='1' fill='%231b1e22'/%3E%3Cpath stroke='%23b0906a' stroke-width='1' d='M95 297V300.5M98 296.5V300.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color-scheme: dark;
  }
}


/* ---------- Layout container ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 32px;
}

/* ---------- Header: profile + bio side by side, responsive ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: start;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 24px 22px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 4px var(--shadow);
}
.sidebar img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: #006f6f;
}
.sidebar hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 16px 0;
}
.sidebar p {
  margin: 8px 0;
  font-size: 0.95rem;
  line-height: 1.9;
}
.sidebar a {
  color: var(--sidebar-link);
  text-decoration: none;
  border-bottom: 1px solid var(--link-underline);
  transition: border-color 0.2s, color 0.2s;
}
.sidebar a:visited {
  color: var(--sidebar-link);
}
.sidebar a:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
}
.sidebar .nav-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  margin-top: 6px;
  margin-bottom: 4px;
}

/* ---------- Main column ---------- */
.main { min-width: 0; } /* prevents grid overflow on narrow screens */
.main h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.25;
  margin: 4px 0 14px 0;
  color: var(--heading);
}
.main h1 .lang-script {
  font-weight: 400;
  color: var(--muted);
  font-style: italic;
}
.main p {
  margin: 0 0 14px 0;
}
.lead {
  font-size: 1.05rem;
  color: var(--body-text);
}
.label {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ---------- Links ---------- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--accent-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:visited { color: var(--accent-dark); }

/* ---------- Sections below the header ---------- */
.section {
  margin-top: 42px;
  padding-top: 30px;
  border-top: 1px solid var(--rule);
}
.section h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 18px 0;
  color: var(--heading);
  letter-spacing: 0.005em;
}
.section h2 .anchor-tag {
  display: inline-block;
  margin-left: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  vertical-align: middle;
  font-weight: 500;
}

/* ---------- Quote ---------- */
.quote {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  text-align: center;
  color: var(--body-text);
  max-width: 720px;
  margin: 6px auto 6px auto;
  padding: 18px 24px;
  line-height: 1.6;
}
.quote .attrib {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- Publication list ---------- */
.pub-list {
  padding-left: 22px;
  margin: 0;
}
.pub-list li {
  margin-bottom: 12px;
  line-height: 1.55;
  font-size: 0.96rem;
}
.pub-list .venue {
  color: var(--muted);
  font-size: 0.92rem;
}
.pub-list .badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--badge-text);
  background: var(--highlight-bg);
  border: 1px solid var(--highlight-bd);
  padding: 1px 8px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
.alpha-mark {
  display: inline-block;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 0.9em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: 1px;
  cursor: help;
}

/* ---------- Ongoing project blocks ---------- */
.project {
  margin: 22px 0;
  padding: 18px 22px;
  background: var(--sidebar-bg);        /* warm cream, distinct from page */
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.project h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  font-size: 1.12rem;
  margin: 0 0 5px 0;
  color: var(--accent-dark);
  letter-spacing: 0.01em;
}
.project h3 .project-acr {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.project .tagline {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 1.02rem;
  color: var(--body-text);
  margin: 0 0 10px 0;
}
.project p { margin: 0 0 10px 0; }
.project .works-on {
  font-size: 0.92rem;
  color: var(--body-text);
  margin-bottom: 0;
}
.project .works-label {
  font-weight: 600;
  color: var(--accent-dark);
}
.project-note {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 16px;
}

/* ---------- People: students & collaborators ---------- */
.people h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent-dark);
  margin: 20px 0 8px 0;
}
.people h3:first-of-type { margin-top: 4px; }
.people-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 6px 0;
}
.people-list li {
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 0.96rem;
  padding-left: 14px;
  border-left: 2px solid var(--accent-soft);
}
.people-list .aff { color: var(--muted); }
.people .names {
  font-size: 0.95rem;
  line-height: 1.65;
}
.people .role-label {
  font-weight: 600;
  color: var(--accent-dark);
}

/* ---------- Collaborator world map ---------- */
.collab-map {
  background: var(--sidebar-bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 4px 0 14px 0;
}
.collab-map-svg { display: block; width: 100%; height: auto; }
.collab-map-svg .land {
  fill: var(--land);
  stroke: var(--land-stroke);
  stroke-width: 0.6;
}
.collab-map-svg .mk circle {
  stroke: var(--marker-stroke);
  stroke-width: 1.5;
  transition: r 0.15s ease;
}
.collab-map-svg .mk.cur circle  { fill: var(--accent); }      /* teal = current */
.collab-map-svg .mk.past circle { fill: var(--gold); }            /* gold = earlier */
.collab-map-svg .map-num {
  fill: var(--on-accent);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
}
.collab-map-svg .mk:hover circle { stroke: var(--accent-dark); stroke-width: 2.5; }

/* in-map legend panel */
.map-legend-box rect {
  fill: var(--legend-bg);
  fill-opacity: 0.9;
  stroke: var(--rule);
  stroke-width: 1;
}
.map-legend-box .lg-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  fill: var(--accent-dark);
}
.map-legend-box .lg-item {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  fill: var(--body-text);
}
.map-legend-box .lg-n { font-weight: 700; fill: var(--accent-dark); }

/* inline colored dots used in the caption text */
.dot-current, .dot-earlier {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  vertical-align: baseline;
  position: relative; top: 1px;
}
.dot-current { background: var(--accent); }
.dot-earlier { background: var(--gold); }

/* mobile fallback legend (shown only on narrow screens) */
.map-legend-fallback {
  display: none;
  list-style: none;
  padding: 0;
  margin: 12px 0 4px 0;
}
.map-legend-fallback .mlf-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  color: var(--accent-dark);
  font-size: 0.98rem;
  margin-bottom: 8px;
}
.map-legend-fallback li {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 8px;
  line-height: 1.4;
}
.mlf-dot {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  color: var(--on-accent); font-size: 0.72rem; font-weight: 700;
  position: relative; top: 3px;
}
.mlf-dot.cur  { background: var(--accent); }
.mlf-dot.past { background: var(--gold); }
.mlf-txt { font-size: 0.9rem; }
.mlf-txt strong { display: block; color: var(--sidebar-text); font-weight: 600; }
.mlf-collab { color: var(--muted); font-size: 0.82rem; }

@media (max-width: 600px) {
  .map-legend-box { display: none; }      /* hide the on-map legend when the map gets small */
  .map-legend-fallback { display: block; } /* show the readable text legend instead */
}

/* ---------- Footer ---------- */
footer {
  margin-top: 50px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ============================================================
   Responsive breakpoints
   ============================================================ */

/* Tablets ~1024px and below: tighten gutters */
@media (max-width: 1024px) {
  .container { padding: 24px 24px; }
  .profile-grid { grid-template-columns: 220px 1fr; gap: 28px; }
  .main h1 { font-size: 1.7rem; }
}

/* Small tablets / large phones: stack sidebar on top of bio */
@media (max-width: 760px) {
  .container { padding: 20px 18px; }
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    align-items: start;
  }
  .sidebar img { max-width: 140px; }
  .sidebar hr { display: none; }
  .sidebar .sidebar-content {
    font-size: 0.95rem;
  }
  .main h1 { font-size: 1.5rem; }
  .section { margin-top: 32px; padding-top: 22px; }
  .section h2 { font-size: 1.25rem; }
  .quote { font-size: 1rem; padding: 12px 8px; }
}

/* Phones ~480px and below: single column, sidebar fully stacked */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .container { padding: 16px 14px; }
  .sidebar {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .sidebar img {
    max-width: 180px;
    margin: 0 auto;
  }
  .sidebar p { text-align: center; }
  .pub-list { padding-left: 18px; }
  .pub-list li { font-size: 0.93rem; }
}

/* ---------- Sub-page header & navigation ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.site-header .site-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--heading);
}
.site-header .site-name:hover { color: var(--accent-dark); text-decoration: none; }
.site-header .site-name .lang-script { font-weight: 400; font-style: italic; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.95rem; }
.site-nav a, .site-nav a:visited { color: var(--sidebar-link); }
.site-nav a[aria-current="page"] {
  color: var(--accent-dark);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}
.site-nav a[aria-current="page"]:hover { text-decoration: none; }
.page-body .section:first-child { margin-top: 28px; padding-top: 0; border-top: none; }

/* ---------- Homepage "explore" cards ---------- */
.explore {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.explore-card, .explore-card:visited {
  display: block;
  padding: 18px 20px;
  background: var(--sidebar-bg);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  color: var(--body-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.explore-card:hover {
  text-decoration: none;
  color: var(--body-text);
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--shadow);
}
.explore-card h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-dark);
  margin: 0 0 6px 0;
}
.explore-card p { margin: 0; font-size: 0.93rem; line-height: 1.55; }
.explore-card .go { display: inline-block; margin-top: 10px; font-size: 0.88rem; font-weight: 600; color: var(--accent); }
@media (max-width: 760px) {
  .explore { grid-template-columns: 1fr; }
}

/* ---------- Light / dark toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--sidebar-bg);
  color: var(--accent-dark);
  cursor: pointer;
  box-shadow: 0 1px 4px var(--shadow);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
/* the photo has a hard edge in dark mode; soften it slightly */
:root[data-theme="dark"] .sidebar img { filter: brightness(0.92); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar img { filter: brightness(0.92); }
}

/* ---------- Decorative flowering vines + birds in the side margins (wide screens only) ---------- */
body { position: relative; }
.container { position: relative; z-index: 1; }
@media (min-width: 1340px) {
  body::before, body::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc((100% - 1180px) / 2);
    pointer-events: none;
    /* two layers: birds (repeat every 3 vine tiles) over the flowering vine */
    background-image: var(--bird-art), var(--vine-art);
    background-repeat: repeat-y, repeat-y;
    background-position: center top, center top;
    background-size: var(--art-w) auto, var(--art-w) auto;
    --art-w: clamp(80px, calc((100vw - 1180px) / 2 - 36px), 140px);
  }
  body::before { left: 0; }
  body::after  { right: 0; transform: scaleX(-1); }  /* mirrored on the right */
}
@media print { body::before, body::after { display: none; } }

/* ---------- Book cover thumbnail (homepage, Research paragraph) ---------- */
/* the paragraph contains the floated cover, so the next paragraph never wraps around it */
.with-book { display: flow-root; }
.book-cover {
  float: left;
  width: 104px;
  margin: 5px 20px 10px 0;
  border-radius: 3px;
  box-shadow: 0 2px 8px var(--shadow), 0 0 0 1px var(--rule);
  transition: transform 0.2s, box-shadow 0.2s;
}
.book-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}
.book-cover:hover {
  transform: translateY(-2px) rotate(1deg);
  box-shadow: 0 6px 16px var(--shadow), 0 0 0 1px var(--accent);
}
@media (max-width: 480px) {
  .book-cover { width: 84px; margin-right: 14px; }
}

/* On screens without side margins, let the theme button scroll away with the page
   instead of floating over the text. */
@media (max-width: 1240px) {
  .theme-toggle { position: absolute; }
}
