/* Social Shields brand (socialshields.org/brand.css and STYLE_GUIDE.md), the same copy kb.socialshields.org keeps in
   kb.css: neutral grey surfaces, FSC green for the words that matter, one bright gold, and four type roles. Bricolage
   Grotesque for headings and the brand name, IBM Plex Serif for navigation and h3, IBM Plex Sans for text, IBM Plex Mono
   for code. The tokens are copied rather than linked, so no page waits on another site; when brand.css changes, copy
   its values into this block again. Fonts are served from /assets/fonts (Latin subsets, SIL Open Font License). */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700 800; font-stretch: 100%; font-display: swap; src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-stretch: 100%; font-display: swap; src: url("/assets/fonts/ibm-plex-sans.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-serif-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-mono.woff2") format("woff2"); }
:root {
  --ss-green: #006f71; --ss-green-dark: #006456; --ss-gold: #ffba00; --ss-gold-dark: #856514;
  --ss-bg: #f8f8f8; --ss-bg-soft: #e4e4e4; --ss-card: #fdfdfd;
  --ss-ink: #070707; --ss-fg: #1b1b1b; --ss-muted: #585858; --ss-line: rgba(7, 7, 7, .1);
  --ss-shadow: 0 1px 1px rgba(7, 7, 7, .05), 0 2px 3px rgba(7, 7, 7, .04), 0 6px 12px rgba(7, 7, 7, .05);
  --ss-shadow-up: 0 1px 1px rgba(7, 7, 7, .05), 0 4px 6px rgba(7, 7, 7, .05), 0 12px 24px rgba(7, 7, 7, .07);
  --ss-radius-lg: 22px; --ss-ease: cubic-bezier(.2, .8, .2, 1);
  --ss-head: "Bricolage Grotesque", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --ss-nav: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --ss-body: "IBM Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --ss-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --line: color-mix(in srgb, var(--ss-bg) 90%, var(--ss-ink));
  --line-strong: color-mix(in srgb, var(--ss-bg) 74%, var(--ss-ink));
  --code-bg: color-mix(in srgb, var(--ss-bg) 93%, var(--ss-fg));
  --tile-rim: #e6e6e6; --tile-edge: #dcdcdc; --tile-face: #ffffff; --tile-face-2: #f6f6f6;
  --edge: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--ss-bg); overscroll-behavior: none; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font: 16px/1.6 var(--ss-body);
  -webkit-font-smoothing: antialiased;
  color: var(--ss-fg);
  background: var(--ss-bg);
}
main { flex: 1; padding-bottom: 72px; }
a { color: var(--ss-green-dark); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { color: var(--ss-green); }
::selection { background: var(--ss-gold); color: var(--ss-ink); }
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--ss-green); outline-offset: 2px; border-radius: 6px; }
p, li { text-wrap: pretty; }
.wrap { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }

/* Top row, the same on every page: the shield home link, a hairline, then the site name at the same height. */
.top { display: flex; align-items: center; gap: 16px; padding-top: 14px; }
.ss-home { display: inline-flex; align-items: center; gap: 10px; height: 48px; white-space: nowrap; font-family: var(--ss-head); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; line-height: 1; color: var(--ss-green-dark); text-decoration: none; transition: color .2s; }
.ss-home:hover { color: var(--ss-green); }
.ss-home img { width: 32px; height: 32px; }
.top::before { content: ""; order: 1; width: 1px; height: 22px; background: var(--line-strong); }
.top h1, .top .site { order: 2; margin: 0; white-space: nowrap; font: 600 19px/1 var(--ss-nav); color: var(--ss-ink); text-decoration: none; }
.top .site { padding: 8px 0; }
.top .site:hover { color: var(--ss-green-dark); }
/* Phones: the shield alone is the home link, as on socialshields.org */
@media (max-width: 420px) { .top { gap: 12px; } .ss-home span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

/* Footer: a band in FSC green with a gold rule on top */
.ss-footer { background: var(--ss-green-dark); border-top: 4px solid var(--ss-gold); color: #fff; text-align: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.ss-footer::selection { background: #fff; color: var(--ss-green-dark); }

/* App tile: a white squircle set into a soft grey rim, as on the knowledge base. */
.tile {
  --tile: 72px;
  --squircle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M28 0H72C89 0 100 11 100 28V72C100 89 89 100 72 100H28C11 100 0 89 0 72V28C0 11 11 0 28 0z'/%3E%3C/svg%3E");
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  position: relative;
  display: block;
  width: var(--tile);
  height: var(--tile);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .05)) drop-shadow(0 6px 10px rgba(40, 40, 30, .10));
  transition: transform .35s var(--spring), filter .25s var(--ss-ease);
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--tile-rim) 0%, var(--tile-edge) 100%);
  -webkit-mask: var(--squircle) center / 100% 100% no-repeat;
  mask: var(--squircle) center / 100% 100% no-repeat;
}
.tile img {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  padding: 7%;
  background: linear-gradient(180deg, var(--tile-face) 0%, var(--tile-face-2) 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ss-fg) 7%, transparent), inset 0 -2px 0 color-mix(in srgb, var(--ss-fg) 3%, transparent);
  -webkit-mask: var(--squircle) center / 100% 100% no-repeat;
  mask: var(--squircle) center / 100% 100% no-repeat;
  transition: transform .35s var(--spring);
}
a:hover .tile { transform: translateY(-3px) scale(1.02); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .05)) drop-shadow(0 14px 18px rgba(40, 40, 30, .14)); }
a:hover .tile img { transform: scale(1.05); }
a:active .tile { transform: translateY(1px) scale(.94); transition-duration: .12s; }

/* Course switch: one row of course tiles in a white box, icon above code and name; the chosen one has a green tile.
   When there are more courses than fit, the row scrolls sideways. Without JavaScript every course shows in turn. */
.courses { display: flex; gap: 4px; margin: 28px 0 0; padding: 10px 10px 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 10px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: var(--ss-radius-lg); box-shadow: var(--ss-shadow); }
.courses a { flex: 0 0 152px; scroll-snap-align: start; display: block; padding: 10px 8px 8px; border-radius: 8px; text-align: center; color: var(--ss-muted); text-decoration: none; transition: color .2s var(--ss-ease), background .2s var(--ss-ease); }
.courses .tile { --tile: 88px; margin: 0 auto 8px; }
.courses .name { display: block; font-size: 13px; font-weight: 500; line-height: 1.3; text-wrap: balance; }
.courses .name b { display: block; font-size: 16px; font-weight: 600; color: var(--ss-fg); }
.courses a:hover { color: var(--ss-ink); background: var(--ss-bg-soft); }
.courses a[aria-current] { color: var(--ss-green-dark); }
.courses a[aria-current] .name b { color: var(--ss-green-dark); }
.courses a[aria-current] .tile::before { background: linear-gradient(180deg, color-mix(in srgb, var(--ss-green) 80%, #fff) 0%, var(--ss-green-dark) 100%); }
@media (max-width: 520px) { .courses { padding: 8px 8px 4px; scroll-padding-inline: 8px; } .courses a { flex-basis: 96px; padding: 6px 2px; } .courses .tile { --tile: 64px; margin-bottom: 6px; } .courses .name { font-size: 12px; } .courses .name b { font-size: 14px; } }

.home section { margin-top: 28px; }
.home section h2, .more h2 { margin: 56px 0 20px; font: 800 2rem/1.1 var(--ss-head); letter-spacing: -0.02em; color: var(--ss-green-dark); text-wrap: balance; }
html.js .home section { display: none; }
html.js .home section.is-on { display: block; }
html.js .home section h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { margin: 0; color: var(--ss-muted); }

/* Term switch above a course's cards; it is only written when the course has projects from more than one term. */
.terms { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.terms button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--ss-muted); font: 500 14px/1 var(--ss-body); cursor: pointer; transition: color .2s var(--ss-ease), background .2s var(--ss-ease), border-color .2s var(--ss-ease); }
.terms button:hover { color: var(--ss-ink); background: var(--ss-bg-soft); }
.terms button[aria-pressed="true"] { background: var(--ss-green-dark); border-color: var(--ss-green-dark); color: #fff; }
html:not(.js) .terms { display: none; }

/* A course split by section: a small heading with the count, then that section's cards. */
.group + .group { margin-top: 48px; }
.group[hidden] { display: none; }
.group > h3 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; font: 600 19px/1.3 var(--ss-nav); color: var(--ss-ink); }
.group > h3 span { font: 400 14px/1.3 var(--ss-body); color: var(--ss-muted); }

/* Project cards: cover on top, then title, who made it, one line about it, and the term. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card[hidden] { display: none; }
.card a { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: var(--ss-radius-lg); box-shadow: var(--ss-shadow); color: inherit; text-decoration: none; transition: transform .2s var(--ss-ease), box-shadow .2s var(--ss-ease); }
.card a:hover { transform: translateY(-2px); box-shadow: var(--ss-shadow-up); }
.card a:focus-visible { border-radius: var(--ss-radius-lg); }
.card .cover { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ss-bg-soft); border-bottom: 1px solid var(--ss-line); }
.card .cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ss-ease); }
.card a:hover .cover img { transform: scale(1.03); }
/* No cover given: the course icon on a quiet panel. */
.card .cover.is-blank { display: grid; place-items: center; background: linear-gradient(180deg, var(--tile-face-2) 0%, #ececec 100%); }
.card .cover.is-blank img { width: 38%; height: auto; max-height: 70%; object-fit: contain; }
.card .body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 16px 20px 18px; }
.card h3, .card h4 { margin: 0; font: 600 19px/1.3 var(--ss-nav); color: var(--ss-ink); text-wrap: balance; }
.card .by { font-size: 14px; line-height: 1.4; color: var(--ss-green-dark); font-weight: 500; }
.card .sum { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; font-size: 15px; line-height: 1.5; color: var(--ss-fg); }
.card .foot { margin-top: auto; padding-top: 10px; font-size: 13px; line-height: 1.4; color: var(--ss-muted); }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; gap: 16px; } }

/* Project page: one reading column. */
.read { width: 100%; max-width: calc(720px + 32px); margin: 0 auto; padding: 40px max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px)); }
.title .back { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font: 600 15px/1.2 var(--ss-nav); text-decoration: none; }
.title .back::before { content: "←"; font-family: var(--ss-body); transition: transform .2s var(--ss-ease); }
.title .back:hover::before { transform: translateX(-3px); }
.title h1 { margin: 12px 0 0; font: 800 clamp(2.1rem, 5.4vw, 3.1rem)/1.05 var(--ss-head); letter-spacing: -0.02em; color: var(--ss-green-dark); text-wrap: balance; }
.title .lede { margin: 16px 0 0; font-size: 1.2rem; line-height: 1.5; color: var(--ss-fg); }
.title .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 16px 0 0; font-size: 15px; color: var(--ss-muted); }
.title .meta .by { color: var(--ss-ink); font-weight: 600; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.links a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--ss-card); color: var(--ss-ink); font: 600 15px/1 var(--ss-body); text-decoration: none; transition: background .2s var(--ss-ease), border-color .2s var(--ss-ease), color .2s var(--ss-ease); }
.links a:hover { border-color: var(--ss-green-dark); color: var(--ss-green-dark); }
.links a.is-main { background: var(--ss-green-dark); border-color: var(--ss-green-dark); color: #fff; }
.links a.is-main:hover { background: var(--ss-green); border-color: var(--ss-green); color: #fff; }
.hero { margin: 32px 0 0; }
.hero img { display: block; width: 100%; height: auto; border: 1px solid var(--ss-line); border-radius: var(--ss-radius-lg); box-shadow: var(--ss-shadow); background: var(--ss-card); }

.prose { margin-top: 32px; font-size: 17px; line-height: 1.65; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 1em 0; }
.prose h2 { margin: 2.4em 0 0.6em; font: 800 1.6rem/1.15 var(--ss-head); letter-spacing: -0.02em; color: var(--ss-green-dark); text-wrap: balance; scroll-margin-top: 1.5rem; }
.prose h3 { margin: 1.9em 0 0.5em; font: 600 19px/1.35 var(--ss-nav); color: var(--ss-ink); }
.prose h4 { margin: 1.6em 0 0.4em; font: 600 16px/1.4 var(--ss-body); color: var(--ss-ink); }
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose li > ul, .prose li > ol { margin: 0.35em 0; }
.prose li::marker { color: var(--ss-green-dark); }
.prose code { padding: 2px 6px; border-radius: 4px; background: var(--code-bg); font: 500 0.875em var(--ss-mono); }
.prose pre { margin: 1.5em 0; padding: 16px 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--ss-card); font-size: 14px; line-height: 1.55; }
.prose pre code { padding: 0; background: none; font-size: inherit; }
.prose blockquote { margin: 1.75em 0; padding: 14px 0; border-block: 1px solid var(--line-strong); color: var(--ss-ink); font: 600 1.1rem/1.5 var(--ss-nav); }
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--line-strong); }
.prose figure { margin: 1.75em 0; }
.prose img, .prose video { max-width: 100%; height: auto; border-radius: 10px; }
.prose figure img, .prose figure video { display: block; width: 100%; border: 1px solid var(--ss-line); background: var(--ss-card); }
.prose figure a { display: block; cursor: zoom-in; }
.prose figcaption { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--ss-muted); }
.prose .video { margin: 1.75em 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--ss-ink); }
.prose .video iframe { display: block; width: 100%; height: 100%; border: 0; }
.prose .table { margin: 1.5em 0; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th { text-align: left; font-weight: 600; color: var(--ss-ink); border-bottom: 1px solid var(--line-strong); }
.prose th, .prose td { padding: 9px 16px 9px 0; vertical-align: top; }
.prose td { border-bottom: 1px solid var(--line); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
.tags li { padding: 5px 12px; border-radius: 999px; background: var(--ss-bg-soft); font-size: 13px; line-height: 1.3; color: var(--ss-fg); }
.more { margin-top: 16px; }
.more h2 { font-size: 1.6rem; margin-top: 72px; }

@media (max-width: 560px) { .read { padding-top: 24px; } .prose { font-size: 16px; } .title .lede { font-size: 1.1rem; } }
@media (prefers-reduced-motion: reduce) { .tile, .tile img, .card a, .card .cover img, .ss-home, .title .back::before { transition: none; } }
