/* ==========================================================================
   Inspiration Library for the Interaction Design Studio @ U--DIT 2026
   Layout: a sticky sorting menu on the left, sections of project cards on the right.
   One light theme on white. Geist Pixel = title, section headings, tags, left menu.
   Work Sans = other headings and labels. Source Serif = reading text.
   ========================================================================== */

:root {
  /* colour */
  --bg: #ffffff;
  --surface: #f5f5f2;       /* thumbnail placeholder, quiet panels */
  --line: #e6e5e0;
  --line-strong: #c9c7c0;
  --ink: #1e1f22;           /* dark neutral text, not pure black */
  --ink-2: #4f5156;         /* body text (5% darker than before) */
  --ink-3: #838488;
  --green: #1e332a;         /* deep green neutral: heading, duotone shadows, pressed tags */
  --accent: #2f5a45;        /* lighter green for small marks and hover underline */
  --accent-wash: #e5ede7;
  --sage: #eceee6;          /* duotone highlights */
  --glow: linear-gradient(90deg, #ff5e7e, #ffb547, #f4ff5c, #3df5b0, #3db9ff, #8a6bff, #ff5ee0, #ff5e7e);
  --dither: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAX0lEQVR42o3PoQ2DQABG4Y+ThAkIYQAEIWGLphMgsLiKbtAuwih3gcVqEOREQb088/L/RTt28MF6cDn5N2BDPJgyjwEvvNFjyD0v5EwBNRpMmFGiwgPPW4XLDfufF+kHsk8i3QN1ffgAAAAASUVORK5CYII=");

  /* type */
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --f-pixel: "Geist Pixel", "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --f-sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;

  /* motion and shape */
  --radius: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 220ms;

  color-scheme: light;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .map-float { animation: none !important; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;        /* the hover-glow room around each section never causes sideways scroll */
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.wrap { max-width: 1320px; margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: -999px; top: 8px; z-index: 20;
  background: var(--ink); color: var(--bg);
  padding: 8px 12px; font-family: var(--f-sans);
}
.skip:focus { left: 16px; }

/* --- Masthead -------------------------------------------------------------- */
.masthead { padding-block: 64px 40px; border-bottom: 1px solid var(--line); }

.site-title {
  margin: 0 0 24px;
  max-width: 22ch;
  font-family: var(--f-pixel);
  font-weight: 500;
  font-size: clamp(24px, 3.6vw, 46px);
  line-height: 1.08;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--green);
}
.site-title .at { color: var(--accent); white-space: nowrap; }

.intro {
  margin: 0;
  max-width: 62ch;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
}

.masthead-note {
  margin: 26px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-family: var(--f-sans);
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  align-items: center;
}
.masthead-note .by::before { content: "·"; margin-right: 14px; }
.version {
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  font: 500 11px/1.3 var(--f-pixel);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--green);
}

/* --- Layout: menu + library ------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 48px;
  padding-block: 32px 72px;
  align-items: start;
}

/* --- Left menu (all Geist Pixel) -------------------------------------------- */
.rail {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  max-height: calc(100vh - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  display: grid;
  gap: 24px;
  align-content: start;
  padding-block: 8px 28px;
  scrollbar-width: thin;
  min-width: 0;
  font-family: var(--f-pixel);
}
.rail-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
/* the slot fills the grid row, so the sticky menu inside it still sticks on desktop */
.rail-slot { align-self: stretch; min-width: 0; }
.rail-done { display: none; }
.rail-title { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.rail-state { font-size: 12px; color: var(--ink-3); }
.rail-note { margin: 0; font-size: 13px; color: var(--ink-2); }

.search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font: 500 14px var(--f-pixel);
  padding: 10px 12px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input:hover { border-color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--surface); }

.rail-group { display: grid; gap: 10px; }
.rail-heading {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-nav { display: grid; }
.section-nav a {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 8px;
  margin-inline: -8px;
  font-size: 13.5px;
  line-height: 1.3;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: var(--radius);
  transition: color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease);
}
.section-nav a:hover { color: var(--ink); background: var(--surface); transform: translateX(3px); }
.section-nav a[aria-current="true"] { color: var(--ink); background: var(--surface); }
.section-nav .n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.section-nav a.is-dim { opacity: .4; }

.theme-group { display: grid; gap: 8px; margin-bottom: 16px; }

/* territories page: each territory with its focus areas right under it */
.tree { display: grid; gap: 16px; }
.tree-group { display: grid; gap: 8px; }
.tree a {
  display: flex; gap: 8px; align-items: baseline;
  padding: 6px 8px; margin-inline: -8px;
  font-size: 13.5px; line-height: 1.3;
  text-decoration: none; color: var(--ink);
  border-radius: var(--radius);
  transition: color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease);
}
.tree a .num { color: var(--accent); }
.tree a .n { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tree a:hover { background: var(--surface); transform: translateX(3px); }
.tree a[aria-current="true"] { background: var(--surface); }
.tree a.is-dim { opacity: .4; }
.tree .chips { padding-left: 0; }
.theme-group-name { margin: 0; font-size: 12.5px; color: var(--ink-2); }

.rail-actions { display: flex; }
.toggle {
  justify-self: start;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink-2);
  font: 500 13px var(--f-pixel);
  cursor: pointer;
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease);
}
.toggle:hover { border-color: var(--ink); color: var(--ink); }
.toggle[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--bg); }
.toggle.ghost { border-color: transparent; padding-inline: 4px; text-decoration: underline; text-underline-offset: 4px; }

/* --- Tags (Geist Pixel), used as filters and on cards ------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  background: var(--bg);
  color: var(--ink-2);
  font: 500 12px/1.3 var(--f-pixel);
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease);
}
.chip .n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
button.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--bg); }
button.chip[aria-pressed="true"] .n { color: var(--bg); opacity: .65; }
span.chip { font-size: 11.5px; padding: 3px 8px; border-color: var(--line); }
span.chip.is-on { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }

/* --- Library sections -------------------------------------------------------- */
.library { min-width: 0; }
.status {
  margin: 0 0 20px;
  font: 13px var(--f-sans);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
/* Off-screen sections are skipped by the browser until you scroll near them (faster first load).
   The side padding keeps room for the hover glow, which would otherwise be clipped. */
.section {
  --room: 28px;
  padding: 8px var(--room) 56px;
  margin-inline: calc(-1 * var(--room));
  scroll-margin-top: 16px;
  content-visibility: auto;
  contain-intrinsic-size: auto 1400px;
}
/* a rule between visible sections, drawn only across the content width */
.section:not([hidden]) ~ .section:not([hidden]) {
  padding-top: 44px;
  background: linear-gradient(var(--line), var(--line)) no-repeat var(--room) 0 / calc(100% - 2 * var(--room)) 1px;
}
.section-head { display: grid; gap: 10px; margin-bottom: 26px; max-width: 70ch; }
.section-title {
  margin: 0;
  font-family: var(--f-pixel);
  font-weight: 500;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.15;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.section-title .n { color: var(--ink-3); font-size: .6em; margin-left: .7em; vertical-align: middle; }
.section-intro { margin: 0; font-size: 17px; color: var(--ink-2); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 22px;
}

/* --- Cards ------------------------------------------------------------------- */
.card {
  position: relative;
  z-index: 0;               /* own stacking layer, so the glow can sit behind the card */
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  transition: transform var(--t) var(--ease), border-color var(--t) var(--ease);
}
/* hover shadow: a bright gradient, blurred and slowly flowing, revealed under the card */
.card::before {
  content: "";
  position: absolute;
  inset: 14px 8px -10px;
  z-index: -1;
  border-radius: 12px;
  background: var(--glow);
  background-size: 300% 100%;
  filter: blur(22px) saturate(1.2);
  opacity: 0;
  transform: translateY(4px) scale(.96);
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
  animation: glow-flow 5s linear infinite;
  animation-play-state: paused;
}
.card:hover, .card:focus-within { transform: translateY(-5px); border-color: transparent; }
.card:hover::before, .card:focus-within::before {
  opacity: .9;
  transform: translateY(8px) scale(1);
  animation-play-state: running;
}
@keyframes glow-flow {
  from { background-position: 0% 50%; }
  to   { background-position: 300% 50%; }
}

/* thumbnail: a screenshot of the live site, 16:10, dimmed to a green duotone.
   One image only: grayscale, then multiplied by sage (highlights) and screened with deep green
   (shadows), which maps black to green and white to sage. Hover fades both layers to show colour. */
.preview {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  background: var(--sage);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.preview .shot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  filter: grayscale(1) contrast(1.05);
  transition: transform 700ms var(--ease), filter 380ms var(--ease);
}
.preview:not(.no-shot)::before,
.preview:not(.no-shot)::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 380ms var(--ease);
}
.preview::before { background: var(--sage);  mix-blend-mode: multiply; }
.preview::after  { background: var(--green); mix-blend-mode: screen; }
.card:hover .preview .shot, .card:focus-within .preview .shot { transform: scale(1.04); filter: none; }
.card:hover .preview::before, .card:hover .preview::after,
.card:focus-within .preview::before, .card:focus-within .preview::after { opacity: 0; }

/* fine ordered-dither texture over the duotone, removed with the colour reveal */
.preview .dither {
  position: absolute; inset: 0;
  z-index: 2;
  background-image: var(--dither);
  background-size: 6px 6px;
  image-rendering: pixelated;
  opacity: .32;
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 380ms var(--ease);
}
.card:hover .preview .dither, .card:focus-within .preview .dither { opacity: 0; }

/* cards without a screenshot: the same duotone as a soft gradient, dithered */
.preview.no-shot {
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(236, 238, 230, .9), transparent 60%),
    linear-gradient(155deg, var(--sage) 0%, #b7c4b8 55%, #6f8a7b 100%);
}
.preview.no-shot .dither { opacity: .45; }
.card:hover .preview.no-shot .dither { opacity: .25; }
.preview .glyph {
  position: absolute; z-index: 1; left: 16px; top: 50%; transform: translateY(-50%);
  font: 500 72px/1 var(--f-pixel);
  color: var(--green);
  opacity: .22;
  text-transform: uppercase;
}

/* the site's address sits on the thumbnail, revealed on hover */
.preview .domain-tag {
  position: absolute; z-index: 3; left: 10px; bottom: 10px; max-width: calc(100% - 20px);
  padding: 3px 7px;
  border-radius: 1px;
  background: rgba(255, 255, 255, .94);
  font: 500 11px var(--f-pixel);
  color: var(--green);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.preview.no-shot .domain-tag { opacity: 1; transform: none; background: transparent; padding-inline: 6px; }
.card:hover .preview .domain-tag, .card:focus-within .preview .domain-tag { opacity: 1; transform: none; }

/* opaque body so the hover glow shows only around the card, never through it */
.card-body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 16px 18px; flex: 1;
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}
.card-title { margin: 0; font: 600 17px/1.3 var(--f-sans); text-wrap: balance; }
.card-title a { text-decoration: none; color: var(--ink); }
/* the title link covers the whole card, so clicking anywhere opens the site */
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card-title a span {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0 2px;
  background-position: 0 100%;
  transition: background-size var(--t) var(--ease);
}
.card:hover .card-title a span, .card-title a:focus-visible span { background-size: 100% 2px; }
.card-title .open {
  display: inline-block; margin-left: 4px;
  font-family: var(--f-pixel); font-size: 13px; color: var(--ink-3);
  transition: transform var(--t) var(--ease), color var(--t) var(--ease);
}
.card:hover .card-title .open { transform: translate(2px, -2px); color: var(--accent); }

.meta { margin: 0; font: 13px/1.4 var(--f-sans); color: var(--ink-3); }
.desc { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.desc a, .also a {
  position: relative; z-index: 1;
  color: var(--ink);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.desc a:hover, .also a:hover { text-decoration-color: var(--accent); }
.desc strong { font-weight: 600; color: var(--ink); }
.also { margin: 0; font: 13px/1.4 var(--f-sans); color: var(--ink-3); }
.card .chips { margin-top: auto; padding-top: 10px; position: relative; z-index: 1; pointer-events: none; }

.empty { margin: 48px 0; font-size: 18px; color: var(--ink-2); }

/* --- Where to look next, terms: a heading row, a tab row, one panel at a time ---------- */
.more { padding-block: 48px; border-top: 1px solid var(--line); }
.more-head { margin-bottom: 18px; }
.lede { margin: 0; max-width: 62ch; font-size: 16px; color: var(--ink-2); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tab { cursor: pointer; }
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab[aria-selected="true"], .tab[aria-selected="true"]:hover { background: var(--green); border-color: var(--green); color: var(--bg); transform: none; }
.tab[aria-selected="true"] .n { color: var(--bg); opacity: .65; }
.tab-panel:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* sources: favicon + name on one line, a short note under it, packed in columns */
.look-list, .term-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 28px;
}
.look-list li {
  display: grid; gap: 1px; align-content: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.look-name { font: 500 15px/1.35 var(--f-sans); }
.look-name a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none;
  transition: color var(--t) var(--ease);
}
.look-name a:hover { color: var(--accent); }
.look-name a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.look-name .where { color: var(--ink-3); font-weight: 400; }
.look-list .note { padding-left: 24px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }

.fav {
  flex: none;
  width: 16px; height: 16px;
  border-radius: 1px;
  background: var(--sage) url("favicons.png") no-repeat;
  box-shadow: 0 0 0 1px var(--line);
}
.fav.no-icon {
  background: var(--green);
  color: var(--sage);
  font: 500 11px/16px var(--f-pixel);
  text-align: center;
  text-transform: uppercase;
}

/* terms: name in Geist Pixel, then the period, meaning and names to look up */
.term { padding: 12px 0 14px; border-top: 1px solid var(--line); }
.term-name {
  margin: 0;
  font: 500 14px/1.3 var(--f-pixel);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--green);
}
.term-when { margin: 2px 0 0; font: 12px/1.4 var(--f-sans); color: var(--ink-3); }
.term-means { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.term-names { margin: 4px 0 0; font: 13px/1.45 var(--f-sans); color: var(--ink-2); }

/* the compiler's name opens an email (the address itself is not shown on the page) */
.name-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color var(--t) var(--ease), text-decoration-color var(--t) var(--ease);
}
.name-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* --- Page links: fixed to the top right of both pages, underlined, in Geist Mono --------- */
.site-nav {
  position: fixed; z-index: 30;
  top: env(safe-area-inset-top, 0px);
  right: max(0px, env(safe-area-inset-right, 0px));
  display: flex; gap: 4px 22px; flex-wrap: wrap; justify-content: flex-end;
  margin: 0;
  padding: 12px 20px 12px 18px;
  background: rgba(255, 255, 255, .96);
  border-bottom-left-radius: 2px;
}
.site-link {
  position: relative;
  padding: 2px 0 5px;
  color: var(--ink);
  font: 500 14px/1.2 var(--f-pixel);
  letter-spacing: .02em;
  -webkit-text-stroke: .4px currentColor;   /* Geist Pixel has one weight; this makes the links read bold */
  text-decoration: none;
  /* the underline: a hairline at rest, the bright glow gradient sweeping through on hover */
  background:
    linear-gradient(var(--glow-solid, var(--ink)), var(--glow-solid, var(--ink))) left bottom / 100% 1.5px no-repeat,
    var(--glow) left bottom / 0% 3px no-repeat;
  transition: background-size 380ms var(--ease), color 220ms var(--ease);
}
.site-link:hover, .site-link:focus-visible {
  background-size: 100% 0, 100% 3px;
  animation: underline-flow 2.4s linear infinite;
}
/* a bigger invisible tap area around each link, for fingers */
.site-link::before { content: ""; position: absolute; inset: -10px -8px; }
.site-link[aria-current="page"] { color: var(--green); --glow-solid: var(--green); background-size: 100% 3px, 0% 3px; }
.site-link[aria-current="page"]:hover { background-size: 100% 0, 100% 3px; }
@keyframes underline-flow { to { background-position: left bottom, 300px bottom; } }

/* --- Thematic Territories ---------------------------------------------------------------- */
.course-line {
  margin: -10px 0 22px;
  font: 500 14px/1.4 var(--f-pixel);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
}
.intro-set { display: grid; gap: 12px; max-width: 70ch; }
.intro-set .intro { max-width: none; }
.intro-set .intro-2 { font-size: 16.5px; color: var(--ink-3); }

.view-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 20px; }
.view-bar .status { margin: 0; }
.view-tabs { margin: 0; flex-wrap: nowrap; }
.view-tabs .tab { padding: 7px 14px; font-size: 13px; }

.territory .section-title .num {
  display: inline-block; margin-right: .6em;
  color: var(--accent); font-size: .62em; vertical-align: middle;
}
/* the "context and meaning" text: no heading, just smaller body text */
.section-head .context, .focus-card .context {
  margin: 0;
  font-size: 14px; line-height: 1.5; color: var(--ink-2);
}

/* focus-area cards: gradient + dither + initials thumbnail */
.focus-card .desc + .desc { margin-top: -2px; }
.focus-card .context { font-size: 13.5px; line-height: 1.5; margin-top: 2px; }
.preview.gen {
  background:
    radial-gradient(70% 90% at var(--gx) var(--gy), rgba(236, 238, 230, .95), transparent 70%),
    linear-gradient(var(--angle), var(--sage) 0%, #b7c4b8 48%, #5f7a6b 100%);
}
.preview.gen .gen-colour {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 420ms var(--ease);
}
/* hover colours: gradients in the manner of Swiss posters — signal red, orange, yellow,
   cobalt, sky blue, pink and black on warm paper white */
.sw-0 { background: linear-gradient(180deg, #e4002b 0%, #ff6a13 52%, #f4e9dc 100%); }
.sw-1 { background: radial-gradient(circle at 30% 72%, #ffd100 0%, #ff6a13 26%, #e4002b 54%, #2b0a3d 100%); }
.sw-2 { background: linear-gradient(160deg, #0033a0 0%, #00a3e0 55%, #eef3f1 100%); }
.sw-3 { background: radial-gradient(110% 90% at 82% 14%, #ff7eb6 0%, #e4002b 46%, #111 100%); }
.sw-4 { background: linear-gradient(125deg, #111 0%, #0033a0 38%, #00a3e0 72%, #f4e9dc 100%); }
.sw-5 { background: linear-gradient(90deg, #111 0%, #2f2f2f 28%, #ff6a13 70%, #ffd100 100%); }
.sw-6 { background: radial-gradient(circle at 50% 112%, #f4e9dc 0%, #00a3e0 34%, #0033a0 64%, #111 100%); }
.sw-7 { background: linear-gradient(205deg, #ffd100 0%, #ff7eb6 48%, #e4002b 100%); }
.preview.gen .dither { opacity: .42; z-index: 2; }
.preview .initials {
  position: absolute; z-index: 3;
  left: 14px; bottom: 8px;
  font: 500 clamp(40px, 4.6vw, 58px)/.9 var(--f-pixel);
  letter-spacing: -.01em;
  color: var(--green);
  opacity: .85;
  transition: color 320ms var(--ease), transform 500ms var(--ease), opacity 320ms var(--ease);
}
.preview.gen .domain-tag { z-index: 4; left: 10px; right: auto; bottom: auto; top: 10px; opacity: 1; transform: none; }
.card:hover .preview.gen .gen-colour, .card:focus-within .preview.gen .gen-colour { opacity: 1; }
.card:hover .preview.gen .dither, .card:focus-within .preview.gen .dither { opacity: .28; }
/* on hover the initials print in "difference", so they stay legible on light and dark poster colours */
.card:hover .preview .initials, .card:focus-within .preview .initials { color: #fff; opacity: 1; mix-blend-mode: difference; transform: translateY(-3px); }

/* hybrid prompts */
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
#hybrid .lede { margin: 0 0 22px; }
.prompt-card .card-body { gap: 10px; padding-top: 18px; }
.prompt-title {
  margin: 0;
  display: grid; gap: 4px;
  font: 500 15px/1.3 var(--f-pixel);
  letter-spacing: .01em;
  color: var(--green);
}
.prompt-title .times { color: var(--accent); }
.prompt-card .desc { font-size: 15.5px; color: var(--ink); }
/* hover: the glow under the card takes the Swiss poster colours */
.prompt-card::before {
  background: linear-gradient(90deg, #e4002b, #ff6a13, #ffd100, #00a3e0, #0033a0, #ff7eb6, #e4002b);
  background-size: 300% 100%;
}

/* --- Mind map ------------------------------------------------------------------------------ */
.map {
  position: relative; overflow: hidden;
  height: min(78vh, 860px); min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: #fbfbf9;
  background-image: radial-gradient(var(--line) 1px, transparent 1.2px);
  background-size: 22px 22px;
  touch-action: none;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.map.is-dragging { cursor: grabbing; }
.map-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-world.is-animating { transition: transform 600ms var(--ease); }
.map-lines { position: absolute; overflow: visible; pointer-events: none; }
.map-lines path { fill: none; vector-effect: non-scaling-stroke; transition: opacity 300ms var(--ease), stroke 300ms var(--ease); }
/* light dotted straight lines */
.line-root, .line-branch { stroke-linecap: round; stroke-dasharray: 0.1 7; }
.line-root { stroke: #8f988f; stroke-width: 3; }
.line-branch { stroke: #a9afa8; stroke-width: 2.4; }
.line-branch.is-dim { opacity: .3; }

.map-root, .map-territory { position: absolute; transform: translate(-50%, -50%); }
.map-root { white-space: nowrap; }
.map-root {
  left: 0; top: 0;
  padding: 18px 24px;
  background: var(--green); color: var(--bg);
  border-radius: 2px;
  font: 500 46px/1 var(--f-pixel); letter-spacing: .03em; text-transform: uppercase;
  padding: 24px 32px;
  box-shadow: 0 14px 40px -12px rgba(30, 51, 42, .55);
}
.map-territory {
  display: inline-flex; align-items: flex-start; gap: 12px;
  width: max-content; max-width: 340px;
  text-align: left; line-height: 1.15;
  padding: 14px 20px;
  background: var(--bg); color: var(--green);
  border: 2px solid var(--green); border-radius: 2px;
  font: 500 24px/1.15 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer;
  transition: background 260ms var(--ease), color 260ms var(--ease), box-shadow 260ms var(--ease), opacity 260ms var(--ease);
}
.map-territory .num { color: var(--accent); transition: color 260ms var(--ease); }
.map-territory:hover {
  background: var(--green); color: var(--bg);
  box-shadow: -10px 8px 22px -10px var(--c1), 10px 8px 22px -10px var(--c2);
}
.map-territory:hover .num { color: var(--c2); }
.map-territory.is-dim { opacity: .35; }

/* the same cards, floating */
.map-float { position: absolute; width: 250px; animation: float 7s ease-in-out infinite; }
.map-float.is-dim { opacity: .22; }
.map-float:hover { animation-play-state: paused; z-index: 2; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.focus-card.is-mini .card-body { padding: 12px 12px 14px; gap: 6px; }
.focus-card.is-mini .card-title { font-size: 15.5px; }
.focus-card.is-mini .desc { font-size: 13.5px; line-height: 1.45; }
.focus-card.is-mini .meta { font-size: 12px; }
.focus-card.is-mini .preview .initials { font-size: 46px; }

.map-controls { position: absolute; left: 12px; top: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; }
.map-btn { cursor: pointer; background: rgba(255, 255, 255, .94); min-width: 34px; justify-content: center; padding: 6px 10px; font-size: 13px; }
.map-btn:hover { border-color: var(--ink); color: var(--ink); }
.map-btn[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--bg); }
.map-hint {
  position: absolute; left: 12px; bottom: 10px; z-index: 5; margin: 0;
  padding: 4px 8px; background: rgba(255, 255, 255, .9);
  font: 12px/1.3 var(--f-sans); color: var(--ink-3);
  pointer-events: none;
}

/* --- Footer -------------------------------------------------------------------- */
.colophon { border-top: 1px solid var(--line); padding-block: 44px 64px; }
.colophon-title {
  margin: 0 0 14px;
  font: 500 15px var(--f-pixel);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.credit { margin: 0 0 10px; font: 500 15px var(--f-sans); }
.feedback { margin: 0; font: 14px var(--f-sans); color: var(--ink-2); }

/* --- Touch screens: no hover, so no lift, no glow, and the address is always shown --- */
@media (hover: none) {
  .card:hover, .card:focus-within { transform: none; border-color: var(--line); }
  .card:hover::before, .card:focus-within::before { opacity: 0; animation: none; }
  .card:hover .preview .shot { transform: none; }
  .preview .domain-tag { opacity: 1; transform: none; }
  .section-nav a:hover { transform: none; }
  button.chip:hover { transform: none; }
}

/* --- Narrow screens: the menu sits above the cards as compact rows -------------- */
@media (max-width: 880px) {
  .masthead { padding-block: 64px 26px; }   /* room so the fixed page links never sit on the title */
  .intro { font-size: 17px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 20px 56px; }

  .rail {
    position: static; max-height: none; overflow: visible;
    gap: 14px; padding-block: 0 18px;
    border-bottom: 1px solid var(--line);
  }
  .rail-head { padding-bottom: 0; border-bottom: 0; }
  .rail-group { gap: 6px; }

  /* sideways rows that run to the screen edge, with a soft fade to hint there is more */
  .scroller {
    display: flex; flex-wrap: nowrap; gap: 6px;
    overflow-x: auto; overscroll-behavior-x: contain;
    margin-inline: -16px; padding: 2px 16px 6px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
  }
  .scroller::-webkit-scrollbar { display: none; }

  .section-nav a {
    flex: none; margin: 0;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 1px;
    white-space: nowrap;
    font-size: 13px;
  }
  .section-nav a[aria-current="true"] { background: var(--green); border-color: var(--green); color: var(--bg); }
  .section-nav a[aria-current="true"] .n { color: var(--bg); opacity: .65; }

  .theme-group { display: flex; flex: none; align-items: center; gap: 6px; margin: 0; }
  .theme-group + .theme-group { padding-left: 10px; border-left: 1px solid var(--line); }
  .theme-group-name { white-space: nowrap; font-size: 11.5px; color: var(--ink-3); }
  .theme-group .chips { flex-wrap: nowrap; }
  button.chip { white-space: nowrap; padding: 7px 9px; }

  .section { --room: 16px; contain-intrinsic-size: auto 3000px; }
  .section:not([hidden]) ~ .section:not([hidden]) { padding-top: 36px; }
  .section-intro { font-size: 16px; }
  .grid { gap: 18px; }
  .more { padding-block: 40px; }
  .tabs { flex-wrap: nowrap; margin-bottom: 12px; }
  .tabs .chip { white-space: nowrap; flex: none; padding: 7px 9px; }
}

/* --- Phones: floating sort button and bottom sheet ------------------------------------ */
.sort-fab, .sheet-backdrop { display: none; }

@media (max-width: 880px) {
  .sort-fab {
    position: fixed; z-index: 40;
    left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 18px;
    border: 0; border-radius: 999px;
    background: var(--green); color: var(--bg);
    font: 500 14px/1 var(--f-pixel);
    text-transform: uppercase; letter-spacing: .04em;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(30, 51, 42, .28), 0 1px 3px rgba(30, 51, 42, .3);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: fab-in 260ms var(--ease);
  }
  .sort-fab[hidden] { display: none; }
  /* the menu lives in the sheet on phones (only once the script has set this class) */
  .has-sort-button .rail:not(.is-sheet) { display: none; }
  .has-sort-button .layout { gap: 0; }
  .sort-fab:active { transform: translateX(-50%) scale(.97); }
  .sort-fab:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
  .sort-fab-count:empty { display: none; }
  .sort-fab-count { text-transform: none; letter-spacing: 0; font-size: 12px; opacity: .75; }
  @keyframes fab-in { from { opacity: 0; transform: translate(-50%, 12px); } }

  .sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(30, 51, 42, .35);
    opacity: 0; transition: opacity 220ms var(--ease);
  }
  .sheet-backdrop[hidden] { display: none; }
  .sheet-backdrop.is-shown { opacity: 1; }

  .rail.is-sheet {
    position: fixed; z-index: 50;
    top: auto; left: 0; right: 0; bottom: 0;
    max-height: 82vh; max-height: 82dvh;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: var(--bg);
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
    box-shadow: 0 -8px 30px rgba(30, 51, 42, .18);
    transform: translateY(100%);
    transition: transform 260ms var(--ease);
  }
  .rail.is-sheet.is-shown { transform: none; }
  .rail.is-sheet .rail-head {
    position: sticky; top: 0; z-index: 1;
    margin-inline: -16px; padding: 16px 16px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .rail.is-sheet .rail-state { margin-left: auto; }
  .rail.is-sheet .rail-done {
    display: inline-block;
    padding: 7px 12px;
    border: 0; border-radius: 1px;
    background: var(--green); color: var(--bg);
    font: 500 13px var(--f-pixel);
    text-transform: uppercase; letter-spacing: .04em;
    cursor: pointer;
  }
  .sheet-open, .sheet-open body { overflow: hidden; }

  /* room so the button never covers the last lines of the page */
  .colophon { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* mid-width screens with a mouse (a narrow browser window): wrap the rows instead of
   scrolling sideways, since a mouse wheel cannot scroll them */
@media (max-width: 880px) and (hover: hover) and (pointer: fine) {
  .scroller {
    flex-wrap: wrap; overflow: visible;
    margin-inline: 0; padding: 0;
    -webkit-mask-image: none; mask-image: none;
  }
  .theme-groups { display: grid; gap: 8px; }
  .theme-group { flex-wrap: wrap; }
  .theme-group + .theme-group { padding-left: 0; border-left: 0; }
  .theme-group .chips { flex-wrap: wrap; }
  .section-nav a { padding: 5px 9px; }
  button.chip { padding: 4px 8px; }
}

@media (max-width: 600px) {
  .site-nav { padding: 9px 14px 9px 12px; gap: 2px 16px; }
  .site-link { font-size: 12.5px; }
  .masthead { padding-top: 58px; }   /* phones only: room so the fixed links never sit on the title */
  .map { height: 60vh; min-height: 380px; }
  .map-hint { display: none; }
  .view-bar { align-items: flex-start; flex-direction: column; }
  .masthead-note .by::before { content: none; }
  .masthead-note .by { flex-basis: 100%; }
}

@media (max-width: 420px) {
  .site-title { font-size: 23px; }
  .card-body { padding: 14px 14px 16px; }
}
